CutGeometry generates IfcOpeningElement in IfcExport how can i avoid that?

Hello,

i was investigating a case where in my ifc where for any rason 30000 openings as duplicates…

so i detected most involved where walls and slabs… so with that category i did mostly all my cuts!

BUT, each cut generates a IfcOpeningElement… how can i avoid that! is there a script based solution ?

Does anyone know this problem …?

KR

Andreas

Not really a Dynamo question, but happy to leave it out incase someone has some known workaround.

Just in case though I suggest you submit a ticket to Autodesk support via the accounts portal at manage.autodesk.com. No need to bring up dynamo when you do so, just point out that cut slab (or wall) geometry is being written to IFC as an opening but it likely ought to be ______. The IFC team will know pretty quick kf this is expected IFC behavior or how you need to edit the geometry.

1 Like

@jacob.small ,

it is defnitly caused by the code!

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
items1 = UnwrapElement(IN[0])
items2 = UnwrapElement(IN[1])

def CutGeometry(doc, item1, item2):
	try:
		SolidSolidCutUtils.AddCutBetweenSolids(doc,item1,item2)
		return True
	except:
		try:
			InstanceVoidCutUtils.AddInstanceVoidCut(doc,item1,item2)
			return True
		except: pass

TransactionManager.Instance.EnsureInTransaction(doc)
if isinstance(IN[0], list):
	if isinstance(IN[1], list): OUT = [CutGeometry(doc, x, y) for x, y in zip(items1, items2)]
	else: OUT = [CutGeometry(doc, x, items2) for x in items1]
else:
	if isinstance(IN[1], list): OUT = [CutGeometry(doc, items1, x) for x in items2]
	else: OUT = CutGeometry(doc, items1, items2)
TransactionManager.Instance.TransactionTaskDone()

so when i do it manualy it works! when i run the script! :frowning:

i have 12 openings they get 6x generated…


there should be no opening at all!

Is there realy no trick :wink:

KR

Andreas

RVT file to run it on?

@jacob.small
Projekt10.rvt (656 KB)

export is IFC4 , in IFC2x3 is the same Issue

Just to add that I’ve seen a lot of IFC models with these solid cutters. I’ve always assumed they either are meant to be this (so that they exist as an element in the IFC schema), or they’re needed for the IFC to capture this boolean operation due to not being able to achieve it the same way as Revit does natively.

Could be wrong, but it’s very common to see these and often in duplicate/triplicate etc.

1 Like

@GavinCrump ,

basicly i ignore it and exclude it from my QM…

Texteditor works partly, but not every viewer is able to open the file (f.e. Solibri)

KR

Andreas

1 Like

This is why I indicated to pass the issue on as a case, which gets funneled to a problem report and added the development backlog as appropriate/possible. Note this may also be an issue with the viewer (ie: Solibri), so doing the same at there end is advisable.

1 Like

Dug into this with a colleague today after the case was submitted. The code produces an IFC export which is the same as if we did the cuts manually. The only possible difference is that this performs a cut of all elements in list two by all elements in list 1, so you may be cutting an object out of an element which it doesn’t touch, thereby adding a cut element which results in no geometric change…

Testing for geometry intersection before performing the cut would resolve that issue, assuming it is an issue at all.

As a side note, using try/except statements to control data flow isn’t ideal, doubly so when you later a ‘pass’ on the end. Revising the loop to remove the try is advisable.

1 Like