Hey Guys, is there a SimVar or new NavAPI call in SimConnect returning the
current airport the user airplane is located while on ground?
Use AI TRAFFIC CURRENT AIRPORT with SIMCONNECT_DATATYPE_STRING32 as data
type, over the user airplane. That variable is one of the many variables still
working from FSX, but missing in the MSDS SDK documentation.
thanks, was using it for the AI airplanes but was not aware it works on user
as well I think it is on the list I send ASOBO requesting to check if it
can be added
hmm, did a quick test and I am getting NULL as return value
simconnect.AddToDataDefinition(DEFINITIONS.SIMOBJECT_Position, “PLANE
LATITUDE”, “degrees”, SIMCONNECT_DATATYPE.FLOAT64, 0.0f,
SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.SIMOBJECT_Position, “PLANE
LONGITUDE”, “degrees”, SIMCONNECT_DATATYPE.FLOAT64, 0.0f,
SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.SIMOBJECT_Position, “PLANE
ALTITUDE”, “Feet”, SIMCONNECT_DATATYPE.FLOAT64, 0.0f,
SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.SIMOBJECT_Position, “PLANE HEADING
DEGREES TRUE”, “Radians”, SIMCONNECT_DATATYPE.FLOAT32, 0.0f,
SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.SIMOBJECT_Position, “AI TRAFFIC
CURRENT AIRPORT”, null, SIMCONNECT_DATATYPE.STRING32, 0.0f,
SimConnect.SIMCONNECT_UNUSED);
simconnect.RegisterDataDefineStruct(DEFINITIONS.SIMOBJECT_Position); public
struct SimObjectPositionData { public double Latitude; public double
Longitude; public double Altitude; public float PLANE_HEADING_DEGREES_TRUE;
public string AI_TRAFFIC_CURRENT_AIRPORT; } all other values are fine. Are you
using C# managed version or c++?
I am also interested on this, I tried using the Execute_Calculator_Code inside
WASM using the C:fs9gps variable via the nearest airports with zero success. I
must say the documentation regarding the GPS variables is incredible vague, no
way to work out how to use them without a proper example, let’s say you want
to know the near 5 airports… how you do it?? Best Regards, Raul
I’m using C++. It’s possible the variable won’t be filled if you haven’t
selected the airport as a Departure airport in the Main Menu, but I tried
doing this: - Started on an airport, checked the variable, and it reports the
correct ICAO - Entered Slew mode, and slew the airplane to a different nearby
airport - Checked the variable again, which is updated to show the new ICAO.