In a new Revit file, I created 6 parts from 2 wall objects with nested parts on purpose to illustrate my question.
I can see 6 different parts in my view, that’s what I want.
What could be the best way to select only visible parts ?
Then, I’d like to find the orientation of my parts, by getting their parent’s base line (wall).
As long as there are multiple level of child parts, I need to build a recursive code to extract a list containing only wall objects.
Existing node on SteamNodes package will only give first parent, so I get a mix of Wall and Part objects as a result.
I tried to construct something as a workaround, but it’s not recursive, so result’s reliability depends on how deep the structure will be.
On second though this may not work because you can not figure out what wall belongs to what part. I might have time later but for now that is all the time I have.
I’m not currently at my office, so I can’t, but I think it’s pretty simple to reproduce, in 2 minutes max.
The thing will occur whatever wall type or wherever you choose to cut them. And you just need to divide part another time to get nested parts.
I chose to build a new file to be sure that it was not related to a bad construction or a bug in my real project.
In the real file, there are hundreds of parts, just for the first floor.
Hi Steven, thanks for this.
I like this approach, I will try it later. But then, I still need to find the original wall for each part, which is not that simple when you have more walls in the project.
Ok, I dug a little bit deeper on this, I figured out that parts could also be merged. And in that particular case, there would be several original walls for only one part of the project.
Ok, I like to solve my problems by myself, so here we are.
I made a python node to identify if a part’s parent is a part itself. Then I can compare my input list with the result to filter my parts and keep only the very last children.
I recursively search for the original object that the part comes from, in another python code. It includes cases where the part have been created by merging multiple parts.