Moving component axes
-
I'm sure this is a pretty common topic, but do you know if there is an easy way to set the component axes to the corner of a component if you push/pull one of the sides. I've tried using the bounding box, but that doesn't work if you have the component at an angle.
thanks,
Chris -
Try something like this...
Add a new Group to the Model
Add the Definition's Instance to that Group's Entities - at the Origin, without scaling or rotation.
Explode the Instance inside the Group.
Find that Group's bounds.
Move the Group so that its Bounds.min is now at the Origin.
[You can also rotate etc as desired]
Make variables copying the Definition's Name, Description, Behaviors [always_face_camera?, cuts_opening?, is2d?, no_scale_mask?, shadows_face_sun? and snapto]. You could also get the Definition's Attributes [and Observers ???] if you think they'll be any ?
Rename the Definition with a 'scrap' name.
Get the Definition's Name in case it incremented, because the scrap name was already used !
Make the Group into a Component.
Get the Definition of that Instance and give it the Name, Description and Behaviors etc of the original one.
Erase that Instance to tidy up.
Process the original Definition.instances in the Model,entities and inside any Definitions.entities and change them all to be this new Definition.
Now for all intents and purposes all of the Instances of the original Definition have moved Axes etc, but are otherwise unchanged.
To tidy up Erase all of the original Definition's Entities; as an empty definition is removed from the Definitions List and Compo-Browser IF the whole operation is kept inside a 'start/commit' pairing.A bit convoluted but it works...
-
Thanks for the suggestion. I was able to do almost the opposite of your suggestion, and put the components entities inside of a group, create a vector between the groups origin and the components, and transform the two so they match. Does anyone know of a simpler way to do this?
-
Not sure if this is what you want to do...
Select the component, context-click and [Save as], save it to a folder as a new component file.
Open the saved file, [select all] - [Cut] - [Paste]
Now your cursor is at the corner of the new volume, click at the origin point and paste it there. Save the file and close it.
Go back to the file you were previously working on, context-click the component and [Reload], select the saved component file and you're done. Everything your component had as its definitions should be inherited to the reloaded component.
Advertisement