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