Hi
if i copy a drawing view to a new drawing and run my routine to create a partslist on "Parts Only", it works just fine but if i run the same routine on the same drawing view in an existing drawing sheet, the partslist defers to a "Structured" view.
in code, how can i force a Parts Only partslist to be created?
i have tried enabling the Parts only like this-
Dim sDoc As AssemblyDocument Set sDoc = ThisApplication.Documents.Open(omodelPath, True) Dim oBOM As bom Set oBOM = sDoc.ComponentDefinition.bom 'component definition does not work ' Make sure that the structured view is enabled. oBOM.StructuredViewEnabled = False oBOM.PartsOnlyViewEnabled = True sDoc.Save2 sDoc.Close Set sDoc = Nothing
This opens the drawing view reference and attempts to enable the BOM view but nothing works, i still get a structured parts list
Ideally, i would like to do this in the drawing sheet without opening the assembly
Thanks
Nigel
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Hello,
do you use PartsLists.Add in your routine that creates a partslist in the drawing? If so, do you set the third parameter to kPartsOnly?
For example:
oSheet.PartsLists.Add(oDrawingView, oPlacementPoint, kPartsOnly)
Regards,
Lubomir