All, I am trying to find a way if possible to merge and split a long line and merge it into the smaller lines which overlap it. Basically need to split the long line at smaller lines points and merge at those locations. While also leaving the remaining lengths which do not overlap. I have another list with a value associated to the lines, so if i can get the lines to split and merge, i also want the other list to add together too. Can anyone point me in a direction or possible python thoughts which would do that?
cut for each start and endpoint ?
@Draxl_Andreas Yes, that is the direction i would like to go. Is there a solution which provides that? Thank you much!
Hello, here is a possibility
Here with python code (to improve, I’m still a novice)
we must be able to improve, very certainly but I admit that I have trouble with the use of function lambda)
import sys import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * #Inputs long_line=[IN] short_lines=IN #Find the points Pts= #Container Pts_sorted= Pts=[Curve.PointAtParameter(i,0) for i in short_lines] Pts.extend(Curve.PointAtParameter(i,1) for i in short_lines) Pts.extend(Curve.PointAtParameter(j,0) for j in long_line) Pts.extend(Curve.PointAtParameter(j,1) for j in long_line) #Pts_sorted=sorted(Pts,key=lambda x:x=Curve.ParameterAtPoint(long_line,x)) OUT = Pts
I found with lambda
import sys import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * #Inputs long_line=[IN] short_lines=IN def cond(lin,pts): return Curve.ParameterAtPoint(lin,pts) short_lines.extend(long_line) list_lines=short_lines #Find the points Pts=[Curve.PointAtParameter(i,j) for i in list_lines for j in [0,1]] #Sorted the points Pts_sorted=sorted(Pts,key=lambda x:cond(long_line,x)) #Polycurve Pol= PolyCurve.ByPoints(Pts_sorted,False) OUT = Pol