[clockwork] Element.inserts provides (way) to many openings

Hello community,

I have been using the element.insert node for some time and just now realised that it seems to have started giving me way to many openings for some walls.

this is my current workflow:

Here is a visualisation of the wall i was searching openings for and the openings i found:
red is the actual wall (the thin white wall)

This is not a one of thing.
Happens in multiple projects with different kind of walls.

This is the construction of one of the walls:
sorry it is in german


translated construction
1 not bearing layer thickness 0,0125 m
2 non bearing layer thickness 0,0125m
4 bearing Thickness 0,06 m

What is the reason behind that?
Do you know a workaround?

I often find openings with rooms, but with this script here i use element.inserts because rooms are not modeled yet when it is needed.

Thank You for Your time.

This is the python code from the clockwork note:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

items = UnwrapElement(IN[0])
incopenings = IN[1]
incshadows = IN[2]
incwalls = IN[3]
incshared = IN[4]

def GetInserts(item,incopenings,incshadows,incwalls,incshared):
	# Regular host objects
	if hasattr(item, "FindInserts"):
		return [item.Document.GetElement(x) for x in item.FindInserts(incopenings,incshadows,incwalls,incshared)]
	# Railings
	elif hasattr(item, "GetAssociatedRailings"):
		return [item.Document.GetElement(x) for x in item.GetAssociatedRailings()]
	else: return []

if isinstance(IN[0], list): OUT = [GetInserts(x,incopenings,incshadows,incwalls,incshared) for x in items]
else: OUT = GetInserts(items,incopenings,incshadows,incwalls,incshared)```

Element.Inserts will return the items which are hosted on the wall so stuff like doors, windows, outlets, etc., it will not return the structure which the wall is made up of. That is the is CompoundLayerStructure if I recall.

I am sorry if i was unclear.
I use Element.Inserts to find doors and windows connected to a wall. I just realised that sometimes i find more windows than actually are inside the specific wall. Illustrated in the second picture. Because this is not the case with all walls i have the thesis that it has something to do with the structure.

It might be finding sub-commonents and adding them to the list?

Perhaps adding in a filter of the elements out to check if subcomponent and if so, remove them from the list?

Do you mean like this? Then that in not the case.

i feel like i need to provide more context.

The target is to later add the opening area to the wall area. So the should be process is like this:

1 find opening of wall
2 get area of opening
3 add it to wall area

right now sometimes i would be adding way more area.

Since not all walls are the actual host of the window, but still have a hole i need to use shadows.

This function of the element.inserts note should in theorie allow me to find those. But right now with shadows enabled, it gives me a lot more windows/doors that arent even that close.

Here is what it finds: (highlighted in blue, look at the door at the right side)

what it should find:
image

Maybe one of you even has a better idea for this whole workflow.

Are you sure these aren’t on another phase, design option, group, masked by a profile edit, or just not seen in the view? We really need the model to track these down.

Hi,
this i the revit file:
Test_Openings_file_cleaned.rvt

i used it with this script:
Test Openings.dyn

Thank You for Your time.

The project does not use phases, design options or groups. It is seen in the view.

So what i found: inner wall element is connected to the brown wall. If one disconnects those walls via
image “lift geometry connection” then no opening at all will show up.

the bigger brown wall finds the same openings as the inner wall layer.

I might have misused the element.inserts note if this is wished behavior. Right now i dont see a way of getting the desired output:
inner wall with just this single window.
image

Joined elements inherit the inserts of the elements which they are joined to. Intended behavior from an API point of view as if you interact with wall A you want to get wall B and the content in it as well.

So what you want to do is run a filter on the inserted elements to remove anything which is ‘too far’ from the original wall. Items which cut the wall via the join should have a distance of 0. Also you likely want to remove the wall that’s joined to it.

1 Like

I imagine this can be done a lot more efficent, but hey if it works it works. Here is my quick solution with your guidence:

This needs to be refined, especially the cut off at 1.5 distance.

Thanks a lot