Element.GetHostedElements collecting unhosted elements

I am working on a routine to simplify adding elements to design options, specifically looking to collect elements hosted by other elements (doors and windows in walls, for example).

I am using the Element.GetHostedElements node to select walls, but the node is collecting elements that are not hosted by the wall. It is collecting nearby elements with the hosted elements.

See below for the routine. I can only upload one item in my posts, or I would show the result. Any ideas how I can prevent the extra selections? Thanks.

Result of the routine is here. You can see the extra windows between the two selected walls, as well as the windows that wrap the corner

Have you found out how to overcome this problem?

I have similar problem, the Element.GetHostedElements node is showing me the same doors two times, meaning that one doors are hosted in two walls at the same time.
When I use FamilyInstance.GetHost, one those doors, this node gives me one, correct wall.

I want to go from a wall to door not the other way around.
This GetHostedElements node is corrupted. In Revit lookup those doors have one host.

@marcin.szulc , @chughes

whats exactly the issue … hosted elements can`t exist out of the host

i tested with doors and facadepanels

grafik

KR

Andreas

it is possible to have two hosts if you have a wall that overlapps the other it gets saved somewhere in the background as an secondary host (can hapen if you demolish and build in the same phase and the door for instance is hosted in an infill wall (temporary ghost wall revit creates when you demolish door or window and then create new in the same phase. you can chose wich is the main host but so far as i know you cant do anything with the information about the second host my suggestion is you make sure you dont have any overlapping walls as and dubbel check which wall the hosted element is sitting the infill or the

1 Like

Yes you are right, sometimes it makes sense. However, in my case the other wall just touches the opening (doors):


I’m collecting total area of openings for each wall and in this case I had the openings area assigned to both walls (big problem). Can`t remodel it, it needs to be as it is.

Quick solution I made is to make a python node using this code snippet: Get hosted elements Ids · GitHub
Works

hmm i persuming you work with construction here and have a lot of openings everywhere.

you might be able to cheat the program and use an door object as an wall opening that way you can collect all objects of that type and get the parameter for width and height and you get the areas of all opening.

but it might interfer with how you useally work or give you problems with the calculation side. i am not familiar with how Revit calculates structual loads.
(i work with arichtects we use it this way but we are also not really responisble for openings other then showing where they are needed.)

This opening is a door family already and it has an area parameter which I use, so this is ok.

Still, the node Element.GetHostedElements is not working properly in my opinion. It gives me the opening showed on a screenshot as hosted in the selected (blue) wall and the proper one also. Maybe someone will repair it in the next version of dynamo?