XPLMGetFMSFlightPlanEntryInfo

XPLM_API void       XPLMGetFMSFlightPlanEntryInfo(
                         XPLMNavFlightPlan    inFlightPlan,
                         int                  inIndex,
                         XPLMNavType *        outType,    /* Can be NULL */
                         char *               outID,    /* Can be NULL */
                         XPLMNavRef *         outRef,    /* Can be NULL */
                         int *                outAltitude,    /* Can be NULL */
                         float *              outLat,    /* Can be NULL */
                         float *              outLon);    /* Can be NULL */

This routine returns information about a given FMS entry. If the entry is an airport or navaid, a reference to a nav entry can be returned allowing you to find additional information (such as a frequency, ILS heading, name, etc.). Note that this reference can be XPLM_NAV_NOT_FOUND until the information has been looked up asynchronously, so after flightplan changes, it might take up to a second for this field to become populated. The other information is available immediately. For a lat/lon entry, the lat/lon is returned by this routine but the navaid cannot be looked up (and the reference will be XPLM_NAV_NOT_FOUND). FMS name entry buffers should be at least 256 chars in length.

WARNING: Due to a bug in X-Plane prior to 11.31, the navaid reference will not be set to XPLM_NAV_NOT_FOUND while no data is available, and instead just remain the value of the variable that you passed the pointer to. Therefore, always initialize the variable to XPLM_NAV_NOT_FOUND before passing the pointer to this function.