I want to use PyMAPDL functions in AnsysWorkBench.
I know that MAPDL is available in command blocks within Workbench, but is it possible to use PyMAPDL?
I want to use some MAPDL commands for special element insertion in Ansys-MechanicalWB.
For example, adding a CONBIN39.
Is it possible to use PyMAPDL within Workbench?
Best Answers
-
Hi @kanetsuki , it might be possible by using Cpython from Ansys Installation using Subprocess. But you would need to install PyMAPDL in this Cpython.
This post shows the path of Cpython from WB installation
https://discuss.ansys.com/discussion/1673/how-can-i-get-the-path-to-the-cpython-executable-in-the-wb-installation-folder?utm_source=community-search&utm_medium=organic-search&utm_term=cpythonBut, COMBIN39 can still be added via MAPDL command objects. Please clarify if you are facing any challenges.
0 -
In theory, you can run pyMAPDL from within Mechanical, but I do not think that you will be able to use it the way that you intend. Until you click 'Solve' in Mechanical, MAPDL is not running. When you start a solve in Mechanical, Mechanical will write an APDL input file and then run MAPDL in batch mode using the APDL input file to "drive" MAPDL from within the process. pyMAPDL allows users to start/stop/control an MAPDL process from outside of the process.
Can you share the pyMAPDL script that you are hoping to run from WB/Mechanical? This might help clarify what you are trying to do.
0
Answers
-
After much trial and error, the APDL command block was added with pyMechanical and executed.
0