mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
add a couple poll messages
This commit is contained in:
@@ -720,11 +720,8 @@ class LoadProductCostItems(bpy.types.Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if not tool.Ifc.get():
|
if not tool.Ifc.get() or not (obj := context.active_object) or not (obj.BIMObjectProperties.ifc_definition_id):
|
||||||
return False
|
cls.poll_message_set("No IFC object is active.")
|
||||||
if not context.active_object:
|
|
||||||
return False
|
|
||||||
if not context.active_object.BIMObjectProperties.ifc_definition_id:
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -1399,11 +1399,8 @@ class LoadProductTasks(bpy.types.Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if not tool.Ifc.get():
|
if not tool.Ifc.get() or not (obj := context.active_object) or not (obj.BIMObjectProperties.ifc_definition_id):
|
||||||
return False
|
cls.poll_message_set("No IFC object is active.")
|
||||||
if not context.active_object:
|
|
||||||
return False
|
|
||||||
if not context.active_object.BIMObjectProperties.ifc_definition_id:
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user