I've been programming on a specific macro for a while now, and can't get the thing to work the way we want to.
What the macro is does is: A - Ask for a multiplier value (M)B - In a draft parts list lookup the occurrence quantity (Q) via a recursive function in the modeldocument C - put value (M*Q) in a property that can be read from the parts list
This all works properly, but the property is written to a custom property in the occurrence document. This gives problems when a part is used in different parts lists.
I've tried to add a new occurrence property, which doesn't seem possible. I've managed to put the property in attributesets, but I can't find a way to display the attributeset in a parts list.
I'm working with VB 2008
Has anyone got a bright idea? Thanks!
Jochem van Rijswijk
Posted by: Jochem van Rijswijk Post date: 1/24/2012 8:09:07 PM
in general it is not a good practice to save assembly related information into parts. As you already have mentioned this will cause problems if the part is to be used from other assemblies too. You can't save anything into an Occurrence object that is visible/valid to the parent assembly only, because the Occurrence object is unfortunately basically just a reference and not a wrapper with a reference and some own data fields.
A solution could be to use some kind of fake assemblies with just one part, so the fake assembly could be used to save occurrence related data in its properties.
Posted by: Wolfgang Kunert Post date: 1/25/2012 10:21:02 PM