mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:02:29 +00:00
bonsai bcf - poll message for adding bim snippet
This commit is contained in:
@@ -379,12 +379,14 @@ class AddBcfBimSnippet(bpy.types.Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return all(
|
props = context.scene.BCFProperties
|
||||||
(
|
props_are_filled = all(
|
||||||
getattr(context.scene.BCFProperties, attr, False)
|
(getattr(props, attr) for attr in ("bim_snippet_reference", "bim_snippet_schema", "bim_snippet_type"))
|
||||||
for attr in ("bim_snippet_reference", "bim_snippet_schema", "bim_snippet_type")
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
if not props_are_filled:
|
||||||
|
cls.poll_message_set("Some BIM snippet fields are empty.")
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
bcfxml = bcfstore.BcfStore.get_bcfxml()
|
bcfxml = bcfstore.BcfStore.get_bcfxml()
|
||||||
|
|||||||
Reference in New Issue
Block a user