Exporting mesh using a sript

Hello together,

I would like to export a mesh, generated in netgen, using a script command. Basically I would like to circumvent clicking on “File”->“Export Mesh” .
Is there any command I can add to my Python script?

Tank you and best regards,
Nils

The netgen mesh has a method “Export” which takes a filename and a format.

Best
Christopher

Thank you for your fast reply,
but unfortunately it does not solve my problem. The mesh I am using is a ngsolve mesh and therein I cannot find a method “Export” or something related. Is it possible to simply convert the ngsolve mesh to a netgen type mesh or to add the export method to ngsolve?

Hi Nils,

The NGsolve mesh has a member ngmesh which gives you access to the netgen mesh.

Try mesh.ngmesh.Export…

Best,
Christoph

Now it works as looked-for.
Thanks for your help Christoph and Christopher