Changing pipe direction

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to place a pipe precisely between two points: intersectionPoint and intersectionPoint + perpendicularDirection. I am using the following statement to move the pipe:
Pipe dummyPipe = doc.GetElement(ElementTransformUtils.CopyElement(doc, branchPipe.Id, XYZ.Zero).First()) as Pipe; (dummyPipe.Location as LocationCurve).Curve = Line.CreateBound(intersectionPoint, intersectionPoint + 1.0 * perpendicularDirection);
With the above placement, I would expect the pipe's curve's direction to be exactly equal to perpendicularDirection. But that's not the case. As an example, if perpendicularDirection is set to {(-0.016831296, 0.968685013, -0.052781984)}, the direction of the pipe comes out to be {(-0.017347059, 0.998368562, -0.054399389)}. Note that there is a slight difference in the direction and as a result, I am not able to connect this pipe to a Tee fitting as per Insert T-connection.
BTW the same issue happens even if I create a new pipe between two points.
Any idea how to fix this issue?