Altium
Gerber File Elements
Here is an example of an input XML element that corresponds to a Gerber file:
<pcbTreeBean>
<comments>
<comment>Layer_Physical_Order=3</comment>
<comment>Layer_Color=8421376</comment>
</comments>
<name>xxx.GP2</name>
<nodes />
<properties>
<propertyBean>
<propertyName>Type</propertyName>
<propertyValue>Gerber</propertyValue>
</propertyBean>
</properties>
</pcbTreeBean>
<pcbTreeBean>
A propertyBean element whose propertyName is equal to Is Silkscreen is added to all Gerber file pcbTreeBean elements. The propertyValue is set to true if the extension of the Gerber file is .gto or .gbo. Otherwise, propertyValue is set to false. For the example listed above, the Is Silkscreen property is set to false.
All other propertyBean elements are added only to pcbTreeBean elements that correspond to a Gerber file for a copper layer. A pcbTreeBean corresponds to a Gerber file for a copper layer if it contains a comment element that matches the pattern Layer_Physical_Order=<layer-number>.
propertyBean elements are added as follows:
Value of the Layer Name property is set to the extension of the Gerber file. For the example listed above, it is GP2.
Value of the Layer Number property is set to <layer-number>. For the example listed above, it is 3.
Material Thickness property is not set.
Drill File Elements
For all Altium drill files, the property Is Probe Drill File is always set to false.
If the name of the drill file contains the string BoardEdgeRout, the property Is External Contour Drill File is set to true; for all other cases it is set to false. For the example of a drill file listed below, Is External Contour Drill File is false.
Information about tool properties and start and end layers is extracted from the comments element of the pcbTreeBean element that corresponds to the legend file. The legend file should have the same name as the drill file and extension .drr. Here is an example of pcbTreeBean elements that represent the drill file xxx.txt and its corresponding legend file xxx.drr for top and bottom copper layers:
<pcbTreeBean>
<comments>
</comments>
<name>xxx.TXT</name>
<nodes />
<properties>
<propertyBean>
<propertyName>Type</propertyName>
<propertyValue>Drill</propertyValue>
</propertyBean>
</properties>
</pcbTreeBean>
<pcbTreeBean>
<pcbTreeBean>
<comments>
<comment>Layer Pair : Top to Bottom</comment>
<comment>ASCII RoundHoles File : xxx.TXT</comment>
<comment>EIA File : xxx.DRL</comment>
<comment>Tool Hole Size Hole Tolerance Hole Type Hole Count Plated Tool Travel</comment>
<comment>T1 8mil (0.203mm) Round 10 PTH 10.10inch (256.44mm)</comment>
</comments>
<name>xxx.DRR</name>
<nodes />
<properties>
<propertyBean>
<propertyName>Type</propertyName>
<propertyValue>Info</propertyValue>
</propertyBean>
</properties>
</pcbTreeBean>
<pcbTreeBean>
<comments>
<comment>Layer_Physical_Order=1</comment>
<comment>Layer_Color=65280</comment>
</comments>
<name>64002903C.GTL</name>
<nodes />
<properties>
<propertyBean>
<propertyName>Type</propertyName>
<propertyValue>Gerber</propertyValue>
</propertyBean>
</properties>
</pcbTreeBean>
<pcbTreeBean>
<comments>
<comment>Layer_Physical_Order=4</comment>
<comment>Layer_Color=255</comment>
</comments>
<name>64002903C.GBL</name>
<nodes />
<properties>
<propertyBean>
<propertyName>Type</propertyName>
<propertyValue>Gerber</propertyValue>
</propertyBean>
</properties>
</pcbTreeBean>
Information about start and end layers is extracted from the comment element that matches the following pattern: Layer Pair : <start-layer-identifier> to <end-layer-identifier>. The value of the Start Layer property is set to the Layer Name property of the last layer if <start-layer-identifier> is equal to Bottom; otherwise it is set to the Layer Name property of the layer with number 1. The value of the Start Layer property is set to the Layer Name property of the layer with number 1 if <end-layer-identifier> is equal to Top; otherwise it is set to the Layer Name property of the last layer. For the example listed above, Start Layer is GTL and End Layer is GBL.
Information about tool properties is extracted from the comment element that matches the following pattern: T<tool-number> <tool-diameter><diameter-unit> <any-symbols> <holes-quantity> <is-plated> <any-symbols>, where <is-plated> is either PTH or NPTH. For each such element, a new pcbTreeBean element is added. The name element of the new node is not set. The properties element is populated as follows:
Value of the Tool Number property is set to <tool-number>. For the example listed above, it is 1.
Value of the Diameter property is set to <tool-diameter>. For the example listed above, it is 8.
Value of the Unit property is set to MM if the <units> string is equal to mm, and it is set to MIL if the <units> string is equal to mil. For the example listed above, the Unit property value is MIL.
Value of the Is Plated property is set to true if <is-plated> is equal to PTH, and it is set to false if <is-plated> is equal to NPTH. For the example listed above, the Is Plated property value is true.
Value of the Holes Quantity property is set to <holes-quantity>. For the example listed above, it is 10.
Positive Tolerance, Negative Tolerance, and Index In File aren’t set.
If no legend file that matches the drill file is found, the Start Layer value is set to the Layer Name property of the layer with number 1, and the End Layer value is set to the Layer Name property of the last layer. Tool metadata is extracted from the header of the drill file as described for PCB models generated by PADS (see Drill File Elements).
Top-level Element
No properties of the whole board are extracted for PCB models generated by Altium.
Recommended File Format
Gerber files that correspond to the copper layers must include a comment with the information about layer physical order.
aPriori recommends that you include the legend in the .zip archive for a PCB model. This allows the extraction of as much drilling information as possible.