Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Ilogic: Filter Parts list by item range

RainerXGE3N
Contributor

Ilogic: Filter Parts list by item range

RainerXGE3N
Contributor
Contributor

Hi All,

 

Please could you assist me with filtering a parts list in number range. I found the below link that explains it but I just don't know how to define the range.

 

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=PartsListFilterSettings_Add

 

I can't find any examples online

 

My Code:

		oPartsListMAN = oDrawingDoc.Sheets(2).PartsLists.Add(oGADrawingView, oPlacementPoint, PartsListLevelEnum.kStructuredAllLevels)
		oPartsListMAN = oDrawingDoc.Sheets(2).PartsLists.Item(1)
		oPartsListMAN.Style = oDrawingDoc.StylesManager.PartsListStyles.Item("AK Parts List (ANSI)")  

 

I think it should be something like this: 

oPartsListMAN = oDrawingDoc.Sheets(2).PartsLists.Add(PartsListFilterItemTypeEnum.kItemNumberRangeFilterItem, 1 - 5)

Thanks in advanced!

0 Likes
Reply
Accepted solutions (1)
122 Views
2 Replies
Replies (2)

JelteDeJong
Mentor
Mentor
Accepted solution

This example show how to use the function. It will put a filter on 1e partslist of the active sheet.

Its also good to know that this function is only availible on inventor 2024.1 and later.

Also If the same type filter already exists, it returns an error.

 

 

Dim sheet As Sheet = ThisApplication.ActiveDocument.ActiveSheet
Dim partsList = sheet.PartsLists.Item(1)

Try
    Dim options = ThisApplication.TransientObjects.CreateNameValueMap()
    options.Add("ItemNumberRange", "1-5")
    partsList.FilterSettings.Add(PartsListFilterItemTypeEnum.kItemNumberRangeFilterItem, options)
Catch ex As Exception
    MsgBox("Could not set the filter. Maybe it was already set?")
End Try

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

RainerXGE3N
Contributor
Contributor

Hi @JelteDeJong ,

 

Thanks for the reply.

 

This worked perfectly!

 

Thank you,

0 Likes