Using model.place_component my_definition
-
When I use the following to place an instance,
repeat = false model.place_component my_definition, repeatthe 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! tbut that doesn't solve my problem since
model.place_component my_definitionuses 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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement