Identify and isolate identical elements in lists

Hi there,

I have a script to assign parameters from surrounding masses.

The “BoundingBox.GetElementsInside” nodes works well for 90% of the copy.

For the rest I want to use “BoundingBox.GetElementsIntersect” for the elements that cross multiple masses, in order to get and Concatenate multiple values.

How how can I Isolate them?

This example states 9 elements, 2 masses, where one elements crosses both masses.

I am looking for the element that appears in both lists.

Kind regards,

Willem

Flatten the lists. Get element Ids. Check count of unique elements.
That will tell you which elements have more than one instance. If you need to compare that back to the individual lists then you can compare the element Ids.

Hi Nick,

thank you for the feedback.

As the elements which occur multiple times stil occur on the unique list, I did not manage to isolate them.

I did find a Node List.CountOccurences though, wich seems to return exact what I am looking for.(Clockwork)

Then I need to split this list, based upon the numbers of Occurencies…

Hi @willem.creffierKCWFB ,

What exactly do you mean by the following:

Maybe List.Cycle or List.OfRepeatedItem does the trick, but I don’t know exactly what you’re after.

Hi @Daan

I want to delete all the elements from the list, which occur only once.
Because they are being processed earlier, by the command that aplies parameters based on the fact that they are within 1 mass, where they get their parameter from.

The elements I try to isolate intersect with two masses, and I try to set their parameter by concatenation of the values of the two masses they are intersecting with.
Assign paramters FSMM simultanious.dyn (221.2 KB)

Ah I see, List.FilterByBoolMask is a good way to filter:

Thank you @Daan,

the mask based on the amount does it.

However, in order to make it work I need to adjust the number of strings in the concatenate node in order to set the parameter.

More fundamentally, this is just the Summary of al the masses who do have a value for this parameter. I would have to filter the masses actually involved in the intersections of each element.

HI @willem.creffierKCWFB ,

I specifically used amount!-1 in combination with the “IN” output such that only elements which have actually 1 item are being sent through, in your setup a sublist with 3 also fullfils the if-statement.

Hi @Daan

to keep filter the unique ones makes more sense indeed. All elements are filtered at once, regardless of how many masses they intersect.

But if you have any thoughts on how to give the list with the values from the intersecting masses the same structure as the list of the elements, do not hesitate to share this.

Especially because the Boundingbox.Getelementsinside considers no masses, but the depending Bounding Boxes who do not have this parameter.