Joining lines and arcs to polycurve

Hi all,

I have a question: How can I join line and arcs to a polycurve?

I’m trying to create rebar by calculating the start and endpoint of the lines.
The lines are connected via an arc and then joined as a polycurve.
So far I can only join 2 lines and a curve to a polycurve (see line lightup blue in picture). when I want to add the next arc and line it gives me an error.
In an other post I found out it has something to do with the fact that the startpoint of the arc does not match the endpoint of the polyline. Is that correct? (The error is telling me that it is producing more then one wire)
And how can I check that and how can I correct it?

With kind regards,
Mike

Even if the start and end points of the curves and arcs are sequential, the node is still only expecting a single curve as the first input.

With some list management this should be an easy fix.

You can the Polycurve.ByJoinedCurves node instead if all the curves do join, as this ignores ‘start / end’ point inconsistencies. :grinning:

2 Likes

Thanks for your replay Ewan!

I was just looking through older dynamo files of mine and found out I already made this work.
So I copyed what I did before… but it didn’t work! Sadly.
So I tweak it here and there and got rid of the error but stil got 10 polylines instead of 2 polylines that are made up of 5 lines each.


But let me try your deconstruct aproche. I’ll post the result hopefully soon!

If possible, upload your script and I can take a look.

Just looked at a design script alternative (DS +1 :+1:), based on what i can see of your script / background.
This may help… but if not, should be a good reference for others.

//design script only :slight_smile:

//control points
a=Autodesk.Point.ByCoordinates(0,0);
b=Autodesk.Point.ByCoordinates(0,0,1000);
c=Autodesk.Point.ByCoordinates(0,100);
d=Autodesk.Point.ByCoordinates(0,100,1000);
e=Line.PointAtParameter(a1,1);
f=Line.PointAtParameter(a2,0);

//lines and arcs
l1=Line.ByStartPointEndPoint(a,b);
a1=Arc.ByCenterPointRadiusAngle(c,100,270,0,Vector.XAxis());
a2=Arc.ByCenterPointRadiusAngle(d,100,180,270,Vector.XAxis());
l2=Line.ByStartPointDirectionLength(e,Vector.YAxis(),300);
l3=Line.ByStartPointDirectionLength(f,Vector.YAxis(),300);

//lists of lines and arcs
linelist={l1,a1,a2,l2,l3};
linelist2=DSCore.List.Flatten(linelist,10);

//joining lines and arcs for rotation
pc1=PolyCurve.ByJoinedCurves(linelist2);
cp=Autodesk.Point.ByCoordinates(0,10000,0);
v1=Vector.ZAxis();
ang1=0…360…2;
Geometry.Rotate(pc1,cp,v1,ang1);

//offseting item for secondary ring rotation
pc2=pc1.Translate(Vector.YAxis(),3000);
ang2=0…360…5;
Geometry.Rotate(pc2,cp,v1,ang2);

Archilab’s group curves node may be worth a look here…

The polycurve by joined curves node fails as soon as it finds a curve which doesn’t connect with another…

Or even design script grouping by @Vikram_Subbaiah

Grouping of Curves with Design Script

1 Like

FRIKKING H*L!!!
I found my problem! My approach was correct. It was the startingpoint of the top line that wasn’t the same as the endpoint of the arc. My calculation was off.
@Ewan_Opie: in your great example you make use of horizontal en vertical lines.
But in my case the top line is sloped and so I first must calculate the startpoint of the top line in oder to create the topline. then I can create the arc between the vertical and the topline.
And there was my problem.
For the vector of the topline I used the calculated slope (100,4 degrees between vertical and slope) but for the startingpoint of the topline I used a set value of 110 degrees (Angle between vertical and slope).
Now I used the calculated angle to for the startingpoint and it works like a charm!

But thanks for your input! Could come in handy for future problems!

With kind regards,
Mike Wellink

2 Likes

I have problem with joining curves also. I exploded 3 sweep elements and found their section profile which is generated by multiple lines. Now I want take all the lines and create 3 polylines to corespond with the shape. I used 2 nodes, one made by @Vikram_Subbaiah (GroupCurves) which generates 28 polycurves and I don t know why… and the other one Geometry.GroupByDistance which generates 3 nulls (Warning: PolyCurve.ByJoinedCurves operation failed.
Curve join produced more than one WIRE in PolyCurve). Why nulls ? can you help me to make it work ? any sweep profile I upload in revit must be generated in dynamo as individual polycurve.

Group curves works only if there aren’t any branching curves.
In other words - They might not be in the proper sequence, but there should be no ambiguity as to which curves form a closed loop.

While it might not always work, you could refer to code from here to group branching curves.

1 Like