API for python or similar solutions

Is there any way to run PrePoMax through python API. I would like to change parameters and run simulation.

Check this thread: Creating surface through .NET API

But parameter support was introduced in 1.4.1 and parametric studies are planned to follow (A developer/preview PrePoMax version v1.4.1 has been released) so API shouldn’t be necessary for this in the near future.

Unfortunately, there is no API for Python. I did not look into this kind of development but I think a lot of the base PrePoMax code would need to be adjusted. But if you can use C# the internal PrePoMax classes might help.

i guessed the parameter need to be change is part dimensions. It seems only by re-importing modified CAD files by Edit - Regenerates using other files is possible now. However, to be consistent with boundary conditions previously defined, the number of edge and face constructed need exactly the same, ID names also.

These limitations are not to be a serious problem, surface or edge boundary conditions can be easily to adapt by redefinition.

regarding to API, hopefully in the future IronPython is possible to interact or loading Gmsh (dll) to build geometry, generate mesh and create group of boundary conditions.

1 Like

The regenerate actually works by repeating the commands the user created. During selection, the user clicks on the geometry using the mouse. The 2D mouse coordinate is projected into space along a single ray, and it impacts the geometry at some point. This is the 3D selection point. This point and the selection direction are saved. Additionally, the part id of the selected part is saved.

When regenerating, the selection is repeated by using this 3D selection point and direction on the part with the saved part id. So only part id needs to be the same, while other geometry IDs (surface IDs, edge IDs, and vertex IDs) may change. The closest item at the location of the 3D selection point will be selected.

2 Likes