diff --git a/pyaedt/modeler/cad/Primitives.py b/pyaedt/modeler/cad/Primitives.py index c34dde58a0b..67a284f0879 100644 --- a/pyaedt/modeler/cad/Primitives.py +++ b/pyaedt/modeler/cad/Primitives.py @@ -1103,13 +1103,13 @@ def get_objects_by_material(self, material=None): if material is not None: for obj in self.object_list: if obj and ("[" in obj.material_name or "(" in obj.material_name) and obj.object_type == "Solid": - material = ( + found_material = ( self._app.odesign.GetChildObject("3D Modeler") .GetChildObject(obj.name) .GetPropEvaluatedValue("Material") .lower() ) - if material.lower() == material: + if found_material == material.lower(): obj_lst.append(obj) elif obj and (obj.material_name == material or obj.material_name == material.lower()): obj_lst.append(obj)