mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
bim.assign_class - skip ifc objects to prevent errors
This commit is contained in:
@@ -174,7 +174,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 objects"
|
||||
bl_description = "Assign the IFC Class to the selected non-ifc objects."
|
||||
obj: bpy.props.StringProperty()
|
||||
ifc_class: bpy.props.StringProperty()
|
||||
predefined_type: bpy.props.StringProperty()
|
||||
@@ -217,6 +217,10 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
|
||||
tool.Blender.clear_objects_selection()
|
||||
|
||||
for obj in objects:
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if element:
|
||||
continue
|
||||
|
||||
if obj.mode != "OBJECT":
|
||||
self.report({"ERROR"}, "Object must be in OBJECT mode to assign class")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user