Hello. I was wondering if anyone could help me with this.
Below is the code I use to create an .IDW, create a partslist and export the partslist as EXCEL.
I need to know if I can expand all children before exporting it.
SyntaxEditor Code Snippet
v_RutaYNombre= ThisDoc.PathAndFileName(False)
Dim v_DocReferencia As Document = ThisApplication.ActiveDocument
Dim v_Plano As DrawingDocument = ThisApplication.Documents.Add(kDrawingDocumentObject, "V:\Templates\Templates 2017\INOXPASER\INOXPASER MECANIZADO ISO2768m2017.idw", True)
Dim v_Hoja As Sheet = v_Plano.ActiveSheet
Dim v_GeoTrans As TransientGeometry = ThisApplication.TransientGeometry
v_Opciones = ThisApplication.TransientObjects.CreateNameValueMap
v_ManagerEstilos = v_Plano.StylesManager
v_EstiloLista = v_ManagerEstilos.PartsListStyles.Item("BOM")
v_Plano = ThisApplication.ActiveDocument
v_Plano.SaveAs(v_RutaYNombre & "BOM.idw",False)
v_VistaSuperior = v_Hoja.DrawingViews.AddBaseView(v_DocReferencia,v_GeoTrans.CreatePoint2d(-15,0 ),.25,ViewOrientationTypeEnum.kTopViewOrientation,DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle,,,)
v_Marco= v_Hoja.Border
v_ListaPiezas = v_Hoja.PartsLists.Add(v_VistaSuperior, v_Marco.RangeBox.MaxPoint,PartsListLevelEnum.kStructuredAllLevels)
v_Hoja.PartsLists(1).Style = v_EstiloLista
v_Opciones.Value("AutoFitColumnWidth") = True
v_ListaPiezas.Export(ThisDoc.Path & "\BOM.xls", PartsListFileFormatEnum.kMicrosoftExcel,v_Opciones)
v_Plano.Close
My.Computer.FileSystem.DeleteFile(v_RutaYNombre & "BOM.idw")
I'm posting 2 images:
1 As the partslist comes with my code
1 As it should be (with all levels expanded)


Thanks in advance!