- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My goal is to be able to take a bunch of data from the BOM, sort it conditionally, and then return a simple list with the document names.
I've come across some good information on LINQ and iComparable for structures/strings but could use some further guidance in what I need to do to make this happen.
Essentially it will be a multi level sort with some logic like:
-> Put objects with 'Drawing' = True first.
-> Sort then by ComponentDefinition/Secondary document desciber;
(ie; assemblies and weldments, then plate, then structural steel, then hardware).
-> Sort Assemblies and weldments by Renamed vs Matl'l Spec then by weight
-> Sort Structural by type, then by size
-> Sort hardware by nomial size, then by type, then by thread unc/unf, then by length
-> Put the remainder last (ie; virtual components.
From what I've read, it seems like I can accomplish this by multiple sets of linq's if I can get it working,
Or I can use a Compare function and just compare each line in its entirety to the next (as my understand of it would suggest?)
So at the end of the day, I would want a list to spit out something like:
3) Drawing - Weldment - Named - Weight
1) Drawing - Assembly - Named - Weight
2) Drawing - Assembly - Unnamed - Weight
3) Drawing - Weldment - unnamed - weight
3) Drawing - Plate - 1" Thick x 48 sq in.
4) Drawing - Plate - 1" Thick x 36 sq in.
5) No Drawing - Plate - 1" Thick X 52 in
6) No Drawing - Plate - 1/2" thick X 52 in
7) No Drawing - 1/2" Bolt - UNC - 3"
8) No Drawing - 1/2" Bolt - UNC - 2"
9) No Drawing - 1/2" Nut - UNC
10) No Drawing - 1/2" Washer
11) No Drawing - 1/4" Bolt - UNC - 2"
12) No Drawing - Virtual Component
Any suggestions/help on the best way to do this would be great, thanks!
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization
iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Solved! Go to Solution.