Error while exporting without GUI

I’m just getting started on Netgen on Mac. I wanted to upload a surface mesh, generate a volumetric mesh with certain parameters and export it later. I was able to import the mesh and generate the volumetric mesh. But after generating the mesh, the GUI opens and the following error appears:

AttributeError: ‘builtin_function_or_method’ object has no attribute ‘Export’

I was wondering if you guys could help me export the mesh. Here’s my code attached:

FREECADPATH = ‘/Applications/Netgen’
import sys

import netgen.meshing as meshing
from netgen.meshing import MeshingParameters
from netgen.csg import *
from netgen.NgOCC import *
from ngsolve import *

geo = OCCGeometry(‘/Users/emilio/Desktop/tfgs/skull_solid_step.step’)
mesh = geo.GenerateMesh
mesh.Export(“test.msh”, “Gmsh Format”)

Thank you!


you have to call the GenerateMesh function

mesh = geo.GenerateMesh()

then the export works.
You just copied the GenerateMesh function to the new function “mesh”.