INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

BOM sort and renumber

BOM sort and renumber

(OP)
Owing to a job change, I've transferred in from SolidWorks. Used the SW forum on here a bit but need some Inventor help now!

When creating a parts list on a drawing, I notice my item numbers are often out of sync. As part of our issuing procedure we:

- RMB on the view > Bill of Materials,
- Go to Structured,
- Highlight all and expand
- Sort by Part Number
- Renumber
- Repeat most of this for the Parts Only BOM.

Whilst in there we also have to output an Excel version of both BOM's for BOM department to process.

Doing this day in, day out is getting a bit tedious... Can I automate any/all of this? I'm afraid I have zero experience in iLogic or code, but some of the guys here possibly do so any pointers would be helpful.

The dream would be a button I can click, which expands, both BOM's, sorts, renumbers then exports an Excel of each to a set location (always the same). Am I dreaming or is this possible?


RE: BOM sort and renumber

When dreams become reality... 2thumbsup
This will sort the parts list by part number then renumber the parts list then save those overrides to the BOM.. Then export an excel file of the parts list..



CODE --> iLogic

'start of iLogic code----------------------------------------------------------------------------------
'sort parts list
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oPartsList1 As PartsList
oPartsList1 = oDrawDoc.ActiveSheet.PartsLists.Item(1)
If Not oPartsList1 Is Nothing Then 
Call oPartsList1.Sort("PART NUMBER") 'sort by part number
oPartsList1.Renumber 'renumber the parts list
oPartsList1.SaveItemOverridesToBOM 'save overrides to BOM
End If

'------------------------------------------------------------------------------------------------------------
'-------------Export Parts List ------------------------------------------------
Dim oDoc As Inventor.DrawingDocument
oDoc = ThisDoc.Document

Dim oSheet As Inventor.Sheet
'oSheet = oDoc.Sheets(1) ' first sheet
oSheet = oDoc.Sheets("Sheet:1") ' sheet by name

' say there is a Partslist on the sheet.
Dim oPartslist As PartsList
oPartslist = oSheet.PartsLists(1)

' export the Partslist to Excel.

'folderName = "C:\temp" 'Excel file will be saved here or uncommend the line below
folderName = ThisDoc.Path
oPartslist.Export(folderName & "\Partslist.xlsx", PartsListFileFormatEnum.kMicrosoftExcel)

'----------------------------------
'---Display Message box that all is completed
MessageBox.Show("Parts List Sorted and Exported", "Sort-Export") 

RE: BOM sort and renumber

(OP)
WOW - that's impressive! I need to learn how to perform this voodoo! What would you say is the best way to learn it? Are the Inventor tutorials good?

I'll have a play with getting this working for a start then perhaps when I start to understand how it works I can make adjustments to suit. Thanks very much for the help!

RE: BOM sort and renumber

My "google foo" skills are strong grasshopper...
That and my "cut and paste" skills
and I "dabble" in some programming (microprocessors/web pages) so I can usually give it the brute force attack and get it to work..

I did not write that at all.. (I did add the message box at the end because it was just a silent process and I like to know it worked)..
There isn't much if any error checking but it should do the job..and did just fine when I tried it..

Curtis has some good simple tutorials on ilogic (He is my go to guy for ilogic.. he has written some great ones for me in the past)
http://inventortrenches.blogspot.com/

Haven't seen any really good ones from Inventor other than blog posts from some of the "geeks" over there..
Well I guess they have some..
http://knowledge.autodesk.com/support/inventor-pro...
http://help.autodesk.com/view/INVNTOR/2015/ENU/?gu...

and just a FYI..
The Autodesk Inventor forums get much more "traffic" and eyes than on this board..but some of us do frequent here too..
The general board..
http://forums.autodesk.com/t5/Inventor-General/bd-...
also customization board that has lots of coding examples/problems...
http://forums.autodesk.com/t5/inventor-customizati...




Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close