#1153. Section references are now auto generated when activating a drawing.

This commit is contained in:
Dion Moult
2022-03-29 17:04:50 +11:00
parent a60dfd8dd5
commit 2c6cb2fbb2
6 changed files with 228 additions and 110 deletions
@@ -82,6 +82,11 @@ class AddDrawing(bpy.types.Operator, Operator):
target_view=self.props.target_view,
location_hint=hint,
)
try:
drawing = tool.Ifc.get().by_id(self.props.active_drawing_id)
core.sync_references(tool.Ifc, tool.Collector, tool.Drawing, drawing=drawing)
except:
pass
class CreateDrawing(bpy.types.Operator):
@@ -777,12 +782,10 @@ class RemoveDrawing(bpy.types.Operator, Operator):
bl_idname = "bim.remove_drawing"
bl_label = "Remove Drawing"
bl_options = {"REGISTER", "UNDO"}
index: bpy.props.IntProperty()
drawing: bpy.props.IntProperty()
def _execute(self, context):
props = context.scene.DocProperties
drawing = tool.Ifc.get().by_id(props.drawings[self.index].ifc_definition_id)
core.remove_drawing(tool.Ifc, tool.Drawing, drawing=drawing)
core.remove_drawing(tool.Ifc, tool.Drawing, drawing=tool.Ifc.get().by_id(self.drawing))
class AddDrawingStyle(bpy.types.Operator):