Re-order a list of exploded surfaces

Hello,

Here is my problem. I have 4 solids (That are beams). I exploded them with the outcome to choose only the surfaces marked in image 1. After exploding them dynamo create 4 lists with the surfaces. The problem is that dynamo put the surfaces of each list in in different order. For example in the beam showed in Imagine 2 the indexes of the surfaces that I need are 0 and 5 but in beam showed in Image 3 the indexes of the surfaces that I need are 2 and 3. Is there any way to re-order the sub-list so the surfaces in all the list follow the same index order?

You could filter them based on their geometry, eg if the normal to said surface is parallel to the beam itself.

I think it’s reasonable to assume that those surfaces are those with the smallet area in the sets :

2 Likes

Or you could do it like this (more robust), using the direction of the location curve and the surface normals :

1 Like

I like your first solution better - and I think it’s more robust, too. Your second solution assumes that the location curve is always a straight line which may not necessarily be the case.

1 Like

@Mostafa_El_Ayoubi, Thank you very much for the answer. Both solutions worked perfect.