How to Override BOM ItemNumber without Parent Prefix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've done about as much searching as I can and I cannot find an answer to the problem I'm having.
The design firm I work for is small and pretty much all of our projects are One-Off's. As such, we don't create part numbers for our clients drawings we only list items by Item, Qty, Description, and Material. Currently there is no way inside of inventor to add a parts Item Number tag to a drawing view label. Because of this, I've had to create my own Custom Property called #ITEM for each part. Currently I've been testing this out on my own before releasing it to all of the other designers here, but as such....I've been trying to make it more fool-proof and user friendly.
Currently I have a button on my add-in that updates the BOM "Item" column to each parts "#ITEM" property, however, I've run into a bit of a snag....
If I have 2 of the same part that is used in 2 different assemblie (ie. mirrored assemblies with all the same sub-components), then basically whichever part comes last is what values the #ITEM property gets set to. So I wrote a comparison function to compare values using regular expressions to see which is the lowest item number to use. All works great up to this point. The problem is, that I want to update the BOM ItemNumber field to match the #ITEM, but whenever I try to override the BOM ItemNumber in the Structured BOM, the new ItemNumber ALWAYS uses the parent assembly's ItemNumber as a prefix.
Check out my image...
2 different assemblies with identical parts. But Dummy Prt1 and Dummy Prt2 are named after item 2.1 and 2.2. If I try to renumber the BOMRow for 2.1, no matter what I do, I always get the prefix "2." on my new name. I've even tried wiping out the ItemNumber before renaming in my subroutine.
BOMRow(2).Childrows(1).ItemNumber = ""
This would give me an Item Number = "2."
If I tried BOMRow(2).Childrows(1).ItemNumber = "1.1"
I would get ItemNumber = "2.1.1"
That being said, inside of the BOM, I can manually change a BOMRow ItemNumber and it sticks..... without the prefix.
The only way I can think of dealing with this issue is leaving the BOM numbers alone and combining #ITEM numbers like 1.1/2.1. This seems like such a stupid problem to have for a piece of software that SHOULD have this functionality inside of it already. I feel like I'm constantly fighting this software because we don't do things exactly the way Autodesk thinks we should and I spend the vast majority of my day trying to find work-arounds. And then when I finally think I have a solution.....I find another problem because things don't behave as expected (as is my discoverer with changing a BOM Row Item number with the API).