mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
Fix error when adding opening with None object
This commit is contained in:
@@ -35,8 +35,10 @@ class AddOpening(bpy.types.Operator):
|
|||||||
return IfcStore.execute_ifc_operator(self, context)
|
return IfcStore.execute_ifc_operator(self, context)
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
obj = context.scene.objects.get(self.obj, context.active_object)
|
||||||
opening = bpy.data.objects.get(self.opening)
|
opening = context.scene.objects.get(self.opening)
|
||||||
|
if opening is None:
|
||||||
|
return {"FINISHED"}
|
||||||
opening.display_type = "WIRE"
|
opening.display_type = "WIRE"
|
||||||
if not opening.BIMObjectProperties.ifc_definition_id:
|
if not opening.BIMObjectProperties.ifc_definition_id:
|
||||||
body_context_id = None
|
body_context_id = None
|
||||||
|
|||||||
Reference in New Issue
Block a user