- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report