SaveItemOverridesToBOM Bug?

SaveItemOverridesToBOM Bug?

Anonymous
Not applicable
1,055 Views
5 Replies
Message 1 of 6

SaveItemOverridesToBOM Bug?

Anonymous
Not applicable
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
0 Likes
1,056 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
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-
0 Likes
Message 3 of 6

Anonymous
Not applicable
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.
0 Likes
Message 4 of 6

Anonymous
Not applicable
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 :).

Sanjay-
0 Likes
Message 5 of 6

Anonymous
Not applicable
Good, I'm not going crazy. Thanks Sanjay!
0 Likes
Message 6 of 6

LSA-skan
Advocate
Advocate

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.. 🙂

 

/LSA-Skan

0 Likes