This commit is contained in:
Andrej730
2025-06-26 20:18:33 +05:00
parent 0b05c3bcfc
commit b3a708c06c
3 changed files with 6 additions and 3 deletions
@@ -22,6 +22,7 @@ import bonsai.tool as tool
import ifcopenshell.api.pset
import ifcopenshell.util.element
from bonsai.core import bsdd as core
from typing import Any
class LoadBSDDDictionaries(bpy.types.Operator):
@@ -88,7 +89,7 @@ class AddBSDDProperties(bpy.types.Operator, tool.Ifc.Operator):
self.file = tool.Ifc.get()
bprops = tool.Bsdd.get_bsdd_props()
psets = {}
psets: dict[str, dict[str, Any]] = {}
for selected_property in bprops.selected_properties:
psets.setdefault(selected_property.metadata, {})[selected_property.name] = selected_property.get_value()
@@ -2437,7 +2437,9 @@ class SaveDrawingStyle(bpy.types.Operator, tool.Ifc.Operator):
style = {}
eval_namespace = {"context": context, "scene": scene, "space": space}
def add_prop_to_style(prop_path, context, scene, space):
def add_prop_to_style(
prop_path: str, context: bpy.types.Context, scene: bpy.types.Scene, space: bpy.types.SpaceView3D
) -> None:
value = eval(prop_path)
if not isinstance(value, str):
try:
@@ -320,7 +320,7 @@ class Usecase:
return prop
def add_new_properties(self) -> list[ifcopenshell.entity_instance]:
properties = []
properties: list[ifcopenshell.entity_instance] = []
for name, value in self.settings["properties"].items():
if value is None and self.settings["should_purge"]:
continue