Saving geometry file


I was wondering if there is a way to save the geometry file generated in the python interface in 2D.

I would like to pass the .in2d or .geo file to my C++ code and I could not save the geometry files. I get the error:

invalid command name “Ng_OCCCommand”

in the GUI.

While in the python code I get the error that :
AttributeError: ‘netgen.libngpy._geom2d.SplineGeometry’ object has no attribute ‘Save’

Is there a way to save the geometry that I am missing?