How to extract and transform a Curve from "ElementCurveReference" in a Linked File?

Hi everyone,

I am currently working on a Dynamo script for a Civil Engineering project where I need to extract specific edges from a Linked Revit File.

The Setup:

I am using the node “Select Reference on Element” to pick an edge of an element inside a Linked Instance.

This returns a Dynamo wrapper: Revit.GeometryReferences.ElementCurveReference.

I have already retrieved the RevitLinkInstance, the Link Document, and the TotalTransform of the link.

The Problem: I am struggling to convert this ElementCurveReference back into a tangible Autodesk.Revit.DB.Curve or Edge to using in host file. Since it is a Reference to a linked element, typical methods like .Curve or .GeometryCurve on the Dynamo object return empty or error out.

Any Python snippets or logic advice would be greatly appreciated!

Thanks in advance!

Hello @mr.engineer.aec is it something here you are after ?

Revit_q5PHS8kk82

2 Likes

Exactly, that’s exactly what I’m looking for! Please share the Python code if possible. Much appreciated

yeah sure, but will first be tomorrow, not at dyn today :wink:

1 Like

That’s awesome, thank you so much! I really appreciate your help with this.

1 Like

yeah try something here and here if you need transform from link as well…should work with cpython3 or pythonnet3, give it a try :wink: :wink:


forum edges.dyn (11.6 KB)

3 Likes

Thanks a lot for the help! The script works perfectly now. I really appreciate you sharing the logic for selecting edges in linked files!

1 Like