Set where images will be saved, and retrieve all embedded beam objects from Output.
folderpath = r"C:\Users\username\Desktop\Plaxis_playground\plotting\\" # use your own path
embedded_beams = g_o.EmbeddedBeams
Exports are written directly to disk. If the folder does not exist, export will fail.
3️⃣ Step 2: Select & Activate the Calculation Phase
Choose the phase you want to plot and make sure Output is set to that phase.
phase = g_o.Phase_10
# To process all phases, use: phases = g_o.Phases
# Activate the selected phase in the Output interface
g_i.view(phase) # Opens a plot window for the selected phase (default: deformed mesh)
g_o.Plots[-1].Phase = phase # Assigns the selected phase to the current plot object
If you prefer a silent/batch workflow, you can omit g_i.view(phase) and just set the plot phase,
but some setups behave more predictably after opening Output at least once.
4️⃣ Step 3: Loop Through Embedded Beams & Export Plots
Iterate all embedded beams, create a structure plot for each element, set the desired result type,
then export the plot image with a consistent naming scheme.
Example: export axial force (Nx2D)
for index, beam in enumerate(embedded_beams):
# Create a structure plot for the current embedded beam
g_o.structureplot(beam)
# Set the result type to axial force (Nx2D)
g_o.Plots[-1].ResultType = g_o.ResultTypes.EmbeddedBeam.Nx2D
filename_str = "beam_" + str(index)
file_name = f"{folderpath}{filename_str}.png"
g_o.Plots[-1].export(file_name)
Small upgrade
For reporting, you can add ProjectDescription, set legend autoscale, or export at a fixed resolution
(e.g. 1920 × 1080) if your API version supports width/height on export().
5️⃣ Result Types (EmbeddedBeam)
To discover what result types are available under ResultTypes.EmbeddedBeam, list attributes:
eb_types = g_o.ResultTypes.EmbeddedBeam
print(dir(eb_types))
for name in dir(eb_types):
if not name.startswith('_'):
print(name)
Your exact list depends on PLAXIS version, model features, and what is enabled in Output.
6️⃣ Multi-phase Batch Pattern
To process multiple phases, wrap the beam loop inside an outer phase loop. Keep your naming tidy,
or you’ll end up with a folder that looks like a crime scene.
phases = [g_o.Phase_1, g_o.Phase_2, g_o.Phase_3] # or: phases = g_o.Phases
for phase in phases:
g_o.Plots[-1].Phase = phase
for index, beam in enumerate(g_o.EmbeddedBeams):
g_o.structureplot(beam)
g_o.Plots[-1].ResultType = g_o.ResultTypes.EmbeddedBeam.Nx2D
file_name = f"{folderpath}P{phase.Identification}_beam_{index}_Nx2D.png"
g_o.Plots[-1].export(file_name)
If phase.Identification is not available in your API, replace it with phase.Name (sanitise the string),
or use your own label map.
7️⃣ Notes & Best Practices
Refer to Helper Tool 1 for “Deformed Mesh” and general plot formatting patterns (legend autoscale, description, zoom, etc.).
Batch exporting across many phases can produce a lot of images — plan an output naming/template strategy.
If you need consistent framing, use plot.zoom(...) (by object or coordinates) before exporting.
When unsure what a plot supports: dir(plot), help(plot), or plot.echo().
Next-step idea
Turn the export routine into a function: input (phase list, result list, beam list) → output (clean, repeatable figure packs).