Installation
Install the latest Prime Mesh Python client library from Ansys Customer Site.Run a Python script in batch
To run a PyPrimeMesh Python script directly on the server from a Linux or Windows console: Here is a Windows code example to run a Python script directly from the command line:Run a Python script in batch on HPC job scheduler
To run the PyPrimeMesh Python script with SLURM HPC job scheduler while launching the Ansys Prime Server, use the following argument:Accessing Prime Mesh Python client library through Visual Studio Code (VS Code)
You can access Prime Mesh Python client through VS code and work on it as follows:- Install 2024R1 Service Pack 1 package or later.
- Close all instances of VS Code.
- Create a new folder in your machine for your work.
- Open VS Code.
- Click File > Open Folder and select the newly created folder from the location.
- Install Microsoft Python Extension in VS Code if you have not installed it.
- In the VS Code, click the Search bar and select Show and Run Commands > Python: Select Interpreter.
-
In Windows OS, click Enter Interpreter Path and click Find to select runPrime.bat as
interpreter from the latest package installed location.
Example: C:\Program Files\ANSYS Inc\v261\meshing\Prime\runPrime.bat In Linux OS, press Ctrl + Shift + P to view the search bar and type Python: Select Interpreter and select it. Example:/ANSYS_Inc/v261/meshing/Prime/runPrime.sh
- In VS Code, create a new folder with name .vscode.
-
Create a settings.json file with the following content:
In Windows OS,
In Linux OS,Note: Environment variables do not work in the above file. Hence, provide full paths.
- Run a simple test file to ensure that the installed build works.