diff --git a/src/ansys/aedt/core/modeler/cad/primitives.py b/src/ansys/aedt/core/modeler/cad/primitives.py index d261fd77918..f648c6d1d27 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives.py +++ b/src/ansys/aedt/core/modeler/cad/primitives.py @@ -964,7 +964,7 @@ def cleanup_solids(self): all_objects = self.object_names all_unclassified = self.unclassified_names all_objs = all_objects + all_unclassified - if len(all_objs) != len(self._object_names_to_ids): + if sorted(all_objs) != sorted(list(self._object_names_to_ids.keys())): for old_id, obj in self.objects.items(): if obj.name in all_objs: # Check if ID can change in boolean operations diff --git a/tests/system/general/test_07_Object3D.py b/tests/system/general/test_07_Object3D.py index 12965ac07bf..a113e9f5c6c 100644 --- a/tests/system/general/test_07_Object3D.py +++ b/tests/system/general/test_07_Object3D.py @@ -129,6 +129,16 @@ def test_01_delete_object(self): assert not self.aedtapp.modeler[name] assert not o.__dict__ + # 1 body and 1 sheet + o1 = self.aedtapp.modeler.create_circle(orientation=0, origin=[0, 0, 0], radius=5) + name1 = o1.name + o2 = self.aedtapp.modeler.create_box(origin=[0, 0, 0], sizes=[10, 10, 10], material="vacuum") + name2 = o2.name + o2.delete() + assert not self.aedtapp.modeler[name2] + o1.delete() + assert not self.aedtapp.modeler[name1] + def test_01_subtract_object(self): o1 = self.create_copper_box("subtract_box") o2 = self.create_copper_sphere("subtract_sphere")