CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 516 

CAD tip CAD tip # 11732:

Question CAD 
 %  platform  category 
Q - question

How to sort BOM or parts list by part number in Inventor? (iLogic)

A - answer 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!")
	oPartsList1.Sort("PART NUMBER") ' Needs to be localized: e.g. BAUTEILNUMMER (de), ČÍSLO SOUČÁSTI (cz)
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)
100% *  CAD 
14.12.2017    1512×  
Comments   Tell a friend
applies to: Inventor ·

See also:
Tip 11614:How to reorder custom properties in a dynamic block?
Tip 11581:How to compare changes between two versions of a Revit BIM project?
Tip 11575:What is the Linked account in your Autodesk Account profile?
Tip 11277:How to share simulation results from Fusion 360?
Tip 11160:Dynamic display of layer/block/text style/linetype properties.

Back   All CAD Tips All CAD tips&tricks

How to enter the symbol № (numero) in AutoCAD? « | » Select objects by annotation scale.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Add .CIT raster format support to AutoCAD and Map and Civil 3D
CITin More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.