779 is the offset of the element of VensimVariable[ID] that you pass in the storage matrix for variables. Typically, time has offset 1, the first level has offset 2, etc.
So, if you have
You should do something like the following:
Code: Select all
venVarOffset[0] = vensim_get_varoff("VensimVariable[ID1]")
for ( id=1; id<10; id++ )
venVarOffset[id]=venVarOffset[id]+id;
Now venVarOffset contains a vector of offsets, one corresponding to each element of [id]. Note that if [id] is noncontiguous, you'd want to populate the offsets by individual calls to vensim_get_varoff using the specific variable and element name.
Then to retrieve data, call
Code: Select all
result = vensim_get_vecvals(venVarOffset,vals,nvals) ;
where vals is an array of floats that you've allocated to contain the results, and nvals is the size of both arrays, which should equal ELMCOUNT(ID).
The result will be in vals[]. Note that this retrieves a bunch of variables at once, but NOT time series. If you want time series, use vensim_get_data.
I'm going from memory here, so a bit of fine tuning to my suggested code may be needed (plus if you're in C you need to allocate memory).