JClements wrote:This addresses only linear dimensions.
I tried to guess at editing the script to add radial dimensions, but failed.
Also would like separate menu items for Leader text and Screen text .... and possibly All text. Could someone help, please?
This script is readily edited with Notepad...
The lines that set things hidden=true
or hidden=falsee.hidden=true if e.typename=="DimensionLinear"
ande.hidden=false if e.typename=="DimensionLinear"
can be augmented OR changed...
e.g. add lines below them to affect other 'types' of thing, so for radial dimensions try copying the lines down and changing ... e.typename=="DimensionLinear"
To find the typename
of any entity just select one and type/copy+paste this line of text into the Ruby Console Sketchup.active_model.selection.typename
It returns its typename
- it is case-sensitive - so if you have highlighted a radial dim it will say DimensionRadial
This way you can find and add/edit to switch any 'class' of entity on/off
For example substituting "Text"
affects all Text...
To make another script to work on Text called 'textvis
' simply copy this script with that new name and edit it with Notepad - find and replace all dimsvis
- so that is the new command for it...
Change strings like "Dimension Visibility Toggle"
to suit - e.g. "Text Visibility Toggle"
The lines regarding 'dimensions' can be either commented out [just add a # to the start of them] or they can be edited to read '... e.typename=="Text"
To differentiate between leader-text and screen-text you need to test more things with and
e.g. e.hidden=true if e.typename=="Text" and e.leader_type==1
To select only Leader-Text.
or ...and e.leader_type!=1
To select Text that is NOT [!] Leader-Text - i.e 'on screen'...
[It's 0 for 'None' [on screen], 1 for 'View based' [with leader], and 2 for 'Pushpin' "leader_types"]
Hope this helps - we'll make aRuby Guru of you yet...