plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

De-Flight avatar image
De-Flight asked JohnLDowson edited

Is there a way to scan and get a list of all SimVars that are on the current plane?

Wondering if there is a way to scan and get a listing of the available LVARS and/or Simevents instead of having to manually type them all in everytime?

simconnect
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Flysimware avatar image
Flysimware answered Flysimware edited

Some info for a full list of Lvars...

You can open the behaviors tool and under LocalVariables tab it will display all Lvars used in the project. You can type a key word or multiple words to filter a single or even multiple Lvars so you can track specific Lvars and their behavior(s).

There also could be a method from the debugger but I will let someone else answer for that.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

De-Flight avatar image
De-Flight answered

I know how to get them all inside the sim. I was wondering if there is a way to generate a listing on the outside somehow. I know there is a way. Just do not know how to do it.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Yoanito avatar image
Yoanito answered

Hello @De-Flight

The simvar being global for all aircraft, there is no way of getting only the simvar that are used by your aircraft.

Best regards,
Yohan

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

De-Flight avatar image
De-Flight answered

I apologize. I meant to say LVARS or Data.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

De-Flight avatar image
De-Flight answered

As LVARS are not global. Thank you.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Yoanito avatar image
Yoanito answered

Hello @De-Flight

Unfortunately there is no built in method to get all the LVars used by your aircraft, gathering all Lvars may be possible but it will also return LVars from other planes because Lvars are global, if you opent the Behaviours Windows and in the Lvars tab disable "Show only var set by plane", you will see all the LVars.

You could get only the Lvars set by the plane at the start of the flight but no build in method exist to do this.

Could you explain the case in which you would need this list ?

Best regards,
Yohan

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

JohnLDowson avatar image
JohnLDowson answered JohnLDowson edited

You can get all available lvars in a WASM module by simply by calling the Gauge API function

lvarname = get_name_of_named_variable(id)

in a loop incrementing the id each time and starting with id=0. The lvarname will be empty after the last one is found.
I don't think this is possible by just using SimConnect.
There are various WASM modules and APIs that you can also use for this. My own WASM provides an API (WAPI - see https://github.com/jldowson/FSUIPC_WAPI) and provides the function

void getLvarList(unordered_map<int, string >& returnMap); // Returns a list of lvar names keyed on the lvar id

A C# wrapper is also available - see www.fsuipc.com for the WASM/WAPI package if interested.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.