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
  • Dear Klaas,

    An example of the command to create a cross-section specified by points (0 0 -10), (1 0 -10) and (0 1 -10) is:
    crosssectionplot Plot_1 0 0 -10 1 0 -10 0 1 -10

    This command is explained in the Help>Command reference or you can see it generated if you create manually a cross-section in Output using the side toolbar icon.

    Note that you have also submitted a service request about this question and it is currently being handled by a support engineer. The number is 7001028158.

  • Ah good to know that it is being looked into. Yes I know the command for the cross section, but how does the command look like in Python using the remote scripting server. I think it should look like someing as below but I can not get it to work. Are you able to help?

    g_o.Plots[-1].crossectionplot 

  • The correct syntax is:
    g_o.crosssectionplot(g_o.Plots[-1], (0, 0, -10), (1, 0, -10), (0 , 1, -10))  # the parentheses for the coordinates are optional

    This is because the Plot object and the coordinates are parameters as explained in the Command reference.

    Note that we also have a Scripting reference that can be launched via Input and it includes the Output commands, too.

    https://communities.bentley.com/products/geotechnical1/w/wiki/45447/scripting-reference-and-how-to-use-it

  • 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)

Reply
  • 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)

Children