python Script - context how to get the properties of a grid variable
Let's say I have a grid variable called GV in which I defined 3 columns ColA, ColB, ColC.
For each column I have 4 default rows.
ColA ColB ColC
ABC 123 A1B1
DEF 456 C2D2
GHI 789 E3F3
JKL 012 G4H4
I use the following python script to extract the data:
myVar = context.getGridVariable('GV')
for x in range(len(myVar)):
for y in range(len(myVar[x])):
When I extract the data from the grid using pyhton. I get something like this.
How do I map the the Index for ColB? Because the order of the columns in the GV might change. And next Time ColB won't be Index 2 it will be index 3.
Is there anyway in the context object to get the index of ColB, or ColA? Or even get a list of the names?