CAD FORUM - TIPS & TRICKS | UTILITIES | DISCUSSION | BLOCKS | SUPPORT | HELP & ASSISTANCE
Over 1.121.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
The new Beam calculator, Spirograph generator and Regression curves in the Converters section.
New AutoCAD 2027 commands and sys.variables
CAD tip # 11732:
Question
A
You can change sort order of your parts list in an Inventor drawing using the following simple iLogic rule - it re-sorts the partlist so that its individual items (rows) are listed in ascending order their part number.
The re-sorted parts list can be then renumbered starting by 1.
On Error Resume Next Dim oDwgDoc As DrawingDocument oDwgDoc = ThisApplication.ActiveDocument Dim oPartsList1 As PartsList oPartsList1 = oDwgDoc.ActiveSheet.PartsLists.Item(1) If oPartsList1 Is Nothing Then MsgBox ("No parts list!") Else oPartsList1.Sort("PART NUMBER") ' Needs to be localized: e.g. BAUTEILNUMMER (de), ČÍSLO SOUČÁSTI (cz) oPartsList1.Renumber End If
If you need to change sort order of your assembly BOM in a similar way, use the following iLogic rule:
'Get active assembly Dim activeAssembly As AssemblyDocument = ThisApplication.ActiveDocument 'Get structured bom view Dim bomView As BOMView = activeAssembly.ComponentDefinition.BOM.BOMViews(2) 'Sort by Part Number Call bomView.Sort("Part Number", True) 'Renumber rows Call bomView.Renumber(1, 1)
For automatic sorting on updates ("Auto Sort on Update") use the code:
Sort2(,,True)
Inventor
14.12.2017
31594×
this tip shared by ARKANCE experts applies to: Inventor ·
![CAD Forum - ARKANCE Community - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

What is the ARKANCE Community?