Hi there,

I would be looking at how you can select and save automatically a specific foil file using the Javascript API / CLI.

I am currently running automated Gomboc runs via the Batch mode external connection to explore simulations with different foil geometries defined with parameters through a javascript file. At the end of the js file which modify the foil geometry + launch the simulation + do some other operations, I would like to quite Gomboc nicely with Host.quit(); . Gomboc however shows the graphic confirmation window to confirm if I want to close without saving the newly modified foil (which are showing a start in their name).

I have been looking at the functions available via:

  • query(Host)
  • query(Host.foilHolder())
    • This reveals the Host.foilHolder().foilSave() and Host.foilHolder.foilSaveAs()
  • query(Host.foilHolder().foilDefinition(N)), N being the index of the foil on the list.

When doing a few tests:

  • Host.foilHolder().foilSaveAs() opens the GUI window for saving the foil file so requires manual interaction and cannot be automated.
  • Host.foilHolder().foilSave() seems to save the foil at the root of the Gomboc RUNTIME_PATH. I tried Host.foilHolder().foilSave(path\filename.foil) and it does not seem to save in a specific location under a specific file name. However this solution would save the foil, but this is only for the foil selected by default in the foil holder which is the top one.

In my case, the foil that needs to be saved as is (because it was modified and shows the *) is not the first (top one) foil on the foilHolder interface and I would be looking at selecting a specific foil to be able to save it. query(Host.foilHolder().foilDefinition(N)) does not seem to showcase a select or save function appart from the one mentioned above.

At the moment, I force the Gomboc closure by using taskkill /f /im Gomboc.exe at the end of the bat file launching the Gomboc session, however this is a risky approach when trying to run several runs in parallel (as this could kill any of the Gomboc session in progress).

Another way to maybe tackle the issue would be to have an option in the General Gomboc settings that would allow to close Gomboc with an unsaved modified foil without asking for user confirmation. Users could activate or deactivate this feature according to their preferences.

I also still observe some fail to launch Gomboc via bat file behavior as sometime the Gomboc.exe goes in the background process and does not show the GUI and does not seem to run the script.

Thank you for your help,

Nicolas

Support SumToZero Answered question 6 August 2025