Archived

This topic is now archived and is closed to further replies.

Marniftarr

How to use SIMCONNECT_DATA_XYZ structure ?

Recommended Posts

Hi folk ! I can not find any example about this SIMCONNECT_DATA_XYZ struct.I want to read or transmit any data to/from sim use this structure , please tell me HOW ? It is a work ? Who are use it ?I read in C+ or Delphi or VB. Thanx.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi folk ! I can not find any example about this SIMCONNECT_DATA_XYZ struct.I want to read or transmit any data to/from sim use this structure , please tell me HOW ?
The structure is clearly defined in the SimConnect header:// SIMCONNECT_DATA_XYZstruct SIMCONNECT_DATA_XYZ{ double x; double y; double z;};So, just define a structure of three doubles (64-bit floats), and pass its address where you'd normally pass the address of your single double or integer or whatever.RegardsPete

Share this post


Link to post
Share on other sites

Well, to start with, the structure types can only be used with specific SimVar names (for the XYZ, there are around 10 that use that format, LATLONALT has about 5). Second, you would create a variable in your data structure using the full SimConnect data type name (ie "SIMCONNECT_DATA_XYZ myXYZVar;") and do one AddToDataDef call for that field using SIMCONNECT_DATATYPE_XYZ as the data type.Also note, some of the SimVar structure types (Waypoints, InitPosition) are only valid when used with SetDataOnXxx, they aren't associated with any readable variables and can't be used with RequestDataOnXxx.

Share this post


Link to post
Share on other sites