mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
Catch Assign_Brick_Reference with no selections
This commit is contained in:
@@ -118,7 +118,15 @@ class AssignBrickReference(bpy.types.Operator, Operator):
|
|||||||
bl_description = "Assign the selected Ifc entity to the selected Brick entity"
|
bl_description = "Assign the selected Ifc entity to the selected Brick entity"
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
|
if not context.active_object:
|
||||||
|
self.report({'ERROR'}, f'No Ifc selected')
|
||||||
|
return
|
||||||
props = context.scene.BIMBrickProperties
|
props = context.scene.BIMBrickProperties
|
||||||
|
try:
|
||||||
|
props.bricks[props.active_brick_index]
|
||||||
|
except:
|
||||||
|
self.report({'ERROR'}, f'No Brick selected')
|
||||||
|
return
|
||||||
core.assign_brick_reference(
|
core.assign_brick_reference(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Brick,
|
tool.Brick,
|
||||||
|
|||||||
Reference in New Issue
Block a user