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

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