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
Plugin: WebConsole
2010-05-22 * Eliminated the Results textarea in favor of SketchUp's Ruby Console. * Automatic resize of the code textarea. * Changed ...
(sketchuptips.blogspot.com)
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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement