mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
bim.add_bcf_comment - poll message
This commit is contained in:
@@ -1106,9 +1106,20 @@ class AddBcfComment(bpy.types.Operator):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
props = context.scene.BCFProperties
|
props = context.scene.BCFProperties
|
||||||
if not props.comment:
|
if not props.comment:
|
||||||
|
cls.poll_message_set("No comment to add.")
|
||||||
return False
|
return False
|
||||||
if props.has_related_viewpoint and not bcf_prop.getBcfViewpoints(None, context):
|
|
||||||
|
topic = props.active_topic
|
||||||
|
if not topic:
|
||||||
|
cls.poll_message_set("No topic is active.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if props.has_related_viewpoint:
|
||||||
|
topic = props.topics[topic.name]
|
||||||
|
viewpoint = tool.Blender.get_enum_safe(topic, "viewpoints")
|
||||||
|
if not viewpoint:
|
||||||
|
cls.poll_message_set("No viewpoint is active to add a comment with viewpoint.")
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|||||||
Reference in New Issue
Block a user