VB.net Quantities from BOM not showing correct value

Using VB.net to pull BOM into a stand-alone API.

We have two DIN rails in the assembly - one the designer used in the model, which is excluded from the BOM, and one which is used in the BOM and has a length of 500mm.

When I pull the BOM into my API, I get 2 entries.  Both have QTY = 1.  When I view this assembly in PDM though it has one entry, with QTY = 500.

1.  How do I flag lines in the BOM where the part is excluded?

2.  Where do I get the actual length quantity from?  

Code snippets:

bomView = aFile.GetComputedBOM(ppoRetLayout.mbsLayoutName, -1, "@", EdmBomFlag.EdmBf_AsBuilt + EdmBomFlag.EdmBf_ShowSelected)

...

bomView.GetRows(ppoRows)
bomView.GetColumns(ppoColumns)

....

ppoRow = ppoRows(i)

ppoRow.GetVar(ppoColumns(4).mlVariableID, ppoColumns(4).meType, poValue, poComputedValue, pbsConfiguration, pbReadOnly)
sQty = poValue.ToString

SolidworksApi/macros