New node to generate IFC guid

This commit is contained in:
Dion Moult
2020-10-13 19:40:42 +11:00
parent fd18916b20
commit 2ead44e1c5
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -33,6 +33,7 @@ def nodes_index():
("ifc.by_query", "SvIfcByQuery"),
("ifc.add", "SvIfcAdd"),
("ifc.remove", "SvIfcRemove"),
("ifc.generate_guid", "SvIfcGenerateGuid"),
("ifc.select_blender_objects", "SvIfcSelectBlenderObjects"),
])]
@@ -0,0 +1,24 @@
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 SvIfcGenerateGuid(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
bl_idname = 'SvIfcGenerateGuid'
bl_label = 'IFC Generate Guid'
def sv_init(self, context):
self.outputs.new('SvStringsSocket', 'guid')
def process(self):
self.outputs['guid'].sv_set([[ifcopenshell.guid.new()]])
def register():
bpy.utils.register_class(SvIfcGenerateGuid)
def unregister():
bpy.utils.unregister_class(SvIfcGenerateGuid)