Not all actions in the user interface can be recorded by the macro recorder. Also, not all API methods do exactly the same as a user would.
I've just tried this piece of code from the help and it works (of course):
Thanks for that Peter! Just tried it out and it works, but is it possible for this to be modified to show a detailed cutlist with flat numbering? My macro knowledge goes as far as using the record function
That should be possible I've also found that the latest version of the InsertBomTable method is version 4. We were using version 2 still.
To change the mode info indented, you should change the following line:
BomType = SwConst.swBomType_e.swBomType_TopLevelOnly
BomType = SwConst.swBomType_e.swBomType_swBomType_Indented
Then change the insertion line into:
Set swBomAnn = swView.InsertBomTable4(False, 0.4, 0.3, AnchorType, BomType, "Default", "C:\Program Files\SolidWorks\lang\english\bom-standard.sldbomtbt", False, swNumberingType_e.swNumberingType_Flat, True)
For this last line to work, you have to make sure the configuration name is correct otherwise it won't insert anything. Also change the location of the template to your BOM template location. You might want to change the anchor point so it'll get placed somewhere more convenient.
More info on InsertBomTable4 here.
Thanks once again Peter! I will try this out when I have some spare time, hopefully I can get it to work