This commit is contained in:
Andrej730
2024-08-30 16:56:13 +05:00
parent ccbb253d2c
commit 3c333c6b59
8 changed files with 17 additions and 11 deletions
@@ -19,7 +19,6 @@
import bpy
import mathutils
import numpy as np
from functools import reduce
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.system
+4 -2
View File
@@ -76,7 +76,7 @@ def disable_editing_sheets(drawing: tool.Drawing) -> None:
drawing.disable_editing_sheets()
def add_sheet(ifc: tool.Ifc, drawing, titleblock: ifcopenshell.entity_instance) -> None:
def add_sheet(ifc: tool.Ifc, drawing: tool.Drawing, titleblock: ifcopenshell.entity_instance) -> None:
sheet = ifc.run("document.add_information")
layout = ifc.run("document.add_reference", information=sheet)
titleblock_reference = ifc.run("document.add_reference", information=sheet)
@@ -127,7 +127,9 @@ def remove_sheet(ifc: tool.Ifc, drawing: tool.Drawing, sheet: ifcopenshell.entit
drawing.import_sheets()
def rename_sheet(ifc: tool.Ifc, drawing, sheet: ifcopenshell.entity_instance, identification: str, name: str) -> None:
def rename_sheet(
ifc: tool.Ifc, drawing: tool.Drawing, sheet: ifcopenshell.entity_instance, identification: str, name: str
) -> None:
if ifc.get_schema() == "IFC2X3":
attributes = {"DocumentId": identification, "Name": name}
else:
+2 -1
View File
@@ -22,6 +22,7 @@ import numpy as np
import ifcopenshell.api
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
import ifcopenshell.util.element
import ifcopenshell.util.schema
import bonsai.core.tool
import bonsai.bim.handler
import bonsai.tool as tool
@@ -60,7 +61,7 @@ class Ifc(bonsai.core.tool.Ifc):
return IfcStore.path
@classmethod
def get_schema(cls) -> str:
def get_schema(cls) -> ifcopenshell.util.schema.IFC_SCHEMA:
if IfcStore.get_file():
return IfcStore.get_file().schema