Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SaveItemOverridesToBOM Bug?

5 REPLIES 5
Reply
Message 1 of 6
stevemattingly6891
522 Views, 5 Replies

SaveItemOverridesToBOM Bug?

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
5 REPLIES 5
Message 2 of 6
Anonymous
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-
Message 3 of 6

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.
Message 4 of 6
Anonymous
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 :).

Sanjay-
Message 5 of 6

Good, I'm not going crazy. Thanks Sanjay!
Message 6 of 6

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

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

Post to forums  

Autodesk Design & Make Report