References for adding external svgs to the sheets

It works exactly the same as schedules - you add some .svg file, path to it stored in ifc and you can attach it to the sheet.

UI - https://i.imgur.com/tGbCGBb.png

Still need to add some tests for references
This commit is contained in:
Andrej730
2023-06-01 21:41:06 +05:00
parent 87673b0784
commit c930eb7603
11 changed files with 275 additions and 60 deletions
+18 -4
View File
@@ -237,6 +237,10 @@ class Drawing(blenderbim.core.tool.Drawing):
def disable_editing_schedules(cls):
bpy.context.scene.DocProperties.is_editing_schedules = False
@classmethod
def disable_editing_references(cls):
bpy.context.scene.DocProperties.is_editing_references = False
@classmethod
def disable_editing_sheets(cls):
bpy.context.scene.DocProperties.is_editing_sheets = False
@@ -265,6 +269,10 @@ class Drawing(blenderbim.core.tool.Drawing):
def enable_editing_schedules(cls):
bpy.context.scene.DocProperties.is_editing_schedules = True
@classmethod
def enable_editing_references(cls):
bpy.context.scene.DocProperties.is_editing_references = True
@classmethod
def enable_editing_sheets(cls):
bpy.context.scene.DocProperties.is_editing_sheets = True
@@ -625,11 +633,17 @@ class Drawing(blenderbim.core.tool.Drawing):
new.is_selected = current_drawings_selection.get(drawing.id(), True)
@classmethod
def import_schedules(cls):
bpy.context.scene.DocProperties.schedules.clear()
schedules = [d for d in tool.Ifc.get().by_type("IfcDocumentInformation") if d.Scope == "SCHEDULE"]
def import_documents(cls, document_type):
dprops = bpy.context.scene.DocProperties
if document_type == "SCHEDULE":
documents_collection = dprops.schedules
elif document_type == "REFERENCE":
documents_collection = dprops.references
documents_collection.clear()
schedules = [d for d in tool.Ifc.get().by_type("IfcDocumentInformation") if d.Scope == document_type]
for schedule in schedules:
new = bpy.context.scene.DocProperties.schedules.add()
new = documents_collection.add()
new.ifc_definition_id = schedule.id()
new.name = schedule.Name or "Unnamed"
if tool.Ifc.get_schema() == "IFC2X3":