Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

readvalue problem

readvalue problem

Anonymous
Not applicable
411 Views
1 Reply
Message 1 of 2

readvalue problem

Anonymous
Not applicable
I have a script that exports some Structure values to a file.

When i try to import those values thought the 'readvalue' method, i get the error:
-- Compile error: Undeclared variable: charItems

charItems is the value of the structure.

Now, if i pre-define this structure in the Listener, readvalue will then correctly recognize the charItems structure and import properly without any errors.

What am i doing wrong? My structure is defined in the same script, at the top of the rollout definition...
0 Likes
Accepted solutions (1)
412 Views
1 Reply
Reply (1)
Message 2 of 2

Swordslayer
Advisor
Advisor
Accepted solution
ReadValue, just like execute, works in global scope, same way as if you'd be getting/setting things via listener. So for it to work the variable you're accessing in it should either be global or you'd have to use it in a different way (like charItems = readValue ...). Or you can just change it for <rolloutName>.charItems, then it should correctly access the charItems var declared inside rollout scope. Hope it helps.
0 Likes