Transform a polyline

Transform a polyline

george1985
Collaborator Collaborator
354 Views
2 Replies
Message 1 of 3

Transform a polyline

george1985
Collaborator
Collaborator

Hello,
I would like to move/rotate a polyline object.
Through googling, I found out that ElementTransformUtils class contains the functionality to achieve this, but only for the elements which have already been added to the Revit document (like ModelCurve for example).
My polyline exists only in memory. Is there a method which would move/rotate it?
I see there is a GetTransformed method, but I am not sure how to use it.

Any help is welcomed.

0 Likes
Accepted solutions (1)
355 Views
2 Replies
Replies (2)
Message 2 of 3

george1985
Collaborator
Collaborator
Accepted solution

Okay, I think I got it:

 

moveVec = XYZ(10,0,0)
transform = Transform.CreateTranslation(moveVec)
polyline2 = polyline.GetTransformed(transform)

The same for rotation, just Transform.CreateRotationAtPoint method instead.

0 Likes
Message 3 of 3

george1985
Collaborator
Collaborator

But what if I want to rotate a point (XYZ) around another point?

XYZ does not have a GetTransformed or any other '...Transform' method.

0 Likes