Generate horizontal cross section plots using python

I would like to generate output plots showing a horizontal cross section showing the pase displacements in z-direction at a defined level in Plaxis 3D using the scripting server. Is there a way to do this, what is the command? I also tried to generate plots from the deformed mesh, is this possible in Plaxis 3D?

Parents Reply Children
  • Thank you, I'm getting a step closer. The goal is to export cross section plots for all phases in my model. In which I preferably also can set the results that are shown in the cross section (e.g. Puz, utot etc.). with the command you provided I only can create one cross section after this it runs into an error. Below the error and the code.

    Error:

    lxscripting.plx_scripting_exceptions.PlxScriptingError: Unsuccessful command:
    The command 'crosssectionplot' is only for 3D model view plots.

    g_o.Plots[-1].PhaseBehaviour = 'projectphase'
    for phase in g_o.Phases:

       phase_name = phase.Name.value #retrieve phase name
       phase_id = phase.Identification.value #retrieve phase identification

       g_o.Plots[-1].Phase = phase
       g_o.Plots[-1].hide(g_o.WaterLoads) #hide/show water loads
       g_o.Plots[-1].hide(g_o.Interfaces) #hide/show interfaces
       g_o.Plots[-1].show(g_o.Pointloads) #hide/show point loads
       g_o.Plots[-1].show(g_o.Lineloads) #hide/show line loads
       g_o.Plots[-1].ResultType = g_o.ResultTypes.Soil.PUz
       g_o.crosssectionplot(g_o.Plots[-1], (0, 40, 0), (80, 40, 0), (0 , 40, 1))
       g_o.Plots[-1].LegendSettings.MinValue = -0.015 #minimum Value of legend
       g_o.Plots[-1].LegendSettings.MaxValue = 0 #maximum value of legend
       g_o.Plots[-1].MeshSettings.ElementContours = False #hide Element contours True/False

       g_o.Plots[-1].export(output_location + 'Puz' + phase_id + '.png'.format(phase), 1920, 1080)

  • Dear Klaas,

    The details of a question are only handled in a Service Request.

    Please refer to Service Request 7001028158 for more in-depth assistance. I can follow-up with this question.

  • I have the same issue. Runs the first cross section plot but fails on sub sequent ones

  • Dear Brian,

    One thing to comment, as from your description it is not clear what the failure message is, is to check for which Plots object you try to configure.

    The object Plots[-1] always points to the lastly created plot in Output. To give you an example:

    1. When opening a project in Output by default you get the deformed mesh, which is now the Plots[-1]
    2. When creating a cross-section a new plot object is created and you see a different window loaded in Output, so:
      Deformed mesh is: Plots[-2] or Plots[0]
      Cross-section is: Plots[-1] or Plots[1]
    3. That logic continues, when opening a different project or you create a structureplot, too.

    If you cannot figure out why your script does not do what you need, we can further assist you in a service request. Note that as we do not do code reviews in support, we can check the PLAXIS commands and their Python equivalents that work as intended.