Unable to Modify Initial Piezometric Surface via GeoStudio Scripting API
Issues – Initial Piezometric Surface cannot be modified through the scripting API
Our Transient Seepage analysis obtains its initial pore-water-pressure conditions from an Initial Piezometric Surface.
Through extensive testing, it appears that this object cannot currently be modified through the scripting API.
We tested numerous approaches, including:
Get()Set()Add()- Updating individual points
- Replacing the complete point list
- Creating new Piezometric Surface objects
Every approach either:
- returns "Method not supported for type Pt", or
- completes without actually modifying the project.
For example, attempting to modify:
CurrentAnalysis.Objects.InitialPiezometricSurfaces[1].Points
or any individual
.Points[i]
fails regardless of the payload format used.
XML workaround
As an experiment, we bypassed the scripting API by editing the internal XML inside a copied .gsz archive.
This successfully updates the Initial Piezometric Surface. After reopening the modified project, GeoStudio accepts the file and displays the updated water table correctly.
However, this workaround introduces another problem.
Because the project has been modified outside of GeoStudio's normal editing workflow, its internal project and mesh state no longer behaves the same as a project edited through the GUI or supported scripting API.
When geometry is subsequently modified and SolveAnalyses() is called, GeoStudio no longer performs the automatic remeshing that normally occurs on an unmodified project. Adding project.Save() before solving did not restore this behavior.
As a result, although direct XML editing successfully changes the Initial Piezometric Surface, it cannot be considered a practical workaround because the modified project cannot be reliably solved after subsequent geometry changes.
Questions
- Is modification of the Initial Piezometric Surface currently supported by the GeoStudio Scripting API?
- If not, is this a known limitation or bug?
- Is there a supported workflow for programmatically updating the initial groundwater table prior to solving a transient seepage analysis?
- Is there any supported alternative to direct project-file editing that preserves automatic remeshing and normal project behavior?
Comments
-
Hi @ArjunAdhikari,
GeoStudio supports retrieving and modifying piezometric surface coordinates through the Scripting API. For this type of workflow, we recommend using the Scripting API, as it provides direct access to piezometric surface objects and their coordinate data, allowing model modifications to be performed programmatically through a supported and maintainable interface. The Sketch Text dialog box (shown below) can be used to identify the relevant objects and their corresponding paths. Once identified, the coordinates can be accessed and updated programmatically, and the entire set of piezometric surface coordinates can be modified in a single API call, as illustrated in the example below.
It is also worth noting that GeoStudio 2025.2.1 resolves an issue present in earlier versions where two-dimensional domains were not automatically re-meshed when models were saved or solved through the Scripting API. As a result, geometry modifications made through the API are now automatically reflected in the generated mesh.
Sketch Text Dialog Box
Sample API Call
3 -
Thank you for your response and for clarifying that GeoStudio supports modifying piezometric surface coordinates through the Scripting API.
I am using GeoStudio 2025.2.1 and have been testing this using the GSI API. However, I have encountered a discrepancy between the object model exposed by my installation and the example provided in your screenshot
My observations
- Sketch Text in my project identifies the piezometric surface as:
Coordinate: {CurrentAnalysis.Objects.InitialPiezometricSurfaces[1].Points[1]}(and similarly for the remaining points).
- Using the Scripting API:
project.Get( gsi.GetRequest( analysis="Transient Seepage", object="CurrentAnalysis.Objects" ) )returns:
CurrentAnalysis.Objects ├── WaterParticleTracking └── InitialPiezometricSurfaces
There is no
PiezometricSurfacescollection.- Attempting to access the object shown in your example:
CurrentAnalysis.Objects.PiezometricSurfaces
returns:
StatusCode.NOT_FOUND Object 'CurrentAnalysis.Objects.PiezometricSurfaces' not found
- The object that is actually exposed by the API is:
CurrentAnalysis.Objects.InitialPiezometricSurfaces
which contains a
Pointsfield rather than aCoordinatesfield.My question
- The Sketch Text generated by my project and the GSI API are consistent with each other, but they do not match the object path shown in your screenshot (
PiezometricSurfaces/Coordinates). - Using the object path identified by my own Sketch Text (
CurrentAnalysis.Objects.InitialPiezometricSurfaces[1]), I tested both theGet()andSet()operations through the GSI API. TheGet()request completed successfully and returned the expected object, confirming that the API can locate and read the Initial Piezometric Surface and itsPointsfield. I then used the same object path and attempted to update the completePointscollection in a singleSet()request following the same whole-object update pattern recommended by you. However, theSet()operation failed with the errorStatusCode.INVALID_ARGUMENT: Method not supported for type
1 -
Hi @ArjunAdhikari,
The process for modifying the points that define an initial piezometric surface in a groundwater flow analysis should be similar to the approach described earlier for updating piezometric surface coordinates in a slope stability analysis (see below). However, as shown in your screen capture, the Scripting API is not currently retrieving the point coordinates correctly. Instead of returning coordinate data, the points are returned as empty objects ('Points': [{}, {}, {}]).
We investigated the issue and identified the underlying cause. A fix has been implemented by our development team and is currently planned for inclusion in an upcoming GeoStudio release. In the meantime, as a temporary workaround, the script can be used to save the project, update the initial piezometric surface directly within the model input (XML) file, save the modified file, and then reload the project. Once the project has been reloaded, the updated coordinates will be correctly recognized and used by the analysis.
Sketch Text Dialog BoxSample API Call
3







