Yes, I figured out it has no business to be in .idw file, as you can see in my previous post.
The rule has been added to the main assembly file, the one with View Reps that are used for parts lists generation.
I wrote it does not work, with no detailed description, because it just does not work: makes no difference if the rule is there or if is not. No warnings, pop ups, no nothing. No changes to Parts Lists display: total number of the parts is shown if only one out of few is visible in the view.
Does it work for you?
The code posted by Curtis, works as he descibed. I tested it in a simple assembly
changing a component to be not visible changes the BOM structure to Reference and vice versa
Are you sure the rule is being fired?
When I open standard template, the rule seems to work partially; it sets parts to reference parts but then BOM does not change when I turn visibility on and off.
The other thing is that my QTY comes from iproperty, that is connected to user parameters of a part, not actual number of parts in assembly. Then iproperty numbers are substituted for QTY.
On the picture you can see that I have 3 parts out of 6 visible, BOM shows only 1, the rest is set to reference.
I am using Inventor 2012 with 64 bit Windows 7.
I have the view representation assembly open.
Created the rule, cut and pasted the code.
I am getting the following Errors:
Rule Compile Errors in View_Rep_BOM, in 11-647-12.iam
Error on Line 13 : Method arguments must be enclosed in parentheses.
Error on Line 17 : Method arguments must be enclosed in parentheses.
I have tried putting brackets in, but cannot make it happy. Any help would be much appreciated.
Sometimes copy/paste from this board scews up code. Nobody knows why. Copy your rule and paste into a txt file, post it, and I'll correct it.
The code looks fine to me. Is that the entire contents of the rule, or do you have another section that you didn't include? You can try this copy, it's just reformated a little.
If that is the whole rule and the new copy doesn't work then can you post up the data set for me to investigate?
Thanks Mike (not Matt)
That was the whole rule.
I don't see that you sent any copy for me.
I am not sure what you require when you ask for the data set.