Using model.place_component my_definition
-
When I use the following to place an instance,
repeat = false model.place_component my_definition, repeat
the definition attaches itself to the mouse pointer by the model's origin. This is a problem when the component is off screen. How do I place the definition so that the corner of its bounding box is on the tip of the mouse pointer?
I can move a_instance to the model's origin by:
bb=a_instance.bounds point = Geom::Point3d.new -bb.corner(0)[0],-bb.corner(0)[1],-bb.corner(0)[2] t = Geom::Transformation.new point a_instance.move! t
but that doesn't solve my problem since
model.place_component my_definition
uses its original location in the model. Erasing, and replacing my_definition (after it is relocated) seems to be the way to go, however I have not been successful doing so. Any suggestios that I can explore? -
Doesn't it use the insertion point of the component?
-
Sigh....Now how come I couldn't find that method by myself? Thanks:
bb=my_instance.bounds my_definition.insertion_point = Geom::Point3d.new bb.corner(0)[0],bb.corner(0)[1],bb.corner(0)[2]
-
Isn't his enough:
bb=my_instance.bounds my_definition.insertion_point = bb.corner(0)
-
It is...Thanks. Guess it always worth a second look after I make something work the first time. I'll bet my code could shed 25% of its weight if I knew what I was doing
Advertisement