MAPDLTheme not in ansys-mapdl-core

RvdH
RvdH Member Posts: 10
First Anniversary First Comment
**

I would like to run the example: https://mapdl.docs.pyansys.com/version/stable/examples/extended_examples/gui/executable.html
but after installing modules PySide6, pyvistaqt and ansys-mapdl-core and running the complete script I get an error:
ImportError: cannot import name 'MapdlTheme' from 'ansys.mapdl.core'
The line that cases the error is:
from ansys.mapdl.core import Mapdl, MapdlTheme, launch_mapdl
The installed ansys-mapdl-core is version 0.68 (latest stable version).
There is no MapdlTheme in the site-packages directory, so what should be done to get the example script running?

Tagged:

Answers

  • James Derrick
    James Derrick Administrator, Employee Posts: 275
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Hi @RvdH I think there's an error in that example; from the latest code I think MapdlTheme is in ansys.mapdl.core.plotting and if you run

    from ansys.mapdl.core.plotting import MapdlTheme

    that should work.

  • RvdH
    RvdH Member Posts: 10
    First Anniversary First Comment
    **

    Thanks James. This solves part of the problem. Now I get the next error:
    Traceback (most recent call last):
    File "D:........\Create_a_GUI_app_in_Python_with_PySide6\gui_app.py", line 232, in _run_preprocessor
    preprocessing_plotter.renderer
    AttributeError: 'MapdlPlotter' object has no attribute 'renderer'

    The line:
    self._preprocessing_plotter = QtInteractor(theme=MapdlTheme())
    runs well now, but aparently there's still some functionality missing, which is a renderer. As far as I can tell from the code this is the last part that could cause problems. Could you help me with this as well?

  • James Derrick
    James Derrick Administrator, Employee Posts: 275
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Understood @RvdH I've created an issue (not 3) as you can see above, so hopefully someone will be able to help you with that. :)