This commit is contained in:
Andrej730
2025-03-19 14:21:15 +05:00
parent 2a2bfea870
commit f8f36cf2f0
5 changed files with 17 additions and 6 deletions
@@ -19,6 +19,7 @@
import bpy
from mathutils import Matrix
import ifcopenshell
import ifcopenshell.api
import ifcsverchok.helper
from ifcsverchok.ifcstore import SvIfcStore
+2 -1
View File
@@ -34,6 +34,7 @@ class SvIfcCreateFileRefresh(bpy.types.Operator):
has_baked: bpy.props.BoolProperty(name="Has Baked", default=False)
def execute(self, context):
node: SvIfcCreateFile
node = bpy.data.node_groups[self.tree_name].nodes[self.node_name]
node.process()
return {"FINISHED"}
@@ -55,7 +56,7 @@ class SvIfcCreateFile(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.S
self.sv_input_names = ["schema"]
super().process()
def process_ifc(self, schema):
def process_ifc(self, schema: str) -> None:
guid = ifcopenshell.guid.new()
ifcsverchok.helper.ifc_files[guid] = ifcopenshell.file(schema=schema)
self.outputs["file"].sv_set([[ifcsverchok.helper.ifc_files[guid]]])
+1 -1
View File
@@ -52,7 +52,7 @@ class SvIfcCreateProject(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helpe
project_name = self.inputs["project_name"].sv_get()[0][0]
self.process_ifc(file, project_name)
def process_ifc(self, file, project_name):
def process_ifc(self, file: ifcopenshell.file, project_name: str) -> None:
# create project
project = ifcopenshell.api.run("root.create_entity", file, ifc_class="IfcProject", name=str(project_name))
lengthunit = ifcopenshell.api.run("unit.add_si_unit", file, unit_type="LENGTHUNIT")