• 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.

MSFS ade f20 xml in ade p5

Messages
1
Country
italy
Hello,

is it possible to import an xml exported from ade f20 into ade p5? my goal is to take an airport from f20 to put it in p3d v5

thank you
 

RicherSims

Resource contributor
Messages
565
Country
dominica
In case any one is wondering how to do this, it is possible.

You will have to edit the XML from ADE F20 to remove any unsupported tags that the importer throws errors about (such as Apron Surface GUIDs, groundMerging, isRectangle, etc).
It's also recommended to use "Open Airport from XML" instead of "Import XML". The latter does not seem to work.

The entire airport layout should then show up nicely.
 

RicherSims

Resource contributor
Messages
565
Country
dominica
So turns out there's a LOT of stuff that's supported by MSFS but not by P3D, so weeding them out can be sort of a pain.
In the true essense of "spend several hours automating the process instead of a few hours doing it manually", I built a powershell script that should remove most of the unsupported nodes and attributes from an XML exported from ADE F20.
Find attached.
Apart from unsupported attributes like "snapToGround", "snapToNormal", "groundMerging" etc, here are the things it removes completely:

  • the DeleteNavigation node
  • RunwayDeformation nodes
  • Any Jetway
  • Any SceneryObject that references a SimObject
  • Changes all Surface GUIDs to "ASPHALT"
Simply run the script in powershell, it supports dragging and dropping XML files onto it. The output file is saved with a suffix "_modified.xml" which should import nicely into ADE P4 1.78.

Most of the code was written with the help of ChatGPT.



PHP:
function Remove-NodeAttributes {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [string]$Node,

        [Parameter(Mandatory=$true)]
        [string[]]$AttributesToRemove
    )
    
    $selectedNodes = $xml.SelectNodes("//"+$Node)
    
    foreach ($selectedNode in $selectedNodes) {
        # Remove each specified attribute from the node
        foreach ($attribute in $AttributesToRemove) {
            $selectedNode.RemoveAttribute($attribute)
        }
    }
}

function DeleteNode {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [string]$Node
    )

    # Delete node   
    # Select the nodes
    $deleteNodes = $xml.SelectNodes("//"+$Node)

    # Delete each  node
    foreach ($deleteNode in $deleteNodes) {
        [void]$deleteNode.ParentNode.RemoveChild($deleteNode)
}
}

# ADE F20 uses open and close tags for TaxiwayPath elements. ADE P4 uses only a single empty tag. We need to update these to avoid errors
function UpdateToEmptyTags {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [string]$Node
    )
    
    # Select all matching nodes
    $selectedNodes = $xml.SelectNodes("//"+$Node)
    
    foreach ($selectedNode in $selectedNodes) {
    
        # Replace the node with an empty tag
        $newNode = $xml.CreateElement($Node)
        $selectedNode.Attributes | ForEach-Object {
            [void]$newNode.SetAttribute($_.Name, $_.Value)
        }
        $selectedNode.ParentNode.ReplaceChild($newNode, $selectedNode)
    }
}



# Get the path to the XML file
$xmlFilePath = Read-Host "Enter the path to the XML file"

# Load the XML file
$xml = New-Object -TypeName System.Xml.XmlDocument
$xml.Load($xmlFilePath)

DeleteNode -Node "DeleteNavigation"

Remove-NodeAttributes -Node "SceneryObject" -AttributesToRemove @("snapToGround", "snapToNormal")
Remove-NodeAttributes -Node "Airport" -AttributesToRemove @("altType","isOnTIN","onlyAddIfReplace","applyFlatten","starAirport","closed","groundMergingTransfertBright","groundMergingTransfertDark")
Remove-NodeAttributes -Node "DeleteAirport" -AttributesToRemove @("deleteAllLightSupports","deleteAllTerminalNDBs","deleteAllPaintedElements","deleteAllTaxiwaySigns","deleteAllTerminalWaypoints","deleteAllILSs","deleteAllDepartures","deleteAllArrivals")
Remove-NodeAttributes -Node "Runway" -AttributesToRemove @("altType","falloff","groundMerging","excludeVegetationAround")

DeleteNode -Node "RunwayDeformation"

Remove-NodeAttributes -Node "ApproachLights" -AttributesToRemove @("offset","slope","spacing")
Remove-NodeAttributes -Node "RunwayStart" -AttributesToRemove @("altType")
Remove-NodeAttributes -Node "TaxiwayParking" -AttributesToRemove @("has3DMesh","numberMarking","suffix")
Remove-NodeAttributes -Node "TaxiwayPath" -AttributesToRemove @("enhanced","groundMerging","excludeVegetationAround","excludeVegetationInside")

DeleteNode -Node "Jetway"
DeleteNode -Node "SceneryObject[SimObject]"

Remove-NodeAttributes -Node "Apron" -AttributesToRemove @("opacity","localUV","stretchUV","isRectangle","tiling","falloff","groundMerging","excludeVegetationAround","flipUV","offsetU","offsetV","excludeVegetationInside","priority")
Remove-NodeAttributes -Node "Vertex" -AttributesToRemove @("spline")
Remove-NodeAttributes -Node "TaxiwayPath" -AttributesToRemove @("centerLine","centerLineLighted","leftEdge","leftEdgeLighted","rightEdge","rightEdgeLighted")

#Update TaxiWayPath nodes from using open and close tags to singular empty tags
UpdateToEmptyTags -Node "TaxiwayPath"

# Save the modified XML to a new file
$outputFilePath = $xmlFilePath -replace '\.xml$', '_modified.xml'
$xml.Save($outputFilePath)

$xml = Get-Content -Path $outputFilePath
$xml = $xml -replace 'surface="{.*?}"','surface="ASPHALT"'
Set-Content $outputFilePath $xml

Write-Host "Modified XML saved to $outputFilePath"
 

Attachments

  • ADE F20 - P4 XML.ps1.zip
    1.4 KB · Views: 67
Top