Duct by Line

Hi everyone,

I hope you’re all doing well.

I’m encountering an issue while trying to convert a line into a duct using Dynamo and Python. Whenever I run my script, Dynamo becomes unresponsive, and Revit eventually stops working. I have to close Revit using the Task Manager each time this happens.

I’ve tried using both packages and Python scripts, but the issue persists. This problem has been occurring from Revit 2022 to 2025.
Same thing happening for conduit and pipes

Can anyone explain why this might be happening and suggest a solution?

Thank you in advance for your help!

sysType = (UnwrapElement(IN[0]))
dtType = (UnwrapElement(IN[1]))
lvl = (UnwrapElement(IN[2]))
stPt = (UnwrapElement(IN[3]))
enPt = (UnwrapElement(IN[4]))

tempList =

#Here we starting the Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

#Here we need to Do all Revit API Operations

dt = Duct.Create(doc,sysType.Id,dtType.Id,lvl.Id,stPt.ToXyz(),enPt.ToXyz())

It sounds like you either have a command active in Revit (if you have any manual interaction there) or you have an infinite loop somewhere in your graph. If you’re pulling any information that would be created with the new duct then you’d end up with an infinite loop. Either way, we’d have to see your full graph and the full python code to know if that’s the case.

2025 test.dyn (28.2 KB)

Thank you for the response, I attached my script here

It’s always more helpful to post screenshots and code samples. More people are likely to look at the information you’ve provided in context (you also need to include any relevant context) than they are to download your file and run it without knowing what it does. Your dyn also won’t likely behave exactly the same without the same file you’re testing with. Any number of things could be different between your file and someone else’s.