Read Aircraft.cfg file
In C:\Program Files (x86)\Lockheed Martin\Prepar3D\SimObjects\Airplanes\ (or where you have your SimObjects folder and if a helo in rotorcraft) look for the aircraft you want and open the folder , thhere you will find the Aircraft.cfg file, open it with notepad and look for ui_createdby= , some aircraft do not use this entry.
regards Jorge
regards Jorge
Jorge Roldan
OZx Developer (aero) - Hovercontrol Helicopter Certified Pilot - Spad.Next Beta Tester - VATPAC Pilot PR
System i9-9990 4.7Ghz 32GB W11 Nvidia GeForce RTX 2080 8GB
OZx Developer (aero) - Hovercontrol Helicopter Certified Pilot - Spad.Next Beta Tester - VATPAC Pilot PR
System i9-9990 4.7Ghz 32GB W11 Nvidia GeForce RTX 2080 8GB
ok,
I know where the file is.
I'm developing one application/ACARS using simconnect to create a log flight, but I need to read some entries of the file.
My problem is how to read the aircraft.cfg of the plane in use by FSX.
How can I know the path of the file aircraft.cfg or SimObjects/"aircraft" folder in use?
With simconnect I can only read some entries like ATC TYPE, ATC MODEL, ATC ID, ATC AIRLINE, TITLE, but I need to read some other information of the plane selected and in use by FSX that is stored in aircraft.cfg.
I know where the file is.
I'm developing one application/ACARS using simconnect to create a log flight, but I need to read some entries of the file.
My problem is how to read the aircraft.cfg of the plane in use by FSX.
How can I know the path of the file aircraft.cfg or SimObjects/"aircraft" folder in use?
With simconnect I can only read some entries like ATC TYPE, ATC MODEL, ATC ID, ATC AIRLINE, TITLE, but I need to read some other information of the plane selected and in use by FSX that is stored in aircraft.cfg.
Hi Framac
To get the FSX application path you have to read register entry 'HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0\AppPath' (It may also be in 'HKEY_LOCAL_MACHINE')
After that, you should read the TITLE. There you'll find text what is in Aircraft.cfg as Title in the section '[fltsim.x]' where is also the 'ui_createdby' field.
To get the FSX application path you have to read register entry 'HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0\AppPath' (It may also be in 'HKEY_LOCAL_MACHINE')
After that, you should read the TITLE. There you'll find text what is in Aircraft.cfg as Title in the section '[fltsim.x]' where is also the 'ui_createdby' field.
Sorry, I may not have explained well.
I have the path of FSX, yes, I can read it from the registry.
I know that planes are inside the folder SimObjects\Airplanes.
In SimObjects\Airplanes I have folders of airplanes and inside I have the aircraft.cfg, and know how to read the file, because the structure is like INI files.
But I do not have the folder name of the plane in use, so I have "Application Path FSX"\SimObjects\Airplanes\ I DO NOT KNOW \aircraft.cfg
Premek, for exemple, the C172 of Microsoft is stored in the folder "Microsoft Flight Simulator X \ SimObjects \ Airplanes \ C172"
In this case, the folder name is "C172"
But the title is "Cessna Skyhawk 172SP Paint1"
When I select the plane "Cessna Skyhawk 172SP Paint1" how can I know that the folder is "C172"
The Bombardier CRJ 700 Paint1 is stored in folder: Bombardier_CRJ_700
When I select the plane "Bombardier CRJ 700 Paint1" how can I know that the folder is "Bombardier_CRJ_700"
My Problem is: In this case, how do I know the name of the folder of the aircraft in use to read the aircraft.cfg?
Thanks for your help
Framac
I have the path of FSX, yes, I can read it from the registry.
I know that planes are inside the folder SimObjects\Airplanes.
In SimObjects\Airplanes I have folders of airplanes and inside I have the aircraft.cfg, and know how to read the file, because the structure is like INI files.
But I do not have the folder name of the plane in use, so I have "Application Path FSX"\SimObjects\Airplanes\ I DO NOT KNOW \aircraft.cfg
Premek, for exemple, the C172 of Microsoft is stored in the folder "Microsoft Flight Simulator X \ SimObjects \ Airplanes \ C172"
In this case, the folder name is "C172"
But the title is "Cessna Skyhawk 172SP Paint1"
When I select the plane "Cessna Skyhawk 172SP Paint1" how can I know that the folder is "C172"
The Bombardier CRJ 700 Paint1 is stored in folder: Bombardier_CRJ_700
When I select the plane "Bombardier CRJ 700 Paint1" how can I know that the folder is "Bombardier_CRJ_700"
My Problem is: In this case, how do I know the name of the folder of the aircraft in use to read the aircraft.cfg?
Thanks for your help
Framac
Well, I'd say the most effective way is to create a dictionary when your app starts - just walk-through the 'Airplanes' folder and for each sub-folder make a list of available 'Titles'.
Or is there any constrain you could not do it this way?
Btw. we should decide where will we talk - either in FSDev or here
Or is there any constrain you could not do it this way?
Btw. we should decide where will we talk - either in FSDev or here
Or maybe intuition for what concerns the folder structure of P3D for compatibility installing FSX aircraft models on P3D, lies in the very structure of the program's folder, to make more similar to the FSX folder and make better the function of the various additional programs that serve the migration patterns of P3D FSX, Prepar3D folder should be like that of FSX, while here we have a folder and sub-folder.
Example Main folder (Microsoft Flight Simulator X) = Folder Main, (Lockheed Martin's Prepar3D).
Regards Daniel
Example Main folder (Microsoft Flight Simulator X) = Folder Main, (Lockheed Martin's Prepar3D).
Regards Daniel
I found it.
I have to read AIR file path, this file is in the aircraft folder,
c++ code here..
http://www.fsdeveloper.com/forum/archiv ... 20082.html
C# Code...
...
enum REQUESTID
{
AIRCRAFT_PATH,
};
...
private void initDataRequest()
{
try
{
...
my_simconnect.OnRecvSystemState += my_simconnect_OnRecvSystemState;
my_simconnect.RequestSystemState(REQUESTID.AIRCRAFT_PATH, "AircraftLoaded");
...
}
}
void my_simconnect_OnRecvSystemState(SimConnect sender, SIMCONNECT_RECV_SYSTEM_STATE data)
{
string aircraftpath= Path.GetDirectoryName(data.szString);
}
I have to read AIR file path, this file is in the aircraft folder,
c++ code here..
http://www.fsdeveloper.com/forum/archiv ... 20082.html
C# Code...
...
enum REQUESTID
{
AIRCRAFT_PATH,
};
...
private void initDataRequest()
{
try
{
...
my_simconnect.OnRecvSystemState += my_simconnect_OnRecvSystemState;
my_simconnect.RequestSystemState(REQUESTID.AIRCRAFT_PATH, "AircraftLoaded");
...
}
}
void my_simconnect_OnRecvSystemState(SimConnect sender, SIMCONNECT_RECV_SYSTEM_STATE data)
{
string aircraftpath= Path.GetDirectoryName(data.szString);
}