mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Fix possible errors in add_filling and remove_filling
This commit is contained in:
@@ -129,7 +129,7 @@ class AddFilling(bpy.types.Operator):
|
|||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
element_id = obj.BIMObjectProperties.ifc_definition_id
|
element_id = obj.BIMObjectProperties.ifc_definition_id
|
||||||
opening_id = opening.BIMObjectProperties.ifc_definition_id
|
opening_id = opening.BIMObjectProperties.ifc_definition_id
|
||||||
if not element_id or not opening_id:
|
if not element_id or not opening_id or element_id == opening_id:
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"void.add_filling",
|
"void.add_filling",
|
||||||
@@ -155,10 +155,11 @@ class RemoveFilling(bpy.types.Operator):
|
|||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
ifcopenshell.api.run(
|
element_id = obj.BIMObjectProperties.ifc_definition_id
|
||||||
"void.remove_filling", self.file, **{"element": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
if not element_id:
|
||||||
)
|
return {"FINISHED"}
|
||||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
ifcopenshell.api.run("void.remove_filling", self.file, **{"element": self.file.by_id(element_id)})
|
||||||
|
Data.load(self.file, element_id)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user