[Request] Dimension and Leader Text - Toggle Visibility
-
I realize scripts have been written to find, select, and segregate certian types of entities; however, they usually resort to creating Layers to isolated them.
Is there an alternative method to toggle the visibility of Dimensions or Leader Text for an entire file, similar to what SU natively does with contruction points and guides (without relying on Layers)? If so then, a menu item for each in the View menu would meet my needs (a toolbar or context menu wouldn't be necessary).
I use dimensioning primarily as an auditing/verification process for my "Final" drafts and Leader Text for denoting modeling/reference notes. They save a lot of time, but make "viewability" UGLY and it would be very helpful to toggle them off when not needed.
-
Would grouping then hiding them be a suitable solution? I think this could be done through ruby...
-
def dimsvis() if $dims_visible Sketchup.active_model.entities.each{|e|e.hidden=true if e.typename=="DimensionLinear"} $dims_visible=false else Sketchup.active_model.entities.each{|e|e.hidden=false if e.typename=="DimensionLinear"} $dims_visible=true end#if end#def if not file_loaded?(__FILE__) UI.menu("Plugins").add_item("Dimension Visibility Toggle"){dimsvis()} end#if file_loaded(__FILE__)
This is the basis of what you want...
Copy and paste this code into a new file called say dimsvis.rb in your plugins folder...
Then typing dimsvis in the Ruby Console should do what you want...
Also the menu item "Dimension Visibility Toggle" does the same...
You can shortcut to this menu item - so say pressing F12 would toggle the dimensions' visibility.
When it's first run it currently always shows the dimensions, so if they are already showing they will remain shown and you need to re-run it will hide then, however, after that it toggles visibility on/off for that session.
You could improve it by adding an attribute to the model to show if dims are visible; it could then read that and reverse the settings and re-saved attribute to use later - that will last across sessions... I'll leave that up to you... -
Thank you much.
[Edit] Any chance it can be tweeked to toggle dimensions for the ENTIRE Model (in all sublevels)?
-
TIG:
I did a real quick test and the data mining functions seems to work great. I'll be using it extensively during the next week or two. If anything comes up I will post here.
Thanks again!
"You're a gentlemen and a scholar." ... W.C. Fields
Advertisement