Error while exporting without GUI

More
3 years 11 months ago #3401 by Amilibia i Sison
Hi,
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
sys.path.append(FREECADPATH)

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!
More
3 years 11 months ago #3402 by cwinters
Hi,

you have to call the GenerateMesh function
Code:
mesh = geo.GenerateMesh()
then the export works.
You just copied the GenerateMesh function to the new function "mesh".

Best,
Christoph
Time to create page: 0.113 seconds