Inventor Customization

Reply
Distinguished Contributor
stevemattingly6891
Posts: 326
Registered: ‎12-04-2003
Message 1 of 6 (242 Views)

SaveItemOverridesToBOM Bug?

242 Views, 5 Replies
09-10-2008 01:48 PM
I am trying to make a macro that adds the vendor column to the end of a parts list, sort by it first, then by part number, renumber the parts list, then save the overrides to the BOM. Everything works great except for saving the overrides to the BOM. The item number sort order gets jumbled back up. I am using Inventor 2008 Pro SP2. Below is the code:

Public Sub SortPartsList()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oPartsList As PartsList
Set oPartsList = oDoc.ActiveSheet.PartsLists.Item(1)
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
Dim oPropSet As PropertySet
Set oPropSet = oPropsets.Item("Design Tracking Properties")

Dim found As Boolean
found = False
Dim j As Long
For j = 1 To oPartsList.PartsListColumns.Count
If LCase(oPartsList.PartsListColumns.Item(j).Title) = "vendor" Then
found = True
End If
Next

If found = False Then
Call oPartsList.PartsListColumns.Add(kFileProperty, oPropSet.InternalName, oPropSet.Item(15).PropId)
End If

Call oPartsList.Sort("VENDOR", True, "PART NUMBER", True)

oPartsList.Renumber

oPartsList.SaveItemOverridesToBOM

End Sub
*Sanjay Ramaswamy \(Autodesk\)
Message 2 of 6 (242 Views)

Re: SaveItemOverridesToBOM Bug?

09-12-2008 11:11 AM in reply to: stevemattingly6891
Have you tried the last 2 steps (renumber and save item overrides) via the
user interface? Do you see the same problem there? Or is this issue specific
to the API?

Sanjay-
Distinguished Contributor
stevemattingly6891
Posts: 326
Registered: ‎12-04-2003
Message 3 of 6 (242 Views)

Re: SaveItemOverridesToBOM Bug?

09-12-2008 11:22 AM in reply to: stevemattingly6891
Yes. When I try it through the user interface, all works fine. So far what I've been doing is running the whole macro except for the last line (oPartsList.SaveItemOverridesToBOM). This sorts the parts list properly, but I have to save overrides to the BOM in the user interface. It still saves about 8 clicks or so. Seems to be an issue with the API.
*Sanjay Ramaswamy \(Autodesk\)
Message 4 of 6 (242 Views)

Re: SaveItemOverridesToBOM Bug?

09-12-2008 02:43 PM in reply to: stevemattingly6891
I'm able to reproduce the problem on Inventor 2008. The good news is that it
has been fixed in Inventor 2009. Just the reason you've been waiting for to
upgrade :smileyhappy:.

Sanjay-
Distinguished Contributor
stevemattingly6891
Posts: 326
Registered: ‎12-04-2003
Message 5 of 6 (242 Views)

Re: SaveItemOverridesToBOM Bug?

09-15-2008 11:41 AM in reply to: stevemattingly6891
Good, I'm not going crazy. Thanks Sanjay!
Valued Contributor
LSA-skan
Posts: 95
Registered: ‎08-09-2012
Message 6 of 6 (104 Views)

Re: SaveItemOverridesToBOM Bug?

02-04-2013 03:53 AM in reply to: stevemattingly6891

Hi

 

I need a simular rule for my drawings...

 

but this rule doesn't seem to work in Inventor 2013.

 

Error on Line 3 : 'Let' and 'Set' assignment statements are no longer supported.
Error on Line 6 : 'Let' and 'Set' assignment statements are no longer supported.
Error on Line 8 : 'Let' and 'Set' assignment statements are no longer supported.
Error on Line 10 : 'Let' and 'Set' assignment statements are no longer supported.

 

Im actually only interested in the renumber items, and Save items overides to BOM functionality.. :smileyhappy:

 

/LSA-Skan

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube