From 465bd23d6f89ac86646bb55e965317cbab130a8e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 14 Jul 2025 16:40:03 +0500 Subject: [PATCH] import_attributes2 -> import_attributes import_attributes were removed in 76f0b57ff --- src/bonsai/bonsai/bim/helper.py | 3 +-- .../bonsai/bim/module/attribute/operator.py | 2 +- .../bonsai/bim/module/classification/operator.py | 8 ++++---- .../bonsai/bim/module/constraint/operator.py | 2 +- src/bonsai/bonsai/bim/module/drawing/operator.py | 2 +- src/bonsai/bonsai/bim/module/group/operator.py | 2 +- src/bonsai/bonsai/bim/module/layer/operator.py | 2 +- .../bonsai/bim/module/material/operator.py | 10 +++++----- src/bonsai/bonsai/bim/module/profile/operator.py | 2 +- src/bonsai/bonsai/bim/module/project/prop.py | 2 +- .../bonsai/bim/module/structural/operator.py | 4 ++-- src/bonsai/bonsai/bim/module/style/operator.py | 2 +- src/bonsai/bonsai/bim/module/system/operator.py | 2 +- src/bonsai/bonsai/tool/attribute.py | 2 +- src/bonsai/bonsai/tool/context.py | 2 +- src/bonsai/bonsai/tool/cost.py | 8 ++++---- src/bonsai/bonsai/tool/document.py | 2 +- src/bonsai/bonsai/tool/drawing.py | 2 +- src/bonsai/bonsai/tool/geometry.py | 2 +- src/bonsai/bonsai/tool/georeference.py | 6 ++---- src/bonsai/bonsai/tool/library.py | 4 ++-- src/bonsai/bonsai/tool/material.py | 2 +- src/bonsai/bonsai/tool/owner.py | 12 ++++++------ src/bonsai/bonsai/tool/resource.py | 8 ++++---- src/bonsai/bonsai/tool/sequence.py | 16 ++++++++-------- src/bonsai/bonsai/tool/style.py | 2 +- src/bonsai/bonsai/tool/system.py | 2 +- src/bonsai/bonsai/tool/unit.py | 2 +- 28 files changed, 56 insertions(+), 59 deletions(-) diff --git a/src/bonsai/bonsai/bim/helper.py b/src/bonsai/bonsai/bim/helper.py index 7d6b7b14b1..79b5fe7974 100644 --- a/src/bonsai/bonsai/bim/helper.py +++ b/src/bonsai/bonsai/bim/helper.py @@ -156,8 +156,7 @@ def draw_attribute( op.name = attribute.name -# TODO: rename to 'import_attributes'. -def import_attributes2( +def import_attributes( element: Union[str, ifcopenshell.entity_instance], props: bpy.types.bpy_prop_collection_idprop[Attribute], callback: Optional[ImportCallback] = None, diff --git a/src/bonsai/bonsai/bim/module/attribute/operator.py b/src/bonsai/bonsai/bim/module/attribute/operator.py index a5e4be4216..fb39efe91e 100644 --- a/src/bonsai/bonsai/bim/module/attribute/operator.py +++ b/src/bonsai/bonsai/bim/module/attribute/operator.py @@ -107,7 +107,7 @@ class EnableEditingAttributes(bpy.types.Operator, AttributesOperator): if value is not None: new.enum_value = str(value.id()) - bonsai.bim.helper.import_attributes2(element, props.attributes, callback=callback) + bonsai.bim.helper.import_attributes(element, props.attributes, callback=callback) props.is_editing_attributes = True def execute(self, context): diff --git a/src/bonsai/bonsai/bim/module/classification/operator.py b/src/bonsai/bonsai/bim/module/classification/operator.py index 2d7327abb5..8ab195ebd1 100644 --- a/src/bonsai/bonsai/bim/module/classification/operator.py +++ b/src/bonsai/bonsai/bim/module/classification/operator.py @@ -146,7 +146,7 @@ class EnableAddingManualClassification(bpy.types.Operator): props.is_adding = True props.active_classification_id = 0 props.classification_attributes.clear() - bonsai.bim.helper.import_attributes2("IfcClassification", props.classification_attributes) + bonsai.bim.helper.import_attributes("IfcClassification", props.classification_attributes) return {"FINISHED"} @@ -170,7 +170,7 @@ class EnableAddingManualClassificationReference(bpy.types.Operator): props = tool.Classification.get_classification_reference_props() props.is_adding = True props.reference_attributes.clear() - bonsai.bim.helper.import_attributes2("IfcClassificationReference", props.reference_attributes) + bonsai.bim.helper.import_attributes("IfcClassificationReference", props.reference_attributes) return {"FINISHED"} @@ -205,7 +205,7 @@ class EnableEditingClassification(bpy.types.Operator): props = tool.Classification.get_classification_props() props.classification_attributes.clear() - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( tool.Ifc.get().by_id(self.classification), props.classification_attributes, callback ) props.active_classification_id = self.classification @@ -274,7 +274,7 @@ class EnableEditingClassificationReference(bpy.types.Operator): def execute(self, context): props = tool.Classification.get_classification_reference_props() props.reference_attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.reference), props.reference_attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.reference), props.reference_attributes) props.active_reference_id = self.reference return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/constraint/operator.py b/src/bonsai/bonsai/bim/module/constraint/operator.py index 5b291106f8..4297642c3b 100644 --- a/src/bonsai/bonsai/bim/module/constraint/operator.py +++ b/src/bonsai/bonsai/bim/module/constraint/operator.py @@ -81,7 +81,7 @@ class EnableEditingConstraint(bpy.types.Operator): def execute(self, context): props = tool.Blender.get_constraint_props() props.constraint_attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.constraint), props.constraint_attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.constraint), props.constraint_attributes) props.active_constraint_id = self.constraint return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index 8d3498bce6..9346bbde78 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -3045,7 +3045,7 @@ class AddTextLiteral(bpy.types.Operator): "Path": "RIGHT", "BoxAlignment": "bottom_left", } - # emulates `bonsai.bim.helper.import_attributes2(ifc_literal, literal_props.attributes)` + # emulates `bonsai.bim.helper.import_attributes(ifc_literal, literal_props.attributes)` for attr_name in literal_attr_values: attr = literal_attributes.add() attr.name = attr_name diff --git a/src/bonsai/bonsai/bim/module/group/operator.py b/src/bonsai/bonsai/bim/module/group/operator.py index 3172c2c38a..848c42131c 100644 --- a/src/bonsai/bonsai/bim/module/group/operator.py +++ b/src/bonsai/bonsai/bim/module/group/operator.py @@ -165,7 +165,7 @@ class EnableEditingGroup(bpy.types.Operator, tool.Ifc.Operator): def _execute(self, context): props = tool.Blender.get_group_props() props.group_attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.group), props.group_attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.group), props.group_attributes) props.active_group_id = self.group return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/layer/operator.py b/src/bonsai/bonsai/bim/module/layer/operator.py index 079c5477f6..d1b5a0580b 100644 --- a/src/bonsai/bonsai/bim/module/layer/operator.py +++ b/src/bonsai/bonsai/bim/module/layer/operator.py @@ -82,7 +82,7 @@ class EnableEditingLayer(bpy.types.Operator): def execute(self, context): props = tool.Layer.get_layer_props() props.layer_attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.layer), props.layer_attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.layer), props.layer_attributes) props.active_layer_id = self.layer return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/material/operator.py b/src/bonsai/bonsai/bim/module/material/operator.py index 6dd492aa33..eef35d519c 100644 --- a/src/bonsai/bonsai/bim/module/material/operator.py +++ b/src/bonsai/bonsai/bim/module/material/operator.py @@ -503,12 +503,12 @@ class EnableEditingAssignedMaterial(bpy.types.Operator): props.material_set_attributes.clear() if "Usage" in material.is_a(): - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( material, props.material_set_usage_attributes, callback=self.import_attributes_callback ) - bonsai.bim.helper.import_attributes2(material[0], props.material_set_attributes) + bonsai.bim.helper.import_attributes(material[0], props.material_set_attributes) else: - bonsai.bim.helper.import_attributes2(material, props.material_set_attributes) + bonsai.bim.helper.import_attributes(material, props.material_set_attributes) return {"FINISHED"} def import_attributes_callback( @@ -652,7 +652,7 @@ class EnableEditingMaterialSetItemProfile(bpy.types.Operator): self.props.active_material_set_item_id = self.material_set_item self.props.material_set_item_profile_attributes.clear() profile = tool.Ifc.get().by_id(self.material_set_item).Profile - bonsai.bim.helper.import_attributes2(profile, self.props.material_set_item_profile_attributes) + bonsai.bim.helper.import_attributes(profile, self.props.material_set_item_profile_attributes) return {"FINISHED"} @@ -713,7 +713,7 @@ class EnableEditingMaterialSetItem(bpy.types.Operator): self.props.material_set_item_material = str(material_set_item.Material.id()) self.props.material_set_item_attributes.clear() - bonsai.bim.helper.import_attributes2(material_set_item, self.props.material_set_item_attributes) + bonsai.bim.helper.import_attributes(material_set_item, self.props.material_set_item_attributes) if material_set_item.is_a("IfcMaterialProfile"): if material_set_item.Profile and material_set_item.Profile.ProfileName: diff --git a/src/bonsai/bonsai/bim/module/profile/operator.py b/src/bonsai/bonsai/bim/module/profile/operator.py index d7f91eaf60..99f47923e4 100644 --- a/src/bonsai/bonsai/bim/module/profile/operator.py +++ b/src/bonsai/bonsai/bim/module/profile/operator.py @@ -118,7 +118,7 @@ class EnableEditingProfile(bpy.types.Operator): def execute(self, context): props = tool.Profile.get_profile_props() props.profile_attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.profile), props.profile_attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.profile), props.profile_attributes) props.active_profile_id = self.profile return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/project/prop.py b/src/bonsai/bonsai/bim/module/project/prop.py index 68f70a87d7..f88a229904 100644 --- a/src/bonsai/bonsai/bim/module/project/prop.py +++ b/src/bonsai/bonsai/bim/module/project/prop.py @@ -96,7 +96,7 @@ def is_editing_project_library_update(self: "BIMProjectProperties", context: bpy self.editing_project_library_id = int(self.selected_project_library) project_library = library_file.by_id(int(self.selected_project_library)) self.project_library_attributes.clear() - bonsai.bim.helper.import_attributes2(project_library, self.project_library_attributes) + bonsai.bim.helper.import_attributes(project_library, self.project_library_attributes) self.parent_library = str(tool.Project.get_parent_library(project_library).id()) ProjectLibraryData.load() # Show edit icon in enum. return diff --git a/src/bonsai/bonsai/bim/module/structural/operator.py b/src/bonsai/bonsai/bim/module/structural/operator.py index bab7cffc1c..9840f87c1e 100644 --- a/src/bonsai/bonsai/bim/module/structural/operator.py +++ b/src/bonsai/bonsai/bim/module/structural/operator.py @@ -581,7 +581,7 @@ class EnableEditingStructuralLoadCase(bpy.types.Operator): self.props.active_load_case_id = self.load_case self.props.load_case_editing_type = "ATTRIBUTES" self.props.load_case_attributes.clear() - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( tool.Ifc.get().by_id(self.load_case), self.props.load_case_attributes, callback=self.import_attributes_callback, @@ -782,7 +782,7 @@ class EnableEditingStructuralLoad(bpy.types.Operator): def execute(self, context): props = tool.Structural.get_structural_props() props.structural_load_attributes.clear() - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( tool.Ifc.get().by_id(self.structural_load), props.structural_load_attributes ) props.active_structural_load_id = self.structural_load diff --git a/src/bonsai/bonsai/bim/module/style/operator.py b/src/bonsai/bonsai/bim/module/style/operator.py index 4436dc263e..918b06175a 100644 --- a/src/bonsai/bonsai/bim/module/style/operator.py +++ b/src/bonsai/bonsai/bim/module/style/operator.py @@ -753,7 +753,7 @@ class EnableEditingSurfaceStyle(bpy.types.Operator): if attributes is not None: attributes.clear() - bonsai.bim.helper.import_attributes2(surface_style or self.ifc_class, attributes, callback) + bonsai.bim.helper.import_attributes(surface_style or self.ifc_class, attributes, callback) material = tool.Ifc.get_object(style) msprops = tool.Style.get_material_style_props(material) diff --git a/src/bonsai/bonsai/bim/module/system/operator.py b/src/bonsai/bonsai/bim/module/system/operator.py index 6873131af1..a3554b0dcf 100644 --- a/src/bonsai/bonsai/bim/module/system/operator.py +++ b/src/bonsai/bonsai/bim/module/system/operator.py @@ -422,7 +422,7 @@ class EnableEditingZone(bpy.types.Operator): def execute(self, context): props = tool.System.get_zone_props() props.attributes.clear() - bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.zone), props.attributes) + bonsai.bim.helper.import_attributes(tool.Ifc.get().by_id(self.zone), props.attributes) props.is_editing = self.zone return {"FINISHED"} diff --git a/src/bonsai/bonsai/tool/attribute.py b/src/bonsai/bonsai/tool/attribute.py index 3113172bd2..0515edc04c 100644 --- a/src/bonsai/bonsai/tool/attribute.py +++ b/src/bonsai/bonsai/tool/attribute.py @@ -68,7 +68,7 @@ class Attribute(bonsai.core.tool.Attribute): @classmethod def import_entity_attributes(cls, entity: ifcopenshell.entity_instance) -> None: props = cls.get_explorer_props() - helper.import_attributes2(entity, props.entity_attributes) + helper.import_attributes(entity, props.entity_attributes) @classmethod def export_entity_attributes(cls) -> dict[str, Any]: diff --git a/src/bonsai/bonsai/tool/context.py b/src/bonsai/bonsai/tool/context.py index 98f791f0a2..c1582cd37f 100644 --- a/src/bonsai/bonsai/tool/context.py +++ b/src/bonsai/bonsai/tool/context.py @@ -72,7 +72,7 @@ class Context(bonsai.core.tool.Context): assert prop prop.data_type = "string" - bonsai.bim.helper.import_attributes2(context, props.context_attributes, callback) + bonsai.bim.helper.import_attributes(context, props.context_attributes, callback) @classmethod def clear_context(cls) -> None: diff --git a/src/bonsai/bonsai/tool/cost.py b/src/bonsai/bonsai/tool/cost.py index fee7320503..ba34d33fa7 100644 --- a/src/bonsai/bonsai/tool/cost.py +++ b/src/bonsai/bonsai/tool/cost.py @@ -130,7 +130,7 @@ class Cost(bonsai.core.tool.Cost): props = cls.get_cost_props() props.cost_schedule_attributes.clear() - bonsai.bim.helper.import_attributes2(cost_schedule, props.cost_schedule_attributes, callback=special_import) + bonsai.bim.helper.import_attributes(cost_schedule, props.cost_schedule_attributes, callback=special_import) @classmethod def enable_editing_cost_items(cls, cost_schedule: ifcopenshell.entity_instance) -> None: @@ -236,7 +236,7 @@ class Cost(bonsai.core.tool.Cost): def load_cost_item_attributes(cls, cost_item: ifcopenshell.entity_instance) -> None: props = cls.get_cost_props() props.cost_item_attributes.clear() - bonsai.bim.helper.import_attributes2(cost_item, props.cost_item_attributes) + bonsai.bim.helper.import_attributes(cost_item, props.cost_item_attributes) @classmethod def disable_editing_cost_item(cls) -> None: @@ -381,7 +381,7 @@ class Cost(bonsai.core.tool.Cost): def load_cost_item_quantity_attributes(cls, physical_quantity: ifcopenshell.entity_instance) -> None: props = cls.get_cost_props() props.quantity_attributes.clear() - bonsai.bim.helper.import_attributes2(physical_quantity, props.quantity_attributes) + bonsai.bim.helper.import_attributes(physical_quantity, props.quantity_attributes) @classmethod def enable_editing_cost_item_values(cls, cost_item: ifcopenshell.entity_instance) -> None: @@ -460,7 +460,7 @@ class Cost(bonsai.core.tool.Cost): break return True - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( cost_value, props.cost_value_attributes, callback=import_attributes_callback ) diff --git a/src/bonsai/bonsai/tool/document.py b/src/bonsai/bonsai/tool/document.py index 5d1e5eee54..3a2f89aa94 100644 --- a/src/bonsai/bonsai/tool/document.py +++ b/src/bonsai/bonsai/tool/document.py @@ -94,7 +94,7 @@ class Document(bonsai.core.tool.Document): return False import_callback = callback if document.is_a("IfcDocumentReference") else None - bonsai.bim.helper.import_attributes2(document, props.document_attributes, callback=import_callback) + bonsai.bim.helper.import_attributes(document, props.document_attributes, callback=import_callback) @classmethod def import_project_documents(cls) -> None: diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index 2a339e4cf1..abc3b5b32e 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -1075,7 +1075,7 @@ class Drawing(bonsai.core.tool.Drawing): for ifc_literal in cls.get_text_literal(obj, return_list=True): literal_props = props.literals.add() - bonsai.bim.helper.import_attributes2(ifc_literal, literal_props.attributes) + bonsai.bim.helper.import_attributes(ifc_literal, literal_props.attributes) box_alignment_mask = [False] * 9 position_string = literal_props.attributes["BoxAlignment"].string_value diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index 70c564b4a5..6a2abf009b 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -1802,7 +1802,7 @@ class Geometry(bonsai.core.tool.Geometry): return False return None - bonsai.bim.helper.import_attributes2(item, props.item_attributes, callback=callback) + bonsai.bim.helper.import_attributes(item, props.item_attributes, callback=callback) profile = None if item.is_a("IfcSweptAreaSolid"): diff --git a/src/bonsai/bonsai/tool/georeference.py b/src/bonsai/bonsai/tool/georeference.py index 467d23dfc1..7b56adbab2 100644 --- a/src/bonsai/bonsai/tool/georeference.py +++ b/src/bonsai/bonsai/tool/georeference.py @@ -81,7 +81,7 @@ class Georeference(bonsai.core.tool.Georeference): for context in tool.Ifc.get().by_type("IfcGeometricRepresentationContext", include_subtypes=False): if context.HasCoordinateOperation: projected_crs = context.HasCoordinateOperation[0].TargetCRS - bonsai.bim.helper.import_attributes2(projected_crs, props.projected_crs, callback=callback) + bonsai.bim.helper.import_attributes(projected_crs, props.projected_crs, callback=callback) return @classmethod @@ -153,9 +153,7 @@ class Georeference(bonsai.core.tool.Georeference): for context in tool.Ifc.get().by_type("IfcGeometricRepresentationContext", include_subtypes=False): if context.HasCoordinateOperation: coordinate_operation = context.HasCoordinateOperation[0] - bonsai.bim.helper.import_attributes2( - coordinate_operation, props.coordinate_operation, callback=callback - ) + bonsai.bim.helper.import_attributes(coordinate_operation, props.coordinate_operation, callback=callback) return @classmethod diff --git a/src/bonsai/bonsai/tool/library.py b/src/bonsai/bonsai/tool/library.py index f968a21625..e16a159b00 100644 --- a/src/bonsai/bonsai/tool/library.py +++ b/src/bonsai/bonsai/tool/library.py @@ -61,13 +61,13 @@ class Library(bonsai.core.tool.Library): def import_library_attributes(cls, library: ifcopenshell.entity_instance) -> None: props = cls.get_library_props() props.library_attributes.clear() - bonsai.bim.helper.import_attributes2(library, props.library_attributes) + bonsai.bim.helper.import_attributes(library, props.library_attributes) @classmethod def import_reference_attributes(cls, reference: ifcopenshell.entity_instance) -> None: props = cls.get_library_props() props.reference_attributes.clear() - bonsai.bim.helper.import_attributes2(reference, props.reference_attributes) + bonsai.bim.helper.import_attributes(reference, props.reference_attributes) @classmethod def import_references(cls, library: ifcopenshell.entity_instance) -> None: diff --git a/src/bonsai/bonsai/tool/material.py b/src/bonsai/bonsai/tool/material.py index 369c5e7d79..2f2c916299 100644 --- a/src/bonsai/bonsai/tool/material.py +++ b/src/bonsai/bonsai/tool/material.py @@ -170,7 +170,7 @@ class Material(bonsai.core.tool.Material): def load_material_attributes(cls, material: ifcopenshell.entity_instance) -> None: props = tool.Material.get_material_props() props.material_attributes.clear() - bonsai.bim.helper.import_attributes2(material, props.material_attributes) + bonsai.bim.helper.import_attributes(material, props.material_attributes) @classmethod def enable_editing_material(cls, material: ifcopenshell.entity_instance) -> None: diff --git a/src/bonsai/bonsai/tool/owner.py b/src/bonsai/bonsai/tool/owner.py index 289ebe75b9..615fd64db8 100644 --- a/src/bonsai/bonsai/tool/owner.py +++ b/src/bonsai/bonsai/tool/owner.py @@ -97,7 +97,7 @@ class Owner(bonsai.core.tool.Owner): for line in data[name] or []: collection.add().name = line - bonsai.bim.helper.import_attributes2(address, props.address_attributes, callback) + bonsai.bim.helper.import_attributes(address, props.address_attributes, callback) @classmethod def clear_address(cls) -> None: @@ -154,7 +154,7 @@ class Owner(bonsai.core.tool.Owner): organisation = tool.Ifc.get().by_id(props.active_organisation_id) props.organisation_attributes.clear() - bonsai.bim.helper.import_attributes2(organisation, props.organisation_attributes) + bonsai.bim.helper.import_attributes(organisation, props.organisation_attributes) @classmethod def clear_organisation(cls) -> None: @@ -209,7 +209,7 @@ class Owner(bonsai.core.tool.Owner): for name_ in data[name] or []: collection.add().name = name_ or "" - bonsai.bim.helper.import_attributes2(person, props.person_attributes, callback) + bonsai.bim.helper.import_attributes(person, props.person_attributes, callback) @classmethod def clear_person(cls) -> None: @@ -253,7 +253,7 @@ class Owner(bonsai.core.tool.Owner): role = cls.get_role() props = cls.get_owner_props() props.role_attributes.clear() - bonsai.bim.helper.import_attributes2(role, props.role_attributes) + bonsai.bim.helper.import_attributes(role, props.role_attributes) @classmethod def clear_role(cls) -> None: @@ -279,7 +279,7 @@ class Owner(bonsai.core.tool.Owner): def import_actor_attributes(cls, actor: ifcopenshell.entity_instance) -> None: props = cls.get_owner_props() props.actor_attributes.clear() - bonsai.bim.helper.import_attributes2(actor, props.actor_attributes) + bonsai.bim.helper.import_attributes(actor, props.actor_attributes) @classmethod def clear_actor(cls) -> None: @@ -329,7 +329,7 @@ class Owner(bonsai.core.tool.Owner): new.enum_value = str(data["ApplicationDeveloper"].id()) return True - bonsai.bim.helper.import_attributes2(application, props.application_attributes, callback) + bonsai.bim.helper.import_attributes(application, props.application_attributes, callback) @classmethod def export_application_attributes(cls) -> dict[str, Any]: diff --git a/src/bonsai/bonsai/tool/resource.py b/src/bonsai/bonsai/tool/resource.py index 27fc8ea7ed..80a3cbe6b2 100644 --- a/src/bonsai/bonsai/tool/resource.py +++ b/src/bonsai/bonsai/tool/resource.py @@ -98,7 +98,7 @@ class Resource(bonsai.core.tool.Resource): @classmethod def load_resource_attributes(cls, resource: ifcopenshell.entity_instance) -> None: - bonsai.bim.helper.import_attributes2(resource, bpy.context.scene.BIMResourceProperties.resource_attributes) + bonsai.bim.helper.import_attributes(resource, bpy.context.scene.BIMResourceProperties.resource_attributes) @classmethod def enable_editing_resource(cls, resource: ifcopenshell.entity_instance) -> None: @@ -136,7 +136,7 @@ class Resource(bonsai.core.tool.Resource): prop.string_value = "" if prop.is_null else ifcdateutils.datetime2ifc(data[name], "IfcDuration") return True - bonsai.bim.helper.import_attributes2( + bonsai.bim.helper.import_attributes( resource_time, bpy.context.scene.BIMResourceProperties.resource_time_attributes, callback ) @@ -231,7 +231,7 @@ class Resource(bonsai.core.tool.Resource): return True props = bpy.context.scene.BIMResourceProperties - bonsai.bim.helper.import_attributes2(cost_value, props.cost_value_attributes, callback) + bonsai.bim.helper.import_attributes(cost_value, props.cost_value_attributes, callback) @classmethod def enable_editing_cost_value_attributes(cls, cost_value: ifcopenshell.entity_instance) -> None: @@ -282,7 +282,7 @@ class Resource(bonsai.core.tool.Resource): props = bpy.context.scene.BIMResourceProperties props.quantity_attributes.clear() props.is_editing_quantity = True - bonsai.bim.helper.import_attributes2(resource_quantity, props.quantity_attributes) + bonsai.bim.helper.import_attributes(resource_quantity, props.quantity_attributes) @classmethod def disable_editing_resource_quantity(cls) -> None: diff --git a/src/bonsai/bonsai/tool/sequence.py b/src/bonsai/bonsai/tool/sequence.py index bafbe74969..36de10d157 100644 --- a/src/bonsai/bonsai/tool/sequence.py +++ b/src/bonsai/bonsai/tool/sequence.py @@ -112,7 +112,7 @@ class Sequence(bonsai.core.tool.Sequence): props = cls.get_work_plan_props() props.work_plan_attributes.clear() - bonsai.bim.helper.import_attributes2(work_plan, props.work_plan_attributes, callback) + bonsai.bim.helper.import_attributes(work_plan, props.work_plan_attributes, callback) @classmethod def enable_editing_work_plan(cls, work_plan: Union[ifcopenshell.entity_instance, None]) -> None: @@ -163,7 +163,7 @@ class Sequence(bonsai.core.tool.Sequence): props = cls.get_work_schedule_props() props.work_schedule_attributes.clear() - bonsai.bim.helper.import_attributes2(work_schedule, props.work_schedule_attributes, callback) + bonsai.bim.helper.import_attributes(work_schedule, props.work_schedule_attributes, callback) @classmethod def enable_editing_work_schedule(cls, work_schedule: ifcopenshell.entity_instance) -> None: @@ -382,7 +382,7 @@ class Sequence(bonsai.core.tool.Sequence): def load_task_attributes(cls, task: ifcopenshell.entity_instance) -> None: props = cls.get_work_schedule_props() props.task_attributes.clear() - bonsai.bim.helper.import_attributes2(task, props.task_attributes) + bonsai.bim.helper.import_attributes(task, props.task_attributes) @classmethod def enable_editing_task_attributes(cls, task: ifcopenshell.entity_instance) -> None: @@ -424,7 +424,7 @@ class Sequence(bonsai.core.tool.Sequence): props.task_time_attributes.clear() props.durations_attributes.clear() - bonsai.bim.helper.import_attributes2(task_time, props.task_time_attributes, callback) + bonsai.bim.helper.import_attributes(task_time, props.task_time_attributes, callback) @classmethod def enable_editing_task_time(cls, task: ifcopenshell.entity_instance) -> None: @@ -562,7 +562,7 @@ class Sequence(bonsai.core.tool.Sequence): def load_work_calendar_attributes(cls, work_calendar: ifcopenshell.entity_instance) -> dict[str, Any]: props = bpy.context.scene.BIMWorkCalendarProperties props.work_calendar_attributes.clear() - return bonsai.bim.helper.import_attributes2(work_calendar, props.work_calendar_attributes) + return bonsai.bim.helper.import_attributes(work_calendar, props.work_calendar_attributes) @classmethod def enable_editing_work_calendar(cls, work_calendar: ifcopenshell.entity_instance) -> None: @@ -582,7 +582,7 @@ class Sequence(bonsai.core.tool.Sequence): props = bpy.context.scene.BIMWorkCalendarProperties props.work_time_attributes.clear() - bonsai.bim.helper.import_attributes2(work_time, props.work_time_attributes) + bonsai.bim.helper.import_attributes(work_time, props.work_time_attributes) @classmethod def enable_editing_work_time(cls, work_time: ifcopenshell.entity_instance) -> None: @@ -713,7 +713,7 @@ class Sequence(bonsai.core.tool.Sequence): def load_rel_sequence_attributes(cls, rel_sequence: ifcopenshell.entity_instance) -> None: props = cls.get_work_schedule_props() props.sequence_attributes.clear() - bonsai.bim.helper.import_attributes2(rel_sequence, props.sequence_attributes) + bonsai.bim.helper.import_attributes(rel_sequence, props.sequence_attributes) @classmethod def enable_editing_rel_sequence_attributes(cls, rel_sequence: ifcopenshell.entity_instance) -> None: @@ -738,7 +738,7 @@ class Sequence(bonsai.core.tool.Sequence): return True props.lag_time_attributes.clear() - bonsai.bim.helper.import_attributes2(lag_time, props.lag_time_attributes, callback) + bonsai.bim.helper.import_attributes(lag_time, props.lag_time_attributes, callback) @classmethod def enable_editing_sequence_lag_time(cls, rel_sequence: ifcopenshell.entity_instance) -> None: diff --git a/src/bonsai/bonsai/tool/style.py b/src/bonsai/bonsai/tool/style.py index f8ead02ecb..35399e7811 100644 --- a/src/bonsai/bonsai/tool/style.py +++ b/src/bonsai/bonsai/tool/style.py @@ -560,7 +560,7 @@ class Style(bonsai.core.tool.Style): props = cls.get_style_props() attributes = props.attributes attributes.clear() - bonsai.bim.helper.import_attributes2(style, attributes) + bonsai.bim.helper.import_attributes(style, attributes) @classmethod def has_blender_external_style(cls, style_elements: dict[str, ifcopenshell.entity_instance]) -> bool: diff --git a/src/bonsai/bonsai/tool/system.py b/src/bonsai/bonsai/tool/system.py index ce9387a9e9..277c61f44b 100644 --- a/src/bonsai/bonsai/tool/system.py +++ b/src/bonsai/bonsai/tool/system.py @@ -151,7 +151,7 @@ class System(bonsai.core.tool.System): def import_system_attributes(cls, system: ifcopenshell.entity_instance) -> None: props = cls.get_system_props() props.system_attributes.clear() - bonsai.bim.helper.import_attributes2(system, props.system_attributes) + bonsai.bim.helper.import_attributes(system, props.system_attributes) @classmethod def get_systems(cls) -> list[ifcopenshell.entity_instance]: diff --git a/src/bonsai/bonsai/tool/unit.py b/src/bonsai/bonsai/tool/unit.py index dc330e479b..16ec9db2fb 100644 --- a/src/bonsai/bonsai/tool/unit.py +++ b/src/bonsai/bonsai/tool/unit.py @@ -120,7 +120,7 @@ class Unit(bonsai.core.tool.Unit): return True props.unit_attributes.clear() - bonsai.bim.helper.import_attributes2(unit, props.unit_attributes, callback=callback) + bonsai.bim.helper.import_attributes(unit, props.unit_attributes, callback=callback) @classmethod def import_units(cls) -> None: