Printing "structure plots" plate elements to png files

This section introduces a tool for exporting the "structure plots" of plate elements of a PLAXIS model to png format using the PLAXIS API.

To ensure smooth execution, it is recommended to divide the script into smaller segments and run them sequentially in a Jupyter Notebook.

Markdown

General set up for remote control
        

Python

# This is a compulsory step

from plxscripting.easy import *

# Change the password as shown on your computer below.
user_password = 'use your own password here'

s_i, g_i = new_server('localhost', 10000, password = user_password)
s_o, g_o = new_server('localhost', 10001, password = user_password)
        

Markdown

Plot reactions and deflections of a plate in multipule phases
        

Python


# Updated: 2025-11-08

# Select desired phases to export.
# if all phases are required, simply use "phases = g_o.Phases" without parenthesis.
# Adjust the output types to Ux, Uy, Utot, M2D, Q2D, SPUx, Nx2D
# Be careful, Python is case sensitive

phases = [g_o.Phase_8, g_o.Phase_9, g_o.Phase_10]

num_phases = len(phases)

# select a folder to save your printouts

folderpath = r"C:\Users\username\Desktop\Plaxis\\"

print(f"Total phases selected are {num_phases}. It won't take long.\n")

for phase in phases:
    print(f"Processing phase: {phase.Name}")


    # Select plate element and extract data and switch on plot window
    plate_element = g_o.Plate_1
    plate_output = get_equivalent(plate_element, g_o)
    g_o.structureplot(plate_output)


    filename_str= str(phase.Name)

    g_o.Plots[-1].ResultType = g_o.ResultTypes.Plate.SPUx
    file_name = f"{folderpath}{filename_str}_1Ux.png"
    g_o.Plots[-1].export(file_name)


    g_o.Plots[-1].ResultType = g_o.ResultTypes.Plate.M2D
    file_name = f"{folderpath}{filename_str}_2BM.png"
    g_o.Plots[-1].export(file_name)

    g_o.Plots[-1].ResultType = g_o.ResultTypes.Plate.Q2D
    file_name = f"{folderpath}{filename_str}_3shear.png"
    g_o.Plots[-1].export(file_name)