You can now unlink blender objects to IFC ones. See #1222.

This commit is contained in:
Dion Moult
2021-01-27 15:41:24 +11:00
parent c0ed4074d8
commit c472dc2f1b
3 changed files with 19 additions and 0 deletions
@@ -186,3 +186,20 @@ class UnassignClass(bpy.types.Operator):
if "/" in obj.name and obj.name[0:3] == "Ifc":
obj.name = "/".join(obj.name.split("/")[1:])
return {"FINISHED"}
class UnlinkObject(bpy.types.Operator):
bl_idname = "bim.unlink_object"
bl_label = "Unlink Object"
obj: bpy.props.StringProperty()
def execute(self, context):
self.file = IfcStore.get_file()
if self.obj:
objects = [bpy.data.objects.get(self.obj)]
else:
objects = bpy.context.selected_objects
for obj in objects:
if obj.BIMObjectProperties.ifc_definition_id:
obj.BIMObjectProperties.ifc_definition_id = 0
return {"FINISHED"}