From d5ad42d4158643722f330f2d9bd28d9926c2b021 Mon Sep 17 00:00:00 2001 From: Beppo <53090100+beppo-dd@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:54:10 +0200 Subject: [PATCH] Result._plot_point_scalars: fix screenshot function on Windows OS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pyvista\plotting\plotting.py:4882: On Windows OS "in the event that the user hits the exit-button on the GUI then it must be finalized and deleted as accessing it will kill the kernel... proper screenshots cannot be saved if this happens" Therefore, when you used ´_plot_point_scalars(..., screenshot=...)´, you got at ansys\mapdl\reader\rst.py:2830: ´RuntimeError: This plotter is closed and unable to save a screenshot.´ The only solution is, to pass the ´screenshot´ argument to ´plotter.show´ as done in this patch. --- ansys/mapdl/reader/rst.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ansys/mapdl/reader/rst.py b/ansys/mapdl/reader/rst.py index afcea604..403ad33e 100644 --- a/ansys/mapdl/reader/rst.py +++ b/ansys/mapdl/reader/rst.py @@ -2819,21 +2819,18 @@ def q_callback(): plotter.close() cpos = plotter.camera_position - elif screenshot: - cpos = plotter.show(auto_close=False, interactive=interactive, - window_size=window_size, - full_screen=full_screen, - **show_kwargs) - if screenshot is True: - img = plotter.screenshot() - else: - plotter.screenshot(screenshot) - plotter.close() + elif screenshot is True: + cpos, img = plotter.show(interactive=interactive, + window_size=window_size, + full_screen=full_screen, + screenshot=screenshot, + **show_kwargs) else: cpos = plotter.show(interactive=interactive, window_size=window_size, full_screen=full_screen, + screenshot=screenshot, **show_kwargs) if screenshot is True: