mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 16:43:00 +00:00
ifcsverchok - operator to apply graph to Bonsai file
This commit is contained in:
@@ -297,11 +297,13 @@ class IFC_PT_write_file_panel(bpy.types.Panel):
|
||||
def draw(self, context):
|
||||
ng = context.space_data.node_tree
|
||||
layout = self.layout
|
||||
assert layout
|
||||
row = layout.split(factor=0.2, align=True)
|
||||
row = layout.row()
|
||||
row2 = layout.row()
|
||||
row.operator("ifc.sverchok_update_current", text="IFC Re-run all nodes")
|
||||
row2.operator("ifc.write_file_panel")
|
||||
layout.operator("bim.ifcsverchok_use_bonsai_file")
|
||||
|
||||
|
||||
CLASSES = [IFC_Sv_UpdateCurrent, IFC_Sv_write_file, IFC_PT_write_file_panel]
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
from typing import Any, Union
|
||||
|
||||
import bonsai.tool as tool
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
@@ -50,6 +51,8 @@ class SvIfcStore:
|
||||
future = []
|
||||
schema_identifiers = ["IFC4", "IFC2X3"]
|
||||
|
||||
use_bonsai_file = False
|
||||
|
||||
@staticmethod
|
||||
def purge() -> None:
|
||||
SvIfcStore.path = ""
|
||||
@@ -95,6 +98,8 @@ class SvIfcStore:
|
||||
|
||||
@staticmethod
|
||||
def get_file() -> ifcopenshell.file:
|
||||
if SvIfcStore.use_bonsai_file:
|
||||
return tool.Ifc.get()
|
||||
if SvIfcStore.file is None:
|
||||
SvIfcStore.create_boilerplate()
|
||||
return SvIfcStore.file
|
||||
|
||||
Reference in New Issue
Block a user