[Solved] Need help with a simple one
-
How do I iterate through a selections definitions?
The [0] is only the first in the selection. I need to get them all.sel.each {|e| # Ignore items in the selection that are not components. next if not (e.is_a? Sketchup;;ComponentInstance) behavior = model.definitions[0].behavior status = behavior.always_face_camera = false } -
sel.each {|**e**|
Notice theethere that's the current entity from the selection.So change the code to
behavior = e.definition.behavior -
Thanks. I tried that and was so close, I had an s to much in definitions.
Simple it was. -
sel.each{|e|e.definition.behavior.always_face_camera=false if e.is_a?(Sketchup;;ComponentInstance)}as a one-liner
-
Even better. Thanks.
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