mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
black ifcsverchok
This commit is contained in:
@@ -10,37 +10,38 @@ from sverchok.data_structure import updateNode
|
||||
class SvIfcSelectBlenderObjectsRefresh(bpy.types.Operator):
|
||||
bl_idname = "node.sv_ifc_select_blender_objects_refresh"
|
||||
bl_label = "IFC Select Blender Objects Refresh"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {"UNDO"}
|
||||
|
||||
idtree: StringProperty(default='')
|
||||
idname: StringProperty(default='')
|
||||
idtree: StringProperty(default="")
|
||||
idname: StringProperty(default="")
|
||||
|
||||
def execute(self, context):
|
||||
node = bpy.data.node_groups[self.idtree].nodes[self.idname]
|
||||
node.process()
|
||||
return {'FINISHED'}
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SvIfcSelectBlenderObjects(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.SvIfcCore):
|
||||
bl_idname = 'SvIfcSelectBlenderObjects'
|
||||
bl_label = 'IFC Select Blender Objects'
|
||||
file: StringProperty(name='file', update=updateNode)
|
||||
query: StringProperty(name='query', update=updateNode)
|
||||
bl_idname = "SvIfcSelectBlenderObjects"
|
||||
bl_label = "IFC Select Blender Objects"
|
||||
file: StringProperty(name="file", update=updateNode)
|
||||
query: StringProperty(name="query", update=updateNode)
|
||||
|
||||
def sv_init(self, context):
|
||||
self.inputs.new('SvStringsSocket', 'entities').prop_name = 'entities'
|
||||
self.inputs.new("SvStringsSocket", "entities").prop_name = "entities"
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
self.wrapper_tracked_ui_draw_op(layout, 'node.sv_ifc_select_blender_objects_refresh', icon='FILE_REFRESH', text='Refresh')
|
||||
self.wrapper_tracked_ui_draw_op(
|
||||
layout, "node.sv_ifc_select_blender_objects_refresh", icon="FILE_REFRESH", text="Refresh"
|
||||
)
|
||||
|
||||
def process(self):
|
||||
self.sv_input_names = ['entities']
|
||||
self.sv_input_names = ["entities"]
|
||||
self.guids = []
|
||||
super().process()
|
||||
for obj in bpy.context.visible_objects:
|
||||
index = obj.BIMObjectProperties.attributes.find('GlobalId')
|
||||
if index != -1 \
|
||||
and obj.BIMObjectProperties.attributes[index].string_value in self.guids:
|
||||
index = obj.BIMObjectProperties.attributes.find("GlobalId")
|
||||
if index != -1 and obj.BIMObjectProperties.attributes[index].string_value in self.guids:
|
||||
obj.select_set(True)
|
||||
|
||||
def process_ifc(self, entities):
|
||||
@@ -51,6 +52,7 @@ def register():
|
||||
bpy.utils.register_class(SvIfcSelectBlenderObjectsRefresh)
|
||||
bpy.utils.register_class(SvIfcSelectBlenderObjects)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(SvIfcSelectBlenderObjects)
|
||||
bpy.utils.unregister_class(SvIfcSelectBlenderObjectsRefresh)
|
||||
|
||||
Reference in New Issue
Block a user