Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save specification with VBA from drawing

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
qqwerr19942017
407 Views, 3 Replies

Save specification with VBA from drawing

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

Screenshot_1.jpg

3 REPLIES 3
Message 2 of 4
MjDeck
in reply to: qqwerr19942017

Change the line that starts with "Set oPartsList" line to this:

Set oPartsList = oDraw.ActiveSheet.PartsLists.Item(1)

Mike Deck
Software Developer
Autodesk, Inc.

Message 3 of 4
qqwerr19942017
in reply to: MjDeck

Does not workScreenshot_5.jpgScreenshot_4.jpg
Message 4 of 4
MjDeck
in reply to: qqwerr19942017

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.

 


Mike Deck
Software Developer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report