Line from Curve

How to get Line definition of a list of sublists of Curves? (without crash/errors translation)

2 Likes

computer dies with thousands of curves

Hi Ruben…dont know if it better then Deniz solution

2 Likes

based in your answer if I got a list of polycurves, I would have to explode them 2 times to get a Line.
I was trying a python script to do that killer task instead but I got some Nulls sometimes, also when I try to translate or move polycurves I get errors/warnings, then it does not look so simple when managing thousands of items and sublists

1 Like

Not sure what you mean…but you can get curves from polycurve this is ootb node and from curve to line just explode…but line to curve i use offset in this case…but you are right if you run on a big heavy model everything can go wrong :wink:

How about using Python to speed up the processing?

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

def CRV_to_LIN (crv):
	line = Line.ByStartPointEndPoint(crv.StartPoint, crv.EndPoint)
	return line 
	
Curves = IN[0]

OUT = [CRV_to_LIN(i) for i in Curves]

Hope this helps,
Jake

3 Likes

Hi @haganjake2 dont think it will work on curved curves

you can try to filter curves before to draw Lines

5 Likes

would make sense to transform first the curves to straight lines adapted approximately to the shape of arcs, splines, nurbs curves? This is the reason why the conversion does not work in some cases. The question is very simple but rarely works perfect in a project

it depends on your final goal, the python code only allows to filter the lines among a list of curves by calculating and compare the normal from several locations

1 Like