2020-09-22 21:22:10 +10:00
|
|
|
import bpy
|
|
|
|
|
import ifcopenshell
|
|
|
|
|
import ifcsverchok.helper
|
|
|
|
|
from bpy.props import StringProperty
|
|
|
|
|
from sverchok.node_tree import SverchCustomTreeNode
|
|
|
|
|
from sverchok.data_structure import updateNode
|
|
|
|
|
|
|
|
|
|
|
2020-10-01 14:47:42 +10:00
|
|
|
class SvIfcWriteFile(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
|
|
|
|
|
bl_idname = 'SvIfcWriteFile'
|
|
|
|
|
bl_label = 'IFC Write File'
|
2020-09-22 21:22:10 +10:00
|
|
|
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():
|
2020-10-01 14:47:42 +10:00
|
|
|
bpy.utils.register_class(SvIfcWriteFile)
|
2020-09-22 21:22:10 +10:00
|
|
|
|
|
|
|
|
def unregister():
|
2020-10-01 14:47:42 +10:00
|
|
|
bpy.utils.unregister_class(SvIfcWriteFile)
|