Hi,
I'm currently using the "Make components" feature to convert solid bodies into parts. This works great, but we use this method to construct angular roof structures, and after the parts have been made the parts have angular relationships to the .ipt files UCS co-ordinates. It would be very useful if I could align the longest edge of the part (Which is a timber truss) with the x axis in the model space and "lay" the plank flat on the X-Y plane.
Is this possible?
Thanks
GavoGarmo
Solved! Go to Solution.
Solved by philippe.leefsma. Go to Solution.
Hi
There are several ways you could achieve that, depending on what you are looking for exactly.
One approach is to apply a MoveFeature to the solid body in order to transform it. You will have to create the correct transformation matrix. In that scenario "Matrix.SetToAlignCoordinateSystems" is probably the easiest way to go.
You can also derive parts using a "DerivedPartComponents.CreateTransformDef" to create a transformed derived part and use the same matrix method.
Or you can copy and transform an existing body using "TransientBRep.Copy" and "TransientBRep.Transform" and create a "NonParametricBaseFeature".
I hope it helps.
Regards,
Philippe.
Thank you very much for the reply.
The API side of things is still a little outside of my skill set, but I'm endevouring to learn.
For this system to work would I have to know the angles involved our would it be possible to write an all purpose code that would align any part regardless of it's starting orientation?
Thanks again
GavoGarmo
You could write an all purpose code. Take a look at "Matrix.SetToAlignCoordinateSystems" method in the help files, it takes as input 3 "From" vectors and 3 "To" vectors. Your code will have to specify which vectors you want to align with the other and the method will produce the corresponding transformation matrix you need to apply to the body.
Regards,
Philippe.
That's fantastic. Thank you very much for your help. I'll investigate the help files now.
GavoGarmo