Recently, I have prepared a Moment-Axial Force Interaction Diagram that fetches the structural forces from Plaxis automatically. Using the amazing Streamlit module, I have created a simple GUI for MN diagram and published its video in Linkedin. The response was amazing and I got a lot of questions regarding the procedure, Python-Plaxis connection and Streamlit.
You can see the video here.
I will not publish the code since it will require me to check every aspect of the code, do extensive tests and prepare a documentation. Instead, I want to give some insights on the methods that I have used in the code. I had to try and fail too many times and contacted Plaxis support several times. Since this is a gray area still with lot to develop, it is not easy to find discussions on the internet, so even a brain-storming with Plaxis support is really valuable. (Thanks to Stefanos)
So, to create a record of these functions, I will share small gists (a little code snippets sharing tool by Github.)
I have though about this a lot: What would be the best user experience? The best would be to know which plates user selected and get the loads for that plates. However, it is not possible with our current tools. So, I have created two options:
We can fetch groups and plates from Plaxis. In my procedure, I create two list:
An example output of group_list_func()
given below.
([<Entity {073DA50B-22A0-4D85-B9B1-E6470DC89EC4}>], ['RetainingWall'])
I am not a coder, software engineer. So, there are many don't-dos in the codes below. For example, no proper error handling is used. The proposed codes' runtime can be decreased significantly. You should rewrite everything given below to have a proper code. If you do not know Plaxis-Python connection but you are experienced in Python, you can find clever ways to rewrite the code, but this article will help you to get started. If you find a better way to write these codes, please let me know and I can edit the Gist and post by thanking you.
There are several ways to contact with Plaxis using Python. One of them is using the interpreter coming built-in with Plaxis for short codes. You can reach this by Expert - Python - Interpreter menu. This is already connected to Plaxis without a need for boilerplate
code that calls for the plxscripting
. It uses Jupyter QtConsole and works great.
However, for longer codes, you will need to call for plxscripting.easy
and you should start a new server with s_o, g_o = new_server("localhost", localhostport_o, password=password)
. This is pretty standard although it seems complicated. See the tutorials on the Bentley Plaxis website for boilerplate codes.
When we performed all these steps, we have four keys: