We need to measure the [x,y,z] beetween the red’s circle’s marked in the picture.
How we need to do that? We have 2 components, one inside another. We need to know how to measure the distance of the x,y,z axis of the inside red block to the zero ground of the model. But to do that, we CAN’T add the values of the big gray box and the values of the red block inside, because we’re going to have too many elements one inside another, and calculate all this can be slow and it’s not a good solution.
` Sketchup.active_model.entities.each{|ent|
puts "BigBox #{ent.transformation.origin.to_s}" if ent.is_a?(Sketchup::ComponentInstance) }
Sketchup.active_model.entities.each{ |ent|
puts ent.definition.entities.each{ |e|
puts "RedBox #{e.transformation.origin.to_s}" if e.is_a?(Sketchup::ComponentInstance)
} if ent.is_a?(Sketchup::ComponentInstance) }`