Finding the orientation of vertical elements (like ducts/pipes/cable tray)

Finding the orientation of vertical elements (like ducts/pipes/cable tray)

PerryLackowski
Advocate Advocate
389 Views
2 Replies
Message 1 of 3

Finding the orientation of vertical elements (like ducts/pipes/cable tray)

PerryLackowski
Advocate
Advocate

I have a duct element and I can get the two endpoints from the Location Curve, but I'm looking to find the unit vectors that represent up/down/left/right of the segment so I can perform offsets or generate parallel elements. Largely I think I can use the cross product of the vertical vector (0,0,1) paired with the direction vector (p2-p1) to get the left/right vectors. Then I can pair the left/right vectors with the direction vector to get the up/down vector. However, if the duct is vertical, the location curve doesn't give me any information about the rotation of the duct, so I can't determine which direction is appropriate for an 'Up' offset. Mathematically, this is because the first cross product is zero, so the second cross product can't be determined.

 

Is there a parameter I should be using that can give me more information about the rotation/orientation of the duct when it's vertical?

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

jeremy_tammik
Alumni
Alumni
Accepted solution

Yes. You can use the connector coordinate system at the connections at the endpoints:

  

  

The Z axis of the coordinate system is the normal to the plane of the connector.

  

Commonly, X is width and Y is height.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

PerryLackowski
Advocate
Advocate

Thanks @jeremy_tammik! That's much easier than trying to calculate them myself...

0 Likes