Selecting only Lock Groups
-
Is it possible to select only locked groups, so I could separate the locked from the unlocked?
Ken, thanks in advance
-
Sure. Just query the component.locked? or group.locked? methods.
FYI - there is a current bug that allows a locked group or comp to be moved by Ruby (unless it's been fixed by a recent maintenance release that I've chosen to ignore).
-
Thanks Todd for your response. Guess I put my question in the wrong group. I was wondering if there was a Ruby Script to just select locked groups or components.
Guess there isn't as of now.
Again thanks.
Ken
-
Sketchup.active_model.active_entities.each{|ent| if(ent.typename=="Group" && ent.locked?) Sketchup.active_model.selection.add ent end }
paste the above into a ruby console (I suggest using Jim's Webconsole) and Execute
http://sketchuptips.blogspot.com/2007/08/plugin-webconsolerb.html
warning: no testing for errors or bugs, use at your own risk
-
I can code that in one statement....
Sketchup.active_model.selection.add((Sketchup.active_model.entities.collect {|ent| ent if ent.locked?}).to_a.compact)
Todd
-
all right, respect. there you go webconsole
Advertisement