I want to use PyMAPDL functions in AnsysWorkBench.

kanetsuki
kanetsuki Member Posts: 3
First Comment
**

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

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 206
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓

    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=cpython

    But, COMBIN39 can still be added via MAPDL command objects. Please clarify if you are facing any challenges.

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 316
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓

    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.

Answers

  • kanetsuki
    kanetsuki Member Posts: 3
    First Comment
    **

    After much trial and error, the APDL command block was added with pyMechanical and executed.