Join (poly)curves of sublists with matching points

Hello everybody,

I’m new in the world of Dynamo, but I’ve learned some already by reading the topics here at the forum. So thx for sharing your problems and solutions. For the problem of this topic, I’ve couldn’t find a solution, so therefor I would like to ask for your help.

My goals with Dynamo at this stage are getting (Q)GIS information into Revit. The input files are shape files, but often not so clean for direct use in Revit, So I’m trying to use Dynamo to optimize the data.

For this situation I have a shapefile with open polycurves, e.g. roads, rivers etc. This example files comes with 18 sublists/polycurves containing in total 598 points. I’m trying to find a way to optimize the list by joining the polycurves/sublists in bigger polycurves (less lists). Is there a simple solution for?

I’ve already tried ‘Group Curves node’ from Archi-lab, but the shape file (could) also contain multiple branches, a T-junction for example, and these also get grouped in a sublist. And my goal is to sweep a profile along the polycurve, so I think it should be clear that the sublist should contain a (poly)line/curve with only 2 ends.

I know that polycurves, that are ‘connected’ to other polycurves, share the same points. So I’ve already found these points with ‘list.countoccurences’: 16 duplicates in total: 12 double points and 4 triple points, makes it in total (12x2 + 4x3) 36 indices.
With ‘Duplicate item indices’ I can find the indices in a flattened list. I can prune them, but from there I’m stuck.

I thought maybe there is a way to find and group sublists by corresponding points, but If a point occurs more than 2 times, only 2 sublists should be merged into 1 list. (Otherwise I’ve got the same problem as with the "group curves node’)

I’ll try to explain this in logics:

sublist 1: P,A,A,A,A,A,A,B
sublist 2: B,C,C,C,C,D
sublist 3: H,I,I,I,I,I,I,J
sublist 4: D,E,E,E,F,
sublist 5: D,K,K,K,K,H,

So point D simulates the T-junction. Sublist 1, 2, 4 share the same double points and sublist 3 and 5 share the same double points, so these should be merged in 2 new sublists. Sublist 2, 3 and 5 also share the same triple point, so 1 of the these sublists should be excluded.

Next step would be sweeping a Revit profile along the curves. For this I know I have to translate the coördinate system of the profile to the curve.planesatparameter of the polycurves, only I don’t know how.

Hoping for your help.

Kind regards,
MD

I think I understand, although your post contains a number of questions.
It might be better to ask a single, specific question.

Incidentally, the ELK package (for importing OpenStreetMap data into Dynamo) is similar to what you are trying to achieve and might provide some clues.

For transfer of data from QGIS- I tend to use a QGIS–>DXF–>Revit workflow, and let this deal with projection/coordnate systems
From there, you can use the brilliant Bimorph package to convert CAD curves to Dynamo curves

Andrew

Hi Andrew,

Thanks for your fast reply. I have the ELK package installed, but that is based on osm data and is, just like the GIS package, focused on importing data. What I want, is manipulate data using Dynamo.

So the main question would be: how do I merge sublists based on matching points?

That’s why I posted this topic under the category “List logics”. Your solution would be a workaround. I’m happy you replied my question, but I’d prefer to find a solution for the list logics so I can learn from that. I experienced that understanding list logics is very useful when you want to work with Dynamo.

regards,
MD