Remove duplicate conduits

Hi, i’m trying to make a script to remove duplicate conduits.
It’s easy to filter the duplicate curves, but how can I generate a list of these Elements to delete?

Thanks!

Hello @Arjan.Wanders here are a few way…you will probably have it as a warning (duplicate elements) from there you can clean it lot of nodes for that…another way is some prune duplicates or archilabs node think he call duplicated elemnets or so,

Hi @sovitek, thanks for your suggestions.
Unfortunately, duplicated conduits give no warnings.
The Archilabs node I tried is called Lists.DuplicateItemIndicies, it results in an empty list.
Prune duplicates work with points, I’ve tried something with the Clockwork Location+ node. It doesn’t give the right output I think.

1 Like

perhaps this works?

Hi,

Try with the Geometry.PruneDuplicates node of the Data-Shapes package.
The Geometry input will be the line location of the conduits.
It is the easier method.

1 Like

Hi @Alban_de_Chasteigner,
This node works fine, it shows the unique items in the model. The next step is to filter the elements list, based on this list. I’m still a bit new to Dynamo, so maybe someone can help me to get this working :sweat_smile:

3 Likes

This seems to be what I was looking for. From which package is the “Element LocationCurve” node?
I’l tried to use the Element.GetLocation node (gives the same output I think), but the final result is not what I expected.
RemoveDuplicateConduits_4

Hello…yeps seems like it dont match the right way…think its probably a round math thing, try to measure you curves and try to round them for match…If you want you could upload your file and i will take a closer look…PS element location curve is from Genius Loci, but in that case here it should give the same result as the ootb node

Might be easier to get the start point, mid point, and end point of each curve as a sublist (set the curve input to @L1<1>, pull the XYZ of each point in the sublist and con join into one string (so you get startX, startY, startZ, midX, midY, midZ, endX, endY, endZ as a string for each curve), then use a List.GroupByKey node to group the elements by the strings. Use a List.Deconstruct to pull the first item out of each group as those are the ‘keepers’ use a List.Flatten on the rest output, leading into a Element.Delete node to remove them from the model.

1 Like