Assuming you have selected the existing curves as pairs:
-
Curve.PointAtParameter with parameters 0 and 1 using correct lacing and list levels to get both the start and end point of each curve.
-
Flatten the list or otherwise restructure it so the points are sets of four points in a sublist for each pair of lines
-
Line.ByBestFitThroughPoints node to draw the line you are after.
Before this point you need to group your lines in pairs. The list should look like this:
[[crv1,crv2],[crv3,crv4],[crv5,crv6]]
Right now it looks like this: [crv1,crv2,crv3,crv4,crv5,crv6]
For the point at parameter, use a list of 0 and 1 with lacing set to cross product. This will put the points into one sublist of four points for each pair of curves.
Line.ByBestFitThroughPoints will be straight forward.
Dear Zaghloul;
I really need to write a script that can create mid line between two lines of AutoCAD link in Revit.
As I can see you have used some custom nodes and packages that I can’t find them. Could you please send this Dynamo script that it’s picture shown here? or any help that I can create this script?
Thanks in advance.
This method needs to be improved when parallel lines are different lenghts . Drawing midline according to longer line and intersecting to other midlines is another thing.
end poind of midline = end point of long line - (lenght between parallel lines)/2
start poind of midline = start point of long line + (lenght between parallel lines)/2