BIM: fix strict IFC drag and drop

This commit is contained in:
Roy-043
2025-10-23 12:02:06 +02:00
committed by Yorik van Havre
parent c7c068be6e
commit 4ef209cabe

View File

@@ -1205,6 +1205,7 @@ def aggregate(obj, parent, mode=None):
if not ifcfile:
return
product = None
objecttype = None
new = False
stepid = getattr(obj, "StepId", None)
if stepid:
@@ -1217,13 +1218,12 @@ def aggregate(obj, parent, mode=None):
pass
if product:
# this object already has an associated IFC product
print("DEBUG:", obj.Label, "is already part of the IFC document")
# print("DEBUG:", obj.Label, "is already part of the IFC document")
newobj = obj
else:
ifcclass = None
if mode == "opening":
ifcclass = "IfcOpeningElement"
objecttype = None
if ifc_export.is_annotation(obj):
product = ifc_export.create_annotation(obj, ifcfile)
if Draft.get_type(obj) in ["DraftText", "Text"]:
@@ -1234,9 +1234,13 @@ def aggregate(obj, parent, mode=None):
else:
product = ifc_export.create_product(obj, parent, ifcfile, ifcclass)
if product:
shapemode = getattr(parent, "ShapeMode", DEFAULT_SHAPEMODE)
newobj = create_object(product, obj.Document, ifcfile, shapemode, objecttype)
new = True
exobj = get_object(product, obj.Document)
if exobj is None:
shapemode = getattr(parent, "ShapeMode", DEFAULT_SHAPEMODE)
newobj = create_object(product, obj.Document, ifcfile, shapemode, objecttype)
new = True
else:
newobj = exobj
create_relationship(obj, newobj, parent, product, ifcfile, mode)
base = getattr(obj, "Base", None)
if base: