mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
New node to generate IFC guid
This commit is contained in:
@@ -33,6 +33,7 @@ def nodes_index():
|
|||||||
("ifc.by_query", "SvIfcByQuery"),
|
("ifc.by_query", "SvIfcByQuery"),
|
||||||
("ifc.add", "SvIfcAdd"),
|
("ifc.add", "SvIfcAdd"),
|
||||||
("ifc.remove", "SvIfcRemove"),
|
("ifc.remove", "SvIfcRemove"),
|
||||||
|
("ifc.generate_guid", "SvIfcGenerateGuid"),
|
||||||
("ifc.select_blender_objects", "SvIfcSelectBlenderObjects"),
|
("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)
|
||||||
Reference in New Issue
Block a user