Creating a virtual component for each model states and giving it mass
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to replicate an annoying feature of some of our client's BoM's on multi-assembly drawings. They use a REALLY annoying format for multi assembly BoM (see image).
For the last two years we've used all sorts of fudges with a mix of sketch symbols and manual BoM overrides but it's horrible so I'm looking to make something better.
The solution I've come up with (that works 100% if I do it manually) is to:
- [Assy] Create a model state called [Primary] that contains a virtual component for each configuration and has everything else supressed.
- [Assy] Set the relevant iProps in each virtual component to match the model state iProps (part number, stock number (what we use for part number), description etc.
- [Dng] Drop in base views for each model state and then insert a parts list for each, using a style with a header for the [Primary] and a style with no header (the red boxes) for the sub parts.
This is way better on the drawing, because I only have to hide a couple of rows and update a couple of columns with static values, but it’s a faff so I’m trying to automate.
I’m “low to moderate” with iLogic but I’ve gathered up a load of code snippets and put something together that is working ok.
Only problem is that when I try to add the mass properties to the virtual components I get really strange behaviour – it’s row 98 in the attached code.
For some reason the masses don't update to be correct, instead they are like 6 x the value they should be. I'm wondering if I need to use a different line to get the mass just for the model state or something?
Note, the code's a work in progress and I'm enjoying working on it and learning - just spending an unreasonable amount of time on this mass issue so wanted to ask for some help 😞
I’ve attached the full code below for review – is anyone able to help me out with what I’m doing wrong?