← Back to team overview

yade-users team mailing list archive

Re: [Question #702972]: porosity control

 

Question #702972 on Yade changed:
https://answers.launchpad.net/yade/+question/702972

Jan Stránský posted a new comment:
> NameError: name 'addPlotData' is not defined
>
> O.engines = [
>    ...
>    PyRunner(command='addPlotData()', iterPeriod=500),
> ]
> ...
> while 1:
>     O.run(1000, 1)
> ...
> 
> def addPlotData():
> ...

Python executes the code line by line from the top.
In the time of the first O.run, the addPlotData function has not been defined yet, python know anything about it (as it have not read it yet).
Just put the definition before O.run and is should work.

Ideally, you should have created a new question [1], as the error is not
related to the porosity control, which your original question is about.

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

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