diff --git a/src/ifcsverchok/__init__.py b/src/ifcsverchok/__init__.py index 4c4b018b47..afc28e45e0 100644 --- a/src/ifcsverchok/__init__.py +++ b/src/ifcsverchok/__init__.py @@ -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"), ])] diff --git a/src/ifcsverchok/nodes/ifc/generate_guid.py b/src/ifcsverchok/nodes/ifc/generate_guid.py new file mode 100644 index 0000000000..c535d30272 --- /dev/null +++ b/src/ifcsverchok/nodes/ifc/generate_guid.py @@ -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)