From d28b8d380c25b83beb7299a63b0293e381d65a72 Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro <77293250+maxcapodi78@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:48:29 +0100 Subject: [PATCH] FIX: assign_em_losses in mechanical.py (#5581) Co-authored-by: Samuel Lopez <85613111+Samuelopez-ansys@users.noreply.github.com> --- src/ansys/aedt/core/mechanical.py | 2 +- src/ansys/aedt/core/modeler/cad/primitives_3d.py | 2 +- src/ansys/aedt/core/visualization/plot/pyvista.py | 8 ++++---- src/ansys/aedt/core/visualization/post/post_common_3d.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ansys/aedt/core/mechanical.py b/src/ansys/aedt/core/mechanical.py index 06dda2697ef..26f26ad2e79 100644 --- a/src/ansys/aedt/core/mechanical.py +++ b/src/ansys/aedt/core/mechanical.py @@ -236,7 +236,7 @@ def assign_em_losses( if not assignment: allObjects = self.modeler.object_names else: - allObjects = assignment[:] + allObjects = surface_objects + assignment[:] surfaces = surface_objects if map_frequency: intr = [map_frequency] diff --git a/src/ansys/aedt/core/modeler/cad/primitives_3d.py b/src/ansys/aedt/core/modeler/cad/primitives_3d.py index 87271bf616d..af17422ac1a 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives_3d.py +++ b/src/ansys/aedt/core/modeler/cad/primitives_3d.py @@ -199,7 +199,7 @@ def create_cylinder(self, orientation, origin, radius, height, num_sides=0, name Returns ------- - bool or :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` + :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d` or bool 3D object or ``False`` if it fails. References diff --git a/src/ansys/aedt/core/visualization/plot/pyvista.py b/src/ansys/aedt/core/visualization/plot/pyvista.py index 50c8edddd3e..f4fa4ec0315 100644 --- a/src/ansys/aedt/core/visualization/plot/pyvista.py +++ b/src/ansys/aedt/core/visualization/plot/pyvista.py @@ -992,10 +992,10 @@ def _read_mesh_files(self, read_frames=False): cad._cached_polydata = filedata color_cad = [i / 255 for i in cad.color] cad._cached_mesh = self.pv.add_mesh(cad._cached_polydata, color=color_cad, opacity=cad.opacity) - if self.meshes: - self.meshes += cad._cached_polydata - else: - self.meshes = cad._cached_polydata + # if self.meshes: + # self.meshes += cad._cached_polydata + # else: + # self.meshes = cad._cached_polydata obj_to_iterate = [i for i in self._fields] if read_frames: for i in self.frames: diff --git a/src/ansys/aedt/core/visualization/post/post_common_3d.py b/src/ansys/aedt/core/visualization/post/post_common_3d.py index 54f24db386a..608e31e2382 100644 --- a/src/ansys/aedt/core/visualization/post/post_common_3d.py +++ b/src/ansys/aedt/core/visualization/post/post_common_3d.py @@ -3437,7 +3437,7 @@ def plot_field( Returns ------- - :class:`ansys.aedt.core.generic.plot.ModelPlotter` + :class:`ansys.aedt.core.visualization.plot.pyvista.ModelPlotter` Model Object. """ intrinsics = self._app._check_intrinsics(intrinsics, setup=setup)