diff --git a/src/ansys/geometry/core/designer/body.py b/src/ansys/geometry/core/designer/body.py index 23056ec313..d1738a3fde 100644 --- a/src/ansys/geometry/core/designer/body.py +++ b/src/ansys/geometry/core/designer/body.py @@ -1097,7 +1097,7 @@ def copy(self, parent: "Component", name: str = None) -> "Body": # noqa: D102 response.master_id, copy_name, self._grpc_client, is_surface=self.is_surface ) parent._master_component.part.bodies.append(tb) - parent.__clear_cached_bodies() + parent._clear_cached_bodies() body_id = f"{parent.id}/{tb.id}" if parent.parent_component else tb.id return Body(body_id, response.name, parent, tb) diff --git a/src/ansys/geometry/core/designer/component.py b/src/ansys/geometry/core/designer/component.py index 1e9d232f18..fd8bb27360 100644 --- a/src/ansys/geometry/core/designer/component.py +++ b/src/ansys/geometry/core/designer/component.py @@ -240,7 +240,7 @@ def __init__( self._master_component.occurrences.append(self) - def __clear_cached_bodies(self) -> None: + def _clear_cached_bodies(self) -> None: """Clear the cached bodies.""" if "bodies" in self.__dict__: del self.__dict__["bodies"] @@ -515,7 +515,7 @@ def extrude_sketch( response = self._bodies_stub.CreateExtrudedBody(request) tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @min_backend_version(24, 2, 0) @@ -565,7 +565,7 @@ def sweep_sketch( response = self._bodies_stub.CreateSweepingProfile(request) tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @min_backend_version(24, 2, 0) @@ -613,7 +613,7 @@ def sweep_chain( response = self._bodies_stub.CreateSweepingChain(request) tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @min_backend_version(24, 2, 0) @@ -729,7 +729,7 @@ def extrude_face( tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @protect_grpc @@ -763,7 +763,7 @@ def create_sphere(self, name: str, center: Point3D, radius: Distance) -> Body: response = self._bodies_stub.CreateSphereBody(request) tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @protect_grpc @@ -830,7 +830,7 @@ def create_body_from_loft_profile( response = self._bodies_stub.CreateExtrudedBodyFromLoftProfiles(request) tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=False) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @protect_grpc @@ -868,7 +868,7 @@ def create_surface(self, name: str, sketch: Sketch) -> Body: tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @protect_grpc @@ -909,7 +909,7 @@ def create_surface_from_face(self, name: str, face: Face) -> Body: tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=True) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @protect_grpc @@ -950,7 +950,7 @@ def create_body_from_surface(self, name: str, trimmed_surface: TrimmedSurface) - tb = MasterBody(response.master_id, name, self._grpc_client, is_surface=response.is_surface) self._master_component.part.bodies.append(tb) - self.__clear_cached_bodies() + self._clear_cached_bodies() return Body(response.id, response.name, self, tb) @check_input_types