I've tried to change the Python interpreter to the python.exe in the Bentley folder but an error says "spyder-kernels not installed". I've tried to create another environment and install this spyder-kernels but when I changed the Python interpreter it still didn't work. My guess is that I have to connect the Bentley python.exe and the spyder-kernels somehow. Can anyone please provide some help? Thanks!
In case nr.1: Make sure you are in your correct working directory for future plaxis scripts. In your IDE, you have to change the Python interpreter to the one that comes with Plaxis, usually found in the C:\ProgramData\Bentley\Geotechnical\PLAXIS Python Distribution V2\python folder. Next you have to connect to the Plaxis API.Create an empty python file "example.py" in your working directory, then type this:
In case nr.2: You have to go to your Plaxis input program then Expert > Python > Configure Python interpreter > Choose your interpreter and install the required components as you will not be otherwise able to use the plxscripting module. After that is just the same as in case 1.
PLAXIS has aPython APIthat is distributed in a Python installer. The API can be used to build-up PLAXIS models and process results,integrating the PLAXIS workflow within your VIKTOR app. For more information on the PLAXIS API, see thewebsite.
From within the VIKTOR app, the Python script is sent, via the generic worker, to the server. After the analysis, thegeneric worker sends back the specified files to the app, after which the developer can process the results (visualize,download, etc.). In the following code snippet two files are sent to the worker: run_plaxis.py and input.json.For additional ideas on how to pass parameters to PLAXIS have a look at thePLAXIS sample application.
The file run_plaxis.py and the other file represented as bytes is then sent to the Python distribution PLAXIS is setto work with. You can specify which Python distribution PLAXIS should use,in the "Using a custom Python distribution" section.
The resulting files can be very large. Consider sending back files to the app with only the relevant information, byfiltering out unnecessary results, to reduce in size. An example can be found in the sample application
7fc3f7cf58