How can I create an Autodesk.DB.References from XYZ or DesignScript Point


Im trying to get references for spot coordinates using a list of Revit.DB.XYZ points but the method :Autodesk.Revit.DB.Reference(elem) doesnt work since it expects Autodesk.DB.Element, how can I convert XYZ points to elements? I already tried using ToDsType(False) but XYZ´s dont have that associated method.

You cant. The only way to get a reference point is from an element in your model with solid geometry as this has Faces > Edges > Points and thats where you can obtain point references from. Essentially anything ‘reference’ based will always has to derive from an Element in your document: ReferencePoint (point from an Elements GeometryObject), ReferencePlane (sketch plane) or a Geometry Reference such as a Face.


Thanks for your reply, but you still can get references from Lines not only from solids.

Yes, but lines are elements. You have a Dynamo geometry or a Revit API geometry, not a Revit element, and as such you will need to make a Revit element of some sort to get a reference.

How would you make this thing in the UI if you didn’t have Dynamo?

Posting some code and a sample data set will help others to assist you in your end goal.

1 Like