mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
typing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user