I’m working on a simple script that randomizes the z axis for an array of components between set floor and ceiling values and I’ve got everything down except for the part where the individual entities actually make the transformation. Here’s what I’ve got so far.
model = Sketchup.active_model # Open model entities = model.entities # All entities in model selection = model.selection # Current selection selection.each do |entity| point = Geom::Point3d.new 0, 0, rand(10) * -1 t = Geom::Transformation.new point z = t.zaxis puts entity end
At this point I get lost. What I would expect to do if I were working in a vacuum would be to find the variable wherein the coordinates of the entity’s model space origin are stored, after which I would adjust the z-axis value appropriately. Ideas?