Hide / Show Assembly BOM Column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all,
I've needed to generate and write unique sort tokens that are applied to a custom iProperty "sortOrder" for each part within my assembly, so that when I run the below code against the sortOrder column, the parts appear in the desired order.
Dim oBOM As BOM = ThisAssembly.Document.ComponentDefinition.BOM
oBOMView = oBOM.BOMViews.Item("Structured")
oBOMView.Sort("sortOrder", True)
oBOMView.Renumber()
Anyone who's tinkered with an Assembly BOM in iLogic has no doubt run this code snippet. But what I've discovered is that this code fails on a Custom iProperty if that iProperty is not activated within the BOM. The problem I have is that my sort Token is a mish-mash of calcs that would confuse users, so needs to be hidden and not in the final export.
Writing this post now though, I think I've discovered a workaround where if instead of a custom iProperty, I use a default stock iProperty - the script doesn't crash regardless of if that stock iProperty BOM column is displayed within the BOM or not.
Figured I'd double check though, is there any way to sort an Assembly BOM via a custom iProperty that's currently hidden within the Assembly BOM without crashing the iLogic rule and failing the BOM sort process?