Turning Straight Polycurves into Lines

I have transformed a set of lines into polycurves and was able to split them up into separate curves. These are straight curves, though, so I was wondering if there was a way I could convert their parameter type to line to perform tasks with them?

@mexawesome123 ,

can you share some screenshots ? which lines ? detail or modellines ? or converting inbetween dynamo ?

@mexawesome123 have you tried PolyCurve.Curves or `Geometry.Explode :slight_smile: ?

you can redefine them as lines by getting the StartPoint and EndPoint and constructing new Lines from those objects.

i think i’ve had to do this when i expected the curves to be lines and wanted to get the Line.Direction property

2 Likes

Hi all,
Thanks for the responses. I tried PolyCurve.Curves and it didn’t work for me. But using Geometry.Explode worked fine, and I was able to successfully get lines. I will also note that I made them into Model Curves as part of a previous task, and had to use Element.Geometry to make them into polycurves first.

1 Like

@mexawesome123 you can also consider adding in some “guardrails” to your script like follows that will ensure only Lines make it passed your Explode node workflow:

Here I am using the List.RemoveIfNot node as a filter that takes in a Type which you can find from the Object.Type node. This basically says “If you are not a line, thou shalt not pass!”

Haha, that would be quite useful to keep in mind. In my case though, my system itself only consists of lines (technically), so it shouldn’t be an issue. This does bring another less related follow-up question for me, but that’s for another post.

1 Like