This article covers the following platforms
MSFS 2024
MSFS 2020
ATS
FSX
Prepar3D
Read the simulator’s current weather structure, edit it, and apply it back to the simulator.
get_weather()
Get the current in-simulator weather structure.
SignatureTypeScript contract
get_weather(): Record<string, unknown>ExampleJavaScript
const weather = this.$api.weather.get_weather();
console.log(weather);Returns
Record<string, unknown>Editable object representing the current in-simulator weather.set_weather()
Apply a weather structure to the simulator.
SignatureTypeScript contract
set_weather(weather_object: Record<string, unknown>): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
weather_object | Record<string, unknown> | Yes | In-simulator weather structure, obtainable from get_weather(). |
ExampleJavaScript
const weather = this.$api.weather.get_weather();
// Update documented fields on the returned structure.
this.$api.weather.set_weather(weather);Returns
voidNo direct return value is documented.