@honkinberry said:
I want to be able to place a component like a bench, and then immediately rotate it about the Z axis.
So both the placement and the rotation should be linked very smoothly to accurate cursor position.
OH.. well that is extremely EASY.
Because that functionality is built-into the native component placement tool, which is accessible from the Ruby API.
So.. for example the bench's name is "Bench Wood HighBack"
def place_bench()
mdl = Sketchup.active_model
compdef = mdl.definitions["Bench Wood HighBack"]
if compdef
mdl.place_component(compdef,false)
return true
else
return false
end
end
The trick is the 2nd argument to Model#place_component() must be false, so that you can use the rotate handles (they appear as little red crosses,) just after you choose the insert point.
Insert the bench.. then move the cursor to the top of the comp's boundingbox, and you should see 4 red crosses appear. Hover over one of the cross handles, and the cursor will change to a rotate cursor. Hold & Drag (or Click Move Click,) to rotate about the Z axis.
π