diff --git a/src/blenderbim/blenderbim/bim/module/model/pie.py b/src/blenderbim/blenderbim/bim/module/model/pie.py index 799673bffd..e76a5eb52e 100644 --- a/src/blenderbim/blenderbim/bim/module/model/pie.py +++ b/src/blenderbim/blenderbim/bim/module/model/pie.py @@ -26,6 +26,7 @@ from blenderbim.bim.ifc import IfcStore class OpenPieClass(bpy.types.Operator): bl_idname = "bim.open_pie_class" bl_label = "Open Pie Class" + bl_description = "Assign the IFC Class to the selected objects" def execute(self, context): bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_bim_class") diff --git a/src/blenderbim/blenderbim/bim/module/root/operator.py b/src/blenderbim/blenderbim/bim/module/root/operator.py index b306086e2b..f58077282a 100644 --- a/src/blenderbim/blenderbim/bim/module/root/operator.py +++ b/src/blenderbim/blenderbim/bim/module/root/operator.py @@ -166,7 +166,7 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.assign_class" bl_label = "Assign IFC Class" bl_options = {"REGISTER", "UNDO"} - bl_description = "Assign the IFC Class to the selected object" + bl_description = "Assign the IFC Class to the selected objects" obj: bpy.props.StringProperty() ifc_class: bpy.props.StringProperty() predefined_type: bpy.props.StringProperty() @@ -175,6 +175,13 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator): should_add_representation: bpy.props.BoolProperty(default=True) ifc_representation_class: bpy.props.StringProperty() + @classmethod + def poll(cls, context): + if not context.active_object and not context.selected_objects: + cls.poll_message_set("No object selected.") + return False + return True + def _execute(self, context): props = context.scene.BIMRootProperties objects = [bpy.data.objects.get(self.obj)] if self.obj else context.selected_objects or [context.active_object]