Accessing extra variable via python code

Hi,

what am I missing with this code when trying to access an extra variable set in the model via a python script? Both types of access , via zonepointer or zone array give me the error message shown below:

import itasca as it
from itasca import zonearray as za

print(za.extra(1))

zo = it.zone.near((0,0,0))
print(zo.id())
print(zo.extra(1))

AssertionError: Extra variable used before assignment.

But extra 1 is not zero:

Any hint appreciated.
Julia

Julia, please update to the latest subscription version, now v9.4.32, which I’ve tested and confirmed is working.

Thank you Cheng, that did it. I was about to post that I tried it with 9.0.x and 9.2.x which did not work. Now all good.

Hi, unfortunately this keeps appearing even in the latest version. I have not figured a pattern yet, will provide as soon as I do…

I re-tested it, and it works.

I suspect the issue is that you assigned the extra variable to only some (not all) zones, so you need to filter based on the zones that were assigned.