set default position on creating window and door

to avoid validation errors like IfcProduct.PlacementForShapeRepresentation
This commit is contained in:
Andrej730
2023-06-30 14:16:39 +05:00
parent 2fc79e0bd3
commit 805d6652f1
2 changed files with 2 additions and 0 deletions
@@ -487,6 +487,7 @@ class BIM_OT_add_door(bpy.types.Operator, tool.Ifc.Operator):
element = blenderbim.core.root.assign_class(
tool.Ifc, tool.Collector, tool.Root, obj=obj, ifc_class="IfcDoor", should_add_representation=False
)
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
if tool.Ifc.get_schema() != "IFC2X3":
element.PredefinedType = "DOOR"
@@ -456,6 +456,7 @@ class BIM_OT_add_window(bpy.types.Operator, tool.Ifc.Operator):
element = blenderbim.core.root.assign_class(
tool.Ifc, tool.Collector, tool.Root, obj=obj, ifc_class="IfcWindow", should_add_representation=False
)
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
if tool.Ifc.get_schema() != "IFC2X3":
element.PredefinedType = "WINDOW"