Curve to prototype_Learn Dynamo

Hi, please help me with an script from Learn Dynamo wich includes Curve to prototype.

I had already removed each variable to the OUT to make tests .

The script collects the enclosures well , and perfectly obtains its segments from each room, that is, it works fine until the list of rooms (room.append (i)) and (arr.append (room .GetBoundarySegments (opt)), up there ok.

But the problem starts to happen when you have to convert those segments into curves, even at a certain point it says that segments do not have attributes of curve.toprototype. This happens when trying

wallCurves.append (segment.Curve.ToProtoType ())
wallElements.append (doc.GetElement (segment.Element.Id))

that is, when trying to convert the boundaries to Dyanmo curves, I get an empty list.

I have searched in Revit api docs and in forums the Curve.toProtoType method and I have not found it to understand what input it needs, it is clearly not among the things that we saw, so I took the time to write an email asking you for help because maybe You have occupied it and you know what it is about.

I’ve even written to Jeremy that he did the script, but the email that appears on his page bounces.

I attached other images so you can better visualize my problem and can give me help or a guide where I can find that information in the latter case.

A greeting.



LearnDynamo_Module_4.dyn (65.1 KB)


Apologies, I’m away from a PC… I had a look at your code and I can’t see anything wrong or anything different to the code in the page.

I saw that you posted a comment, I think he’s on Twitter, perhaps tweet him?

I presume you downloaded the dyn? And it didn’t work?

The prototype method is not a Revit method, it is a Dynamo method for converting to Revit… but I don’t know enough about it to see why it failed :frowning:

Hope that’s of interest,


Tkanks! yes, i copied the code exactly like the page.
May be it´s something wrong with my model.
I keep on trying

Good idea, use a basic test rvt to start :slight_smile:


So I had a look at it and I think that the API has changed since the Python was written…

There doesn’t appear to be a Curve property any more, so I presume that we now need the GetCurve method, and because it’s a method, rather than a property, it needs to be GetCurve()

The downside to using Python rather than nodes :slight_smile: (that someone else will keep updated)

Hope that helps,



Thanks, that was the solution

1 Like