Community
Hello everyone, I am trying to save the drawing specification with a vba. Trying to do, but not getting
Public Sub XxXxX() Dim oDraw As DrawingDocument Set oDraw = ThisApplication.ActiveDocument Dim oPartsList As PartsList Set oPartsList = oDraw.ActiveSheet.PartsLists. Call oPartsList.Export("C:\XxX.xls", kMicrosoftExcel) End Sub
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
Change the line that starts with "Set oPartsList" line to this:
Set oPartsList = oDraw.ActiveSheet.PartsLists.Item(1)
On an ESKD (GOST) drawing, the parts list is stored as a CustomTable. The following code can be used to export it.
Public Sub XxXxX() Dim oDraw As DrawingDocument Set oDraw = ThisApplication.ActiveDocument Dim oCustomTable As CustomTable Set oCustomTable = oDraw.ActiveSheet.CustomTables.Item(1) Call oCustomTable.Export("C:\XxX.xls", kMicrosoftExcelFormat) End Sub
Note that this works only if the parts list has already been placed on the drawing. Use the Place on Drawing button on the Parts List (список деталей) dialog to place it.
Can't find what you're looking for? Ask the community or share your knowledge.