Prevent aggregating non-ifc elements + display popup info

This commit is contained in:
Gorgious
2022-01-30 12:15:21 +01:00
parent 601d3d4edf
commit c3c6578f38
@@ -32,6 +32,17 @@ from bpy.props import (
)
def update_relating_object(self, context):
def message(self, context):
self.layout.label(text="Please select a valid Ifc Element")
if self.relating_object is None:
return
if not self.relating_object.BIMObjectProperties.ifc_definition_id:
context.window_manager.popup_menu(message, title="Invalid Element Selected", icon="INFO")
self.relating_object = None
class BIMObjectAggregateProperties(PropertyGroup):
is_editing: BoolProperty(name="Is Editing")
relating_object: PointerProperty(name="Aggregate", type=bpy.types.Object)
relating_object: PointerProperty(name="Aggregate", type=bpy.types.Object, update=update_relating_object)