Assembly Transformation

scottbaldy
Enthusiast
Enthusiast

Assembly Transformation

scottbaldy
Enthusiast
Enthusiast

I would like to orient an assembly to the “main” member in the assembly.  I am able to get the basis and origin of the “main” member in the assembly and also the assembly itself.  I have not been able to identify the most efficient method to achieve this re-orientation. 

 

ElementTransformUtils.RotateElement(document, element.Id, axis, rotation)

RotateElement method appears to be one approach, but seems to be a bit tedious with determining each axis and then rotating about each axis.

 

Since I have the basis that the assembly needs to be transformed to, is there an easy way to simply set the assembly basis to the new basis?

0 Likes
Reply
Accepted solutions (1)
636 Views
1 Reply
Reply (1)

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Scott,

 

Thank you for your query.

 

RotateElement is the generic way to reorient elements in Revit.

 

I think you can also achieve the same result, possibly with more freedom of choice and orientation, by setting the Element.Location property.

 

That might avoid some of the multiple rotations and translations otherwise required.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes