Hi,
I asked a colleague in Inventor Engineering and he confirms that the Inventor BOM is stored in the Master Level Of Detail and suppression can only take place in a non-master LOD. This effects behavior in the Inventor API including iLogic. (you can see this in the user interface too)
Here is an approach to consider:
Have two rules. Run this rule with the custom level of detail current:
' Change this to the parts you want to suppress
Component.IsActive("Part_WB_2-24-16:2") = False
Component.IsActive("Part_WB_2-24-16:3") = False
Then switch to the Master level of detail and run this rule to get just the non suppressed occurrences:
ThisBOM.Export("Structured", "BomExport.txt", kTextFileTabDelimitedFormat)
'Change this to the parts in your assembly
quantity = ThisBOM.CalculateQuantity("Model Data", "Part_WB_2-24-16")
MessageBox.Show("Number of Part_WB_2-24-16 Not suppressed = " & quantity, "Title")
This works because the iLogic Component.IsActive("xxxx") = False statement not only suppresses the component, but also sets the BOM Structure to Reference. This takes it out of the BOM. So even though there are no suppressed components in Master, they will still have their BOM Structure set to Reference. That’s the same in all LODs.
The ThisBOM.Export statement is required to make sure that the BOM is up to date before trying to get a quantity out of it.
If you want a change so that you could directly get the suppressed parts in the Inventor API please log it on the Inventor idea station:
http://forums.autodesk.com/t5/inventor-ideastation/idb-p/v1232/tab/most-recent
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network