Removing drawings now roundtrips in IFC. See #1153.

This commit is contained in:
Dion Moult
2022-02-04 10:54:18 +11:00
parent 868ced2990
commit 7116a9f71a
6 changed files with 110 additions and 9 deletions
@@ -816,21 +816,16 @@ class ResizeText(bpy.types.Operator):
return {"FINISHED"}
class RemoveDrawing(bpy.types.Operator):
class RemoveDrawing(bpy.types.Operator, Operator):
bl_idname = "bim.remove_drawing"
bl_label = "Remove Drawing"
bl_options = {"REGISTER", "UNDO"}
index: bpy.props.IntProperty()
def execute(self, context):
def _execute(self, context):
props = context.scene.DocProperties
camera = props.drawings[self.index].camera
collection = camera.users_collection[0]
for obj in collection.objects:
bpy.data.objects.remove(obj)
bpy.data.collections.remove(collection, do_unlink=True)
props.drawings.remove(self.index)
return {"FINISHED"}
drawing = tool.Ifc.get().by_id(props.drawings[self.index].ifc_definition_id)
core.remove_drawing(tool.Ifc, tool.Drawing, drawing=drawing)
class AddDrawingStyle(bpy.types.Operator):