1) pasing ID references
2) bugs in create_entities, where number of representations couldn't be updated
3) by_id node updated to current workflow
... other small fixes
This commit is contained in:
martinaCodes
2022-10-21 00:11:45 +02:00
committed by Dion Moult
parent 5d569dea30
commit c8c690afc2
3 changed files with 97 additions and 66 deletions
+11 -10
View File
@@ -20,6 +20,7 @@
import bpy
import ifcopenshell
import ifcsverchok.helper
from ifcsverchok.ifcstore import SvIfcStore
from bpy.props import StringProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode
@@ -28,21 +29,21 @@ from sverchok.data_structure import updateNode
class SvIfcById(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
bl_idname = "SvIfcById"
bl_label = "IFC By Id"
file: StringProperty(name="file", update=updateNode)
id: StringProperty(name="id", update=updateNode)
id: StringProperty(name="Id(s)", update=updateNode)
def sv_init(self, context):
self.inputs.new("SvStringsSocket", "file").prop_name = "file"
self.inputs.new("SvStringsSocket", "id").prop_name = "id"
self.outputs.new("SvStringsSocket", "entity")
self.outputs.new("SvStringsSocket", "Entities")
def draw_buttons(self, context, layout):
layout.operator("node.sv_ifc_tooltip", text="", icon="QUESTION", emboss=False).tooltip = "Get IFC element by step id. Takes one or multiple step ids."
def process(self):
self.sv_input_names = ["file", "id"]
super().process()
def process_ifc(self, file, id):
self.outputs["entity"].sv_set([[file.by_id(int(id))]])
self.ids = self.inputs["id"].sv_get()
print(self.ids)
self.file = SvIfcStore.get_file()
self.entities = [self.file.by_id(step_id) for step_id in self.ids]
self.outputs["Entities"].sv_set(self.entities)
def register():
bpy.utils.register_class(SvIfcById)