π‘ LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering
Download Trial
[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 thee
there 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.
Advertisement