← Back to team overview

yade-users team mailing list archive

Re: [Question #698346]: Why VTKExporter does not work?


Question #698346 on Yade changed:

Description changed to:
I load a saved file of simulation and after loading it, I import every
function in original script. every thing is good but it does n`t export

When I run main script (not saved file) , all things are ok and data
export to VTK . Here is its code:

from yade import export,polyhedra_utils
import os
from yade import plot
import math
from yade import utils
import pylab
import matplotlib; matplotlib.rc('axes',grid=True)
from matplotlib import pyplot
from yade import qt
import numpy as np
from numpy import *
from yade import export as expt


ClumpVtkData = expt.VTKExporter(O.tags['id']+'/'+'clumpData')            
def VTKview():
    for b in O.bodies:
        ClumpVtkData.exportSpheres(ids='all', what={('color','b.shape.color')})
        ClumpVtkData.exportFacets(ids='all', what={('color','b.shape.color')})


But now in saved file, I could n`t export any vtk file.  (I import all codes above in terminal after loading saved file, but something is wrong .)
When I type     VTKview()       in terminal (when saved file of simulation is running), it says: 

"global name 'ClumpVtkData' is not defined"

Please help me.

Best regards,

ubuntu : 18.04
yade 2018.02b

You received this question notification because your team yade-users is
an answer contact for Yade.