How to get the METAR string in C#?

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.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

How to get the METAR string in C#?

Post by ppp333ddd_ »

Hi,
I need to set the ambient temperature and wind. I have searched for sim vars and found the weather and wind info can be read but not settable. The only way I can imagine is to set the METAR. Also, I found the API I need to read METAR data from is WeatherRequestObservationAtStation, but I have trouble using the struct SIMCONNECT_RECV_WEATHER_OBSERVATION then as this is a C++ struct. Is there a similar struct in C# so that I can get the METAR string? Thanks.
maxaero
Posts: 16
Joined: Tue Oct 29, 2013 4:02 pm

Re: How to get the METAR string in C#?

Post by maxaero »

Use the Object Browser in Visual Studio to look at SIMCONNECT_RECV_WEATHER_OBSERVATION You'll see that SIMCONNECT_RECV_WEATHER_OBSERVATION is a class with two fields, public uint dwRequestID and public string szMetar.
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: How to get the METAR string in C#?

Post by ppp333ddd_ »

Hi maxaero, thanks you are right.
Locked