.to_list() enriched method doesn't work #1395
-
Dear All, I'm studying ANSYS pyMAPDL, following the tutorial https://www.youtube.com/watch?v=szHmg-xW_hM&t=1s It was understood from both the tutorial code itself and pyMAPDL documentation that prnsol returns a str object, but it has the enriched method to_list() which allows the output to be exported to list format. https://mapdldocs.pyansys.com/user_guide/post.html However, when I run the following line from the sample code, it just reports attribute error mapdl_s_1_list = mapdl.prnsol('S', 'PRIN',).to_list() AttributeError: 'str' object has no attribute 'to_list' If I print out the Would like to know if there is a quick fix to make the enriched method work? Thanks! hawkoli1987 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hi @hawkoli1987 I have run: >>> from ansys.mapdl.core import launch_mapdl
>>> from ansys.mapdl.core.examples import vmfiles
>>> mapdl = launch_mapdl()
>>> mapdl.input(vmfiles['vm271'])
>>> mapdl.post1()
>>> mapdl.set('last')
>>> mapdl.prnsol('temp').to_list()
[[1.0, 700.0]] and it works. Which version of PyMAPDL are you running?? I guess the best will be for you to create an issue and fill all the text boxes in the issue. |
Beta Was this translation helpful? Give feedback.
-
The python -m pip install -U ansys-mapdl-core |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi hawkoli1987
You are installing from the git source, I would either:
* Upgrade the package using ``pip install -U ansys-mapdl-core``
* Create a new environment and install PyMAPDL using ``pip install ansys-mapdl-core``.
Kind regards,
|
Beta Was this translation helpful? Give feedback.
The
to_list
feature was introduced in v0.60.7. As @mikerife mentioned, please update your PyMAPDL using: