Element Parts Geometry // Part Ordering

We have a script where we select specific parts from within a wall. The issue is the ‘Element Parts Geometry’ does not order the Breps (wall layers in this case) using any discernible pattern and cannot figure out how to get the lists to match up. Has anyone seen this issue / solved it yet?

I also attempted to try and build a RIR GHPython script but generating the parts without creating them in Revit is not within my wheelhouse as of yet.

@eirannejad any insight on this? We are hoping to be able to find a way to sort Element Parts Geometry to align with the Compoundstructure.Getlayers.

@eirannejad my hypothesis is that the issue has to do with this note in the Revit API: ‘The id of the layer - note that this may be different from the index in the array of layers in a CompoundStructure.

Here is a debug files I made to highlight the issue.

Unfortunately you can not relay on the order.

Look at this example.

There is no one to one relationship between layers and resulting parts.
The selected part is from the same layer as the grey face above it.
At the right of the door there are two more grey parts that come from the same layer.

And even more, the user can Divide Parts into more parts.

Maybe there is some API to know witch layer each part comes from, but I didn’t found it.

@kike much appreciate the response here, yes this is exactly the same issue I am having. Looking at the API I had thought that there might be a difference between the Layer ID and the Index Value of the layer within the array of layers that is outputted from the CompoundStructureLayer class.

I need to dig into this further but that is my current hypothesis.

In the previous iteration of this component, we had ordered the layers based on their geometric distance from a corner of the parent wall. Same method could still be applied and modified to return a branch of geometries (stack of wall parts) for each layer. The current component has been reworked to grab the parts, but you can implement the same logic in your GH definition

@eirannejad Appreciate the response! I was thinking of that method but was not sure if I could determine which side of the parent wall is the interior vs. exterior of the wall. This get’s tricky when you are trying to isolate wall-core layers using the wall core index and there is asymmetrical amounts of layers on the exterior vs. interior.

Anyways. I will play around with this a little more and appreciate the insight.

1 Like

We did some changes to the Element Parts Geometry that are on the Daily Builds channel.

Now it should output the geometry branched by layer index, this way you can combine that geometry later with layer function or layer material.

ElementPartsGeometry
Element Parts Geometry.gh (26.0 KB)

@kike alas! Thank you, will have to try this out!

Hello, when I use the elements parts Geometry there are some circumstances when I get thrown an exception- Cant make parts out of these elements- I beleive its some kind of geometry issue.

Is it possible for the script to just pass over these ones rather than throwing an exception?

Hi Ssw, Can you post a small example? Thanks

not quite part ordering per se, But im having an issue whereby the element parts geoemtry does seem to work for floor and roof that have anything complex? Roofs seem to only work if there is only 1 pitch edge included, and floors with any sub points also dont work?