• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 MSFS Airport Extractor Beta 0.1 - A Little Program to Extract an Airport for Fixing

Messages
1,025
Country
us-florida
UPDATE: Version 2.0 with both Steam and Microsoft Store Support

NOTE: Some APX*.bgl files no longer decompile such as those in APX15180.bgl and APX15170.bgl covering the San Francisco region. This is due to MSFSBglXml no longer being updated or supported. It did work on earlier installs of MSFS but before which sim update I'm not sure.

This is a little program that works in conjunction with "msfsbglxml" that will allow you extract a single airport to an XML file <Airport> section that you can then use to rework an airport much like an AFCAD but within the MSFS inbuilt SDK kit.

The reason I needed this was for personal use, as my local airport in MSFS has one of the runways permanently closed with big X's on the runway, plus the runways are grass with ashphalt pads at each end of the runways. In all the years of Flight Sim, no one has ever touched this airport. So my only choice is to rework it.

I have only tested this on the Steam version of MSFS and will double check the code for the Microsoft Store version when I get a chance.

Here's a quick rundown of functionality, basically all you have to do once the initial setup is done is input the ICAO code of the airport you want to rework.
  1. To extract an airport you'll first need to download and install msfsbglxml from the link above
  2. Then all you'll need to download and unzip MSFS_Airport_Extractor to a directory of your choice
  3. Next, double click on MSFS_Airport_Extractor.exe to run the program
  4. It will generate a MSFS_Directory.ini file which will hold the path to your Microsoft Flight Simulator\Packages\Official\Steam\fs-base-genericairports\scenery folder where all the airports are in APX*.BGL files in subdirectories
  5. Next, on the first install it will ask for the path to your folder that has msfsbglxml.exe file, just put the directory in. It will write a .ini file to point to the .exe file e.g. C:\MSFS Applications\MSFSBGLXML\MSFSBGLXML.exe
  6. Those 2 files are needed to point to the Airports subdirectory in MSFS and run the .exe to extract the airport
  7. Next it will ask you for the 4 character ICAO code of the airport you want to extract, if you mis-key it or the airport with that ICAO code doesn't exist in the sim it will ask you to verify you have input the correct ICAO code, if you have put in the right code, and it asks you to verify again then that airstrip/field/port doesn't exist in MSFS
  8. Once you have put in the code and it finds the airport it will extract it for you to the MSFS_Airport_Extractor folder with the filename named as the ICAO of your airport and .xml e.g. KLAX,xml
  9. This code is only the code for that airport in XML, all the stuff between <Airport> and </Airport> for that airport, you'll currently need to cut and paste it into a template project from the SDK for simple airports
  10. Once you have done that you can open up your airport project in DevMode and start reworking aprons and taxilines, and parking spots etc. What the project will bring in will be the Runways, Taxiways, Lighting, Aprons etc, I'm guessing if you want to change the frequencies or other nav stuff you can do that but they are not contained in the extracted xml. In your Airport section of the editor you can choose what to exclude, say you've changed an apron only, just turn on the exclude for the aprons from the original airport. That's up to the user to figure out which airport excludes to turn on. I can go into further depth if it doesn't make sense
  11. Then all you have to do is build your reworked airport scenery and copy it to the Community folder in MSFS
Version 2.0 Updated:
  • Made it so it asks the user if they have the Microsoft Store or Steam version of MSFS installed, user selects 1 or 2, if users have installed MSFS to a custom folder they'll need to manually point the MSFS_Directory.ini to their custom install location
  • Wrap the XML code ready to go with XML header information for the MSFS project folder
Future Version:
  • Port the program to a Windows Form Application (i.e. GUI) to make it more user friendly
  • Prompt the user to fill out the main project.xml files with developer name, project name etc and set up the folder structure so it's a one stop shop, you put in the airport code and out the other side it generates your MSFS airport project folder ready to load it in to the MSFS project editor. No need to manually set up a project folder and dig through the project xml and json folders, it'll do it for you.
UPDATE: You may need the .NET 6.0 Runtimes for consoles available from:
 

Attachments

Last edited:
ADE does essentially the same thing...
I don't think so, I tried. I think it is no problem if the airport has its own .bgl, but if it is not "stand alone," we're unable to point to the grouped .bgl to dig it out. That is the issue Gary and starseed are working out over on this thread. it looks like Dean has a more elegant solution and I know you are always right Dick, but as an example, show me the editable taxiways and parking of KTTD in XML form taken using ADE and I'll be convinced. I know I'm dumb sometimes but also persistent and all ADE got me were the disables. Granted when I load my version in Community, all that crap is gone, but I wanted to save some of it.
 
ADE does essentially the same thing...

