Message 1 of 3
Revit 2026 API - document.Create.NewDetailCurve(view, spline) return null while Element is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I've been using the Revit 2026 API ( and .NET ) to make QoL stuff in an addIn.
I wanted to create some Bezier Curves (HermitSplines) and store the newly created element for later use.
Here is the function I use :
public DetailCurve CreateBezierCurve(Document document, List<XYZ> points, XYZ tangent0, XYZ tangent3) { DetailCurve result; var view = document.ActiveView; HermiteSpline spline = HermiteSpline.Create( points, false, new HermiteSplineTangents() { StartTangent = tangent0, EndTangent = tangent3 } ); using (Transaction tx = new Transaction(document, "Create Bezier Curve")) { tx.Start(); result = document.Create.NewDetailCurve(view, spline); tx.Commit(); } return result; }
The official api info and the IDE helper tab state that the output is indeed a DetailCurve.
It also state that it can return null if a crash appears internally. however I do get the curve created in my file and no sign of any error.
I wonder if this is some bug in the API, or a mistake in the documentation. I could not find anything on that subject.
Any help or info is welcome. Thanks
PS: I know I could find that newly created curve in other ways but it is definitly not as clean as the intended way.
For instance the said curve after creation :