# X, Y, Z coordinates of StartPoint and EndPoint for flexible ducts

Hello,

I’ve recently written a script in Dynamo that successfully retrieves the X, Y, Z coordinates of StartPoint and EndPoint for rectangular ducts using the base point and topographic point. However, I’m encountering difficulties in adapting this script to also work with flexible ducts.

Does anyone have any advice on how to adapt my script so that it can support flexible ducts ?
Exportation X Y Z Coordinates (Base Point Topographic Point Project).dyn (69.2 KB)

Please share a screenshot of your current graph in action and an example of what you’d want from flex duct. What have you tried so far and where are you specifically having issues with flex duct?

You can look at the FlexDuct Points, StartTangent and EndTangent properties to find the MEP curve definition

2 Likes

I am unsure which Dynamo package to use to access the StartTangent and EndTangent properties, and I am also uncertain how to properly integrate these properties into my existing Dynamo script.

I understand that it is possible to use a Python script for this. I have tried using the following Python script to extract the tangents, but I am unsure how to properly integrate it into my Dynamo workflow.

Python Script:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

flexibleDucts = UnwrapElement(IN[0])
startTangents =
endTangents =

for duct in flexibleDucts:
flexDuct = duct as FlexDuct
if flexDuct is not None:
startTangents.append(flexDuct.StartTangent)
endTangents.append(flexDuct.EndTangent)

OUT = (startTangents, endTangents)

Specific Questions:

1. Where and how should I connect the inputs and the output for the Python script node?
2. How do I apply transformations based on the base point and the topographic point to the points extracted from the flexible ducts?

I have attached my current Dynamo script to this post.

Thank you in advance !

Exportation X Y Z Coordinates (Base Point Topographic Point Project).dyn (75.5 KB)

The nodes would be Curve.TangentAtParameter, with parameter values of 0 and 1. This does require you quarry the curve of the duct first.