I know, Jon’s work on ADE has been awesome, especially after Lee Swordy’s AFCAD editor and the days of ProjectAI.

With this approach you get to work visually directly in the sim. No need to import an overlay and you get direct WYSIWYG in sim in real time. Similar to a program Flight1 used to have that was like ADE inside FSX.

The airport I needed to fix was so complicated it could only have been accomplished in MSFS visually.

I have some stuff programmatically I want to implement as well to bypass manual editing altogether.
 
Last edited:
I know, Jon’s work on ADE has been awesome, especially after Lee Swordy’s AFCAD editor and the days of ProjectAI.

With this approach you get to work visually directly in the sim. No need to import an overlay and you get direct WYSIWYG in sim in real time. Similar to a program Flight1 used to have that was like ADE inside FSX.

The airport I needed to fix was so complicated it could only have been accomplished in MSFS visually.

I have some stuff programmatically I want to implement as well to bypass manual editing altogether.

Great stuff!

ADE can extract a single airport from the stock files. There has been an issue where Asobo moved the location of stock airports. As I recall ADE 2021 HF5 fixed that but perhaps since then the stock files have been moved again. The the two way editing function in ADE allows the creation of a project for the airport which can be read in both ADE (Cad view) and Dev Mode.
 
ADE extracts from a single airport BGL or a library of airports BGL. Two way editing allows for working the project in Devmode or through ADE. msfsxmlbgl has a couple of bugs, and isn't actively updated. ADE uses Patrick Germain's decompilation, and is updated as the sim changes (when we pester him).
 
msfsxmlbgl has a couple of bugs, and isn't actively updated
Fair point. ADE originally used this but changed to Patrick's decompiler when the developer ceased support. As Dick says Patrick is still active in the community.
 
Good stuff. I didn’t know about Patrick’s decompiler. I think I may have come across some of the bugs in msfsxmlbgl that you mentioned.

The one thing that I have missed is ProjectAI and the whole community, especially everyone contributing AFCAD files with parking codes. With Tom M departing development of Ultimate Traffic I’m wanting to make it easy for people to assign parking codes programmatically to their favorite airports. AIG, FSLTL and FS Traffic have the aircraft, but there’s no longer a community building AFCADS/AFX/APX files to make the planes park at the right gates etc. just looking at the default YBBN most gates are set as GA parking, and in MSFS’ tools there’s no way to add airline parking codes although they exist and compile in XML.

I haven’t really used ADE since MSFS came out (sorry Jon most of my focus has been on other areas of sim development until now) so I should get under the hood and explore more.

It’s a shame that so many developers of software tools for Flight Sim development end up leaving and they take the code with them. I’m wanting to do up a bunch of stuff that will be open source so the whole community benefits. MSFS pretty much has everything that I put into the game design documents for DTG for FSFS and FSW so anything I want to work on, is really only worthy of being freeware. The great thing is that the flight simulation stuff actually crosses over into motion picture visual effects so I develop stuff for the sim, then I can import those same assets into Unreal Engine for virtual film production.

One thing I’m working on at the moment is porting over my FSTerrainBuilder program I hired a friend to code for me that allowed me to fully automate large scale photoscenery and elevation data for FSX and P3D. I’m about 50% there. It needed Adobe Photoshop for some stages and Global Mapper for other stages, but I was thinking of adding functionality for stuff like QGIS and other open source imagery software as well. I’ve ported just over 50% of the code from Visual Basic to C# .net 6.0 thanks to help from ChatGPT, but it only returns a certain number of lines of code which is challenging.

Off topic for a moment: I have some ideas too, that I’m working on that hopefully can be made available to everyone to use for their projects. I’m planning to run tests on something in coming days and if successful I may be able to pass that along to another dev that’s working on a global addon. 😁

EDIT: One thing that I discovered, and I haven’t kept up with the forms here, but I found out that if there are building footprints within the airport boundary, and I’m not exactly sure yet what specific part of the airport design does this, those Autogen buildings become autogen hangars. I need to investigate that more. The best example is KVNY Van Nuys airport. There’s a bunch of T-Hangar buildings. I’ll do some experiments on Rosamond Skypark L00 when I get a chance.
 
Last edited:
ADE extracts from a single airport BGL or a library of airports BGL. Two way editing allows for working the project in Devmode or through ADE. msfsxmlbgl has a couple of bugs, and isn't actively updated. ADE uses Patrick Germain's decompilation, and is updated as the sim changes (when we pester him).
This is the information I had been looking for. "Dev Mode "Options" menu -> "Airports" -> "Debug airport override" and Dean's suggestion showed me how to find the .bgl to open. So thanks and for anyone else trying to accomplish similar, it works.

KTTD.png
 
