Change a VolatileData structure to number

python
unhandled

(Alexholden18) #1

hi everyone

I am playing around some codes to figure out the logic behind them. I wonder how to convert a VolatileData which is structure{1} type to a number. here is a code I used in python:

ghObjects = ghenv.Component.OnPingDocument().Objects

for obj in ghObjects:
    if obj.NickName == "num":
        s = obj

a = s.VolatileData 

print a

as you could see in the first image when I print the a it shows the structure{1} and instead I want to see the number as print output. Any help is appreciated

Volatiledata.gh (6.9 KB)


(Alexholden18) #2

I think I found the answer:

a[0][0]