# Accessing extra variable via python code

**URL:** https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148
**Category:** FLAC3D
**Tags:** python
**Created:** [July 5, 2025, 6:37pm UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148 "2025-07-05T18:37:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JuDi](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuDi](https://forum.itascainternational.com/u/JuDi)
#### Post date: [July 5, 2025, 6:37pm UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148/1 "2025-07-05T18:37:01Z")

</div>

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:

```auto
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:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/itasca/original/2X/8/8dbb9ee3435e986f4825f2896411474c350deffe.png)

Any hint appreciated.  
Julia

---

<div class="post-metadata">

### Author: ![cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cheng](https://forum.itascainternational.com/u/cheng)
#### Post date: [July 6, 2025, 5:45pm UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148/2 "2025-07-06T17:45:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JuDi](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuDi](https://forum.itascainternational.com/u/JuDi)
#### Post date: [July 7, 2025, 6:30am UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148/3 "2025-07-07T06:30:30Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![JuDi](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuDi](https://forum.itascainternational.com/u/JuDi)
#### Post date: [July 9, 2025, 12:34pm UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148/4 "2025-07-09T12:34:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cheng](https://forum.itascainternational.com/u/cheng)
#### Post date: [July 10, 2025, 3:40pm UTC](https://forum.itascainternational.com/t/accessing-extra-variable-via-python-code/2148/5 "2025-07-10T15:40:44Z")

</div>

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.
