VarGet with Javascript to retrieve a structure type variable?

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
davidk64
Posts: 26
Joined: Sat Dec 06, 2014 11:49 pm

VarGet with Javascript to retrieve a structure type variable?

Post by davidk64 »

I can access a variable that is a single number like this:

var planeLat = VarGet("A:PLANE LATITUDE" ,"Radians")

but I'm not sure how to access a structure, for example

var eyePointPos = VarGet("A:EYEPOINT POSITION" , "feet");

Where SDK says EYEPOINT POSITION is "SIMCONNECT_DATA_XYZ structure, feet"

When I try to access the retrieved value with :

document.getElementById('debug1').innerHTML = eyePointPos;

It returns "0"

With

document.getElementById('debug1').innerHTML = eyePointPos[0];

hoping to get the "X" value, it returns "undefined"

Maybe I can't store the return value from VarGet("A:EYEPOINT POSITION" , "feet") in a Javascript variable and access the X/Y/Z values?
Post Reply