Import NurbsCurve.ByControlPoints from Dynamo to Revit

How to Import NurbsCurve.ByControlPoints from Dynamo to Revit, and then control in Revit?

Can you give a little more background on what you’re looking for? You can create a modelline in Revit from a dynamo curve by using the ModelCurve.ByCurve node. The results of which are editable as standard Revit Geometry if you close the dynamo graph.

Yes, I can do that with ModelCurve node, but not with NurbsCurve, that is my problem.

that is what I have, But I want to Impot the NurbsCurve In Revit And then control it in Revit. In The same way that I can do with ModelCurve.ByCurve.

Are you looking to import the curves or the surface into Revit?

If you want to be able to manipulate the surface than you’ll need to build your workflow around creating elements in Revit which Revit can manipulate. What I mean by that is instead of creating the loft in Dynamo and creating a Revit form element (not editable), create the nurbs curves and use them to create the loft.

What interests me is the curves (NurbsCurve.ByControl Points). Everything started by importing data from Excel to Dynamo and then creating curves in coordinates (X, Y, Z). I could create arcs that are easy to import into Revit with the ModelCurve.ByCurve and manipulate it in Revit, but that’s not what I’m looking for. I want to import the Nurbs and be able to manipulate it in Revit.

That is the definition.

Can you upload the CSV for me?

Also are you in the massing environment? Looked like it form the previous post but I wanted to be sure.

yes, is it in the massing environment.

Try this:

I simplified the list management some as I don’t really like roller coasters.

Considered doing an AU class on the value of Adaptive Points and Dynamo, but no time this year. Depending on the type of Nurbs curve, and if you don’t mind having Dynamo open during the process, my favorite option is this:

  1. Create an Adaptive family
    a. Create a point at the family origin and make it an Adaptive point. Change the point’s orientation parameter to whatever you like-- let’s say “by instance”.
    b. Set the active workplane to the adaptive point XY workplane.
    c. Place a point (by workplane) on this plane, and set it’s offset to, say, 5 ft. You can even tie this offset value to an instance or type parameter in the family.
    d. Save this family (00 01PT_Adaptive_Line.rfa)
  2. Load this family into your project or Mass.
  3. You can either place this family at the desired points from Dynamo (AdaptiveFamilyByPoints) or place them manually and then reference them by selection from Dynamo. Either way, you can get the point location in Dynamo afterward either by getting element geometry and choosing the start point of the line, OR, because the Adaptive Point is at its family origin, getting (I think-- not at puter) element location.
  4. Make sure Revit preview is turned on in Dynamo, and then use NurbsCurveByPoints in Dynamo. Now you can see, live and in project environment, your Nurbs curve(s), and are free to move your points around freely.

You would probably need to save Dynamo files for working groups of Nurbs curves, especially if your process requires you to send model lines to the project. Be sure to save your Dynamo file when done-- That way the model curve element IDs are saved into the .dyn file, and if you wanted to edit model curves down the pipe, they would be overwritten when the script is run again (not require deletion).

One trick here is if you need to insert control points, but they do not occur at the end of your curve. I believe when selecting multiple elements from Dynamo, the list order is by element ID, and hence order of creation (I still don’t know of a multi-element selection by pick order in Dynamo that retains its selection after save/close/reopen. I believe Springs Package has a pick multiple by pick order, but it loses reference after closing). Your points will be out of order and not produce desired result. A workaround is to draw a model line or chain of model lines in Revit that approximate(s) the path of your spline. You can then reference this curve(s) in Dynamo and sort the points using the guide curve to get them in the proper order. Yet another workaround here is to assign numeric values to the Mark parameter (or a parameter you create) of each point instance, and sort this way.

Would love to know if others out there have a better way, and would definitely love to know of a selection by pick order with persistence.


Hi @davidaweil79 ,
wouldn’t ModelCurve.ByCurve do the job ?

@Mostafa_El_Ayoubi Your suggestion works if your Nurbs curves are PLANAR. Also, Revit’s Nurbs curves, when dragging start or end points, scales the entire curve (as shown in your GIF), including the internal points (non-end points). The method I described above allows points to 1. Be out of plane (and independent of a work plane all together) and 2. Edit control points without disturbing other control points.

@davidaweil79 @jacob.small @Mostafa_El_Ayoubi. Also, with the method I described you will have more freedom with closed curve paths, even though you would need to split the curve in 2 if importing as nurbs. Additionally you will have the freedom to specify Nurbs curve DEGREE in Dynamo, though I can’t offhand recall the Fidelity between Dyno Nurbs curves and Revit native Nurbs.

with the definition, I can put the Curve in Revit, but I cannot control it.

You got it! Just need to turn off Dynamo’s autorun (or close dynamo) and they will maintain edits shape until you rerun the script (kinda like a super fast undo all edits).

I think rerunning after closing it should generate new curves but I can’t confirm at the moment.

You could also make a new script to write the points back to your CSV file (or a new one) incase you have to rebuild this again later.

What did you use to make the animation because I may want to do something with that soonish.

Nick _ the thing is how it all started, with an external Excel file, and then insert a NubsCurve.ByControlPoints into Revit, and control it in Revit.

Excellent Bro

Glad to be a help.

I’m off to go make gif’s of me watching cat videos now.


@davidaweil79 @jacob.small @Mostafa_El_Ayoubi

Book1.xlsx (8.2 KB)
NURBS_REVIT.dyn (39.2 KB)
MASS.rfa (492 KB)

Jacob, sorry I see now that your solution does work very well. Additionally, the solution I was describing (attached) allows you to edit the curves in the PROJECT environment (in the context of the model) as opposed to just the Mass environment. I find this to be very helpful when developing contextual design. The attached solution also opts to control the nurbs curve(s) using the original point structure --ie. by control points, not necessarily a curve THRU points (what native Revit restricts you to when working in non-planar curves). Regarding regenerating the curve using DivideCurve: Sometimes adding more points can actually make a curve MORE difficult to control than if it uses the minimum number of points needed. If recreating a curve that was originally a Nurbs Curve by Control Points (not a curve THRU points), the most effective way to edit it may be by using the original control points native to its construction method.