This is a little program that works in conjunction with "msfsbglxml"
"msfsbglxml" really very good project but unfortunately it seems that it is completely abandoned :confused:
fortunately we have an alternative in the form of a decompiler from Patrick Germain, but unfortunately a decompiler (at the moment) also cannot extract some .bgl,
I hope this will be possible in the future:scratchch
 
Hello ! My MSFS 2020 is Microsoft Store. I replaced the original line with E:\MSFS 2020\Official\OneStore\fs-base-genericairports\scenery

I see lots of lines in the command prompt page, but nothing comes out !
 
"msfsbglxml" really very good project but unfortunately it seems that it is completely abandoned :confused:
fortunately we have an alternative in the form of a decompiler from Patrick Germain, but unfortunately a decompiler (at the moment) also cannot extract some .bgl,
I hope this will be possible in the future:scratchch

I'm wanting to revisit this, I tried looking for Patrick's decompiler via google search but so far have only come up with is https://www.aero.sors.fr › bgltools which is FSX/FS9. Is there a newer version for MSFS?
Hello ! My MSFS 2020 is Microsoft Store. I replaced the original line with E:\MSFS 2020\Official\OneStore\fs-base-genericairports\scenery

I see lots of lines in the command prompt page, but nothing comes out !

I'm coming back around to this and will try and work with you on a solution for Microsoft Store.
 
It doesn't include all the elements of airports, but most. Asobo keeps changing the BGL code and it's hard to keep up. Patrick would probably allow you to use some of his code is you want to pursue this. Just ask him.
 
It doesn't include all the elements of airports, but most. Asobo keeps changing the BGL code and it's hard to keep up. Patrick would probably allow you to use some of his code is you want to pursue this. Just ask him.

Just took a look at it and not really providing functionality that I need... I love how he's designed it to build a project though.
msfsxmlbgl has a couple of bugs

I'm wondering what sort of bugs as I haven't seen anything untoward in YBAF, YAMB or other airports I've worked with.
 
Hello ! My MSFS 2020 is Microsoft Store. I replaced the original line with E:\MSFS 2020\Official\OneStore\fs-base-genericairports\scenery

I see lots of lines in the command prompt page, but nothing comes out !
I just tested it again on my system to try and extract YAMB and while it says it's saved the xml nothing has appeared, it seems to have found the AP***.bgl file that it's supposed to reside in.

I'm wondering if Asobo has encoded the BGL's or changed the format for the World Hub airports they're prepping to launch...

I'll have to manually run MSFSBGL2XML in a command prompt and see if it brings up any errors. I wish I hadn't deleted my folder the other week that had all of the MSFS airports extracted to XML...
 
I just tried YAMB and it decompiled just fine. I used the -27.63,152.7 coordinates to locate the generic airport file. As far as what doesn't work, you'd need to experiment. One of the nice things about the xml export is you can delete everything but the airport definition, and you have a stub for the airport. If you have only minor additions to make (scenery objects worldscripts etc.) then you don't need to recreate the entire airport.
 
I just tried YAMB and it decompiled just fine. I used the -27.63,152.7 coordinates to locate the generic airport file. As far as what doesn't work, you'd need to experiment. One of the nice things about the xml export is you can delete everything but the airport definition, and you have a stub for the airport. If you have only minor additions to make (scenery objects worldscripts etc.) then you don't need to recreate the entire airport.
Thanks, I may actually use that seeing as my program is now borked for some reason...

I was actually referring to my program at the top of the thread. It worked when I built it, but now isn't saving the XML file. It locates the source BGL file and says it has made the .XML file but nothing appears. Maybe it's because I'm running it from a C drive folder, I had written a program to extract every airport from MSFS but never released it and only used it for my own use to snag the airports I wanted. I then built the extractor to be airport specific but while nothing has changed in my program, now I'm not getting the extracted XML file... hmmm...
 
It doesn't include all the elements of airports, but most. Asobo keeps changing the BGL code and it's hard to keep up. Patrick would probably allow you to use some of his code is you want to pursue this. Just ask him.

Hmmm, I can't recall what I was doing the other day in another program but all the XML schema for MSFS is contained in some propdef files. Now I can't for the life of me recall what I was doing, it had something to do with AI Offline Traffic or AI ATC or something and it had me point to the definitions so it could generate the MSFS xml code... I've been on antihistamine and strong antibiotics which have knocked me out the last week and I would have to backtrack and find what the heck I was doing where I came across that.

If the new or changed stuff is in those schema's then perhaps being able to point and look at those may help with keeping up with changes?

For now I need to call it a night and try and find the bugs in MSFS_Airport_Extractor, find my code that allowed me to decompile every APX*.bgl airport and track down where those schema lived. O.o
 
Back
Top