PyCharm is an IDE commonly used for Python Code. In this article, we will see how we can configure PyCharm® to work with Simcenter Amesim API functions.
To launch PyCharm for Simcenter Amesim usage, a customized $AME should be set to be recognized by this one.
To do so, write the bellows instruction into a batch file and adapt it to your PyCharm.exe installation (here we have an example with the PyCharm Community Edition 2021.2):
REM set QT_PLUGIN_PATH=%AME%\scripting\python\win64
"C:\Program Files\JetBrains\PyCharm Community Edition 2021.2\bin\pycharm64.exe" Then you can save it under the name you want. To start PyCharm with Simcenter Amesim, you have first to open a command window in Simcenter Amesim using "Tools>Python command interpreter" Exit the python process with exit() (or you can use the keybord shortcut "ctrl+Z"): Now you can lauch the batch file you have created (in this case we named it PyCharmLaucher.bat): Once PyCharm is started, you have to configure your project to use properly PyCharme. Select "FIle>New project". Set a custom name when defining the location and in Project interpreter click on Existing interpreter. Then click on ... and a new window shall open. Here select System Interpreter on the left side. If you have well lauched PyCharm from Amesim, the python.exe located in your Amesim folder shall be available in the Interpreter list. Else you can find into the Simcenter Amesim installation location file %AME%\sys\python\win64\python.exe. Click on Ok then click on Create.