mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
WIP minor tweaks to port IfcSverchok. See #1222.
This commit is contained in:
@@ -4,8 +4,7 @@ import ifcsverchok.helper
|
|||||||
from bpy.props import StringProperty, EnumProperty
|
from bpy.props import StringProperty, EnumProperty
|
||||||
from sverchok.node_tree import SverchCustomTreeNode
|
from sverchok.node_tree import SverchCustomTreeNode
|
||||||
from sverchok.data_structure import updateNode
|
from sverchok.data_structure import updateNode
|
||||||
from blenderbim.bim import schema
|
from blenderbim.bim.module.root.prop import getIfcClasses, getIfcProducts, refreshClasses, refreshPredefinedTypes
|
||||||
from blenderbim.bim.prop import getIfcClasses, getIfcProducts, refreshClasses, refreshPredefinedTypes
|
|
||||||
|
|
||||||
|
|
||||||
class SvIfcByType(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
|
class SvIfcByType(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ifcsverchok.helper
|
|||||||
from bpy.props import StringProperty
|
from bpy.props import StringProperty
|
||||||
from sverchok.node_tree import SverchCustomTreeNode
|
from sverchok.node_tree import SverchCustomTreeNode
|
||||||
from sverchok.data_structure import updateNode
|
from sverchok.data_structure import updateNode
|
||||||
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
|
||||||
|
|
||||||
class SvIfcSelectBlenderObjectsRefresh(bpy.types.Operator):
|
class SvIfcSelectBlenderObjectsRefresh(bpy.types.Operator):
|
||||||
@@ -36,12 +37,14 @@ class SvIfcSelectBlenderObjects(bpy.types.Node, SverchCustomTreeNode, ifcsvercho
|
|||||||
)
|
)
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
self.file = IfcStore.get_file()
|
||||||
self.sv_input_names = ["entities"]
|
self.sv_input_names = ["entities"]
|
||||||
self.guids = []
|
self.guids = []
|
||||||
super().process()
|
super().process()
|
||||||
for obj in bpy.context.visible_objects:
|
for obj in bpy.context.visible_objects:
|
||||||
index = obj.BIMObjectProperties.attributes.find("GlobalId")
|
if not obj.BIMObjectProperties.ifc_definition_id:
|
||||||
if index != -1 and obj.BIMObjectProperties.attributes[index].string_value in self.guids:
|
continue
|
||||||
|
if self.file.by_id(obj.BIMObjectProperties.ifc_definition_id).GlobalId in self.guids:
|
||||||
obj.select_set(True)
|
obj.select_set(True)
|
||||||
|
|
||||||
def process_ifc(self, entities):
|
def process_ifc(self, entities):
|
||||||
|
|||||||
Reference in New Issue
Block a user