Message 1 of 7
VB.net Custom sorting in BOM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a script that sorts the assembly BOM based on two properties, Type and Part Number. Type previously contained three values of (blank), M(ake), or B(uy), which by random change would sort in the preferred order using a descending sort. The resulting order is M, B, (blank). The second Part Number sort would sort all of the items in each Type by part number.
My problem now is I want to add R(eference) to the Type properties, but the descending sort order won't be in the order I want. I want the order to be M, B, R, (blank).
I'm using the code below currently. Is there a way to get the Type to sort in a custom order of my choosing and not just ascending or descending alphanumeric order?
Dim oBOM As BOM = oAssydoc.ComponentDefinition.BOM oBOM.StructuredViewEnabled = True oBOM.StructuredViewFirstLevelOnly = False Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured") Call oBOMView.Sort("REQ Type", False, "Part Number", True)