Ruby to unhide hidden contents in selected group?
-
Hello,
I have lots of groups in my scenes and some of them have objects in them whose lines must be hidden. Now and then I have to edit the lines.
Of course, I can: open the group -> unhide hidden geometry -> unhide all (in group) -> hide hidden geometry ....
It would be very useful if I could just select the group and press a button to it all happen.Anyone know if there's a plugin that can unhide the contents of a selected group / component?
Greetings, Max
-
Since you can't edit those edges without opening the group for editing, why not just set up a keyboard shortcut that operates on the opened group?
-
View > Hidden Geometry toggles on/off... so you can then see a hidden line and 'edit' it without having to un-hide it at all...
This code will un-hide all edges in a group you are editing.
It remembers the edges and when its inverse is run it hides them again.
Copy+paste the code into a plain text file in the Plugins folder called "TIG-edgehidetoggle.rb". Restart Sketchup to get it to auto-load. To use it edit a group [double-click] and in the Ruby Console typeTIG.edgehidetoggle
to un-hide all edges, when you are doneTIG.edgehidetoggle
to hide all of those edges again, obviously erased or new edges are excluded from processing...
You can easily make a menu item to shortcut to; or a toolbar button...require 'sketchup.rb' module TIG def TIG.edgehidetoggle() model=Sketchup.active_model ents=model.entities ants=model.active_entities return if ents==ants return unless ants.parent.group? unless @hiddenedges and @hiddenedges[0] ### show and remember @hiddenedges=[] ants.each{|e|@hiddenedges << e if e.class==Sketchup;;Edge and e.hidden?} @hiddenedges.each{|e|e.hidden=false} if @hiddenedges[0] return 'un-hidden' else ### hide and forget @hiddenedges.each{|e|e.hidden=true if e.valid?} @hiddenedges=[] return 'hidden' end end end
-
TIG - great! Exactly what I was looking for. Especially when working with large scenes my old workflow took some time. With your script, a menu-item & keyboard shortcut it's nice and easy.
Thanks a lot
Greetings, Max
Advertisement