Implement read, create, and write for IfcSverchok

This commit is contained in:
Dion Moult
2020-09-22 21:22:10 +10:00
parent 788c5b32f3
commit c01fd01c92
7 changed files with 221 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import bpy
import ifcopenshell
import ifcsverchok.helper
from bpy.props import StringProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode
class SvWriteIfc(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
bl_idname = 'SvWriteIfc'
bl_label = 'Write IFC'
file: StringProperty(name='file', update=updateNode)
path: StringProperty(name='path', update=updateNode)
def sv_init(self, context):
self.inputs.new('SvStringsSocket', 'file').prop_name = 'file'
self.inputs.new('SvStringsSocket', 'path').prop_name = 'path'
def process(self):
self.sv_input_names = ['file', 'path']
super().process()
def process_ifc(self, file, path):
file.write(path)
def register():
bpy.utils.register_class(SvWriteIfc)
def unregister():
bpy.utils.unregister_class(SvWriteIfc)