You’re calling the wrong method. The method you’re using should be used in Family documents where Revit reference points have been used to construct a curve. Since you are converting a Dynamo curve, the result is a curve defined by XYZs… so try GetEndPoint()
public Dimension NewDimension(
View view,
Line line,
ReferenceArray references
)
Dimension CreateNewDimensionAlongLine(Autodesk.Revit.DB.Document document, Line line)
{
// Use the Start and End points of our line as the references
// Line must come from something in Revit, such as a beam
ReferenceArray references = new ReferenceArray();
references.Append(line.GetEndPointReference(0));
references.Append(line.GetEndPointReference(1));
// create the new dimension
Dimension dimension = document.Create.NewDimension(document.ActiveView,
line, references);
return dimension;
}
The Revit API comments regarding the References input:
references: An array of geometric references to which the dimension is to be bound. You must supply at least two references, and all references supplied must be parallel to each other and perpendicular to the extension line.
When one dimensions in Revit they pick edges, so that gives a good indication of what geometric references the API is referring to. A good strategy is to test what you intend to do manually first, then find a way of emulating this procedure via the API. Using Revit Lookup is also invaluable and gives the developer lots of clues. Alternatively, you could use the dimension nodes widely available in packages and save yourself the effort!
You cant as that method us used for obtaining references to Point class objects which can only be created in Family documents. Plus your curve starts its life as a Dynamo curve which is converted to a Revit API Curve, so even if you’re in a Family document, this method still wont work, as the line has no Point references.