Thanks very much Mike.
Hopefully this all will be useful to others in the future. If only the others at my work knew what went in to switching on and off this freakin' bracket!
I'm using this code, and it works like a charm!
in some cases i suppress some parts in element 1. Is it possible to make a rule which suppresses the same parts in element 2, 3, etc when the part is suppressed in elemnt 1?
I have a hot job right now, but try playing around with the attached code (ignore the "do not change" comments, those are for my co-workers) and see what it does for you. I can come back later and write something specifically tailored to your situation if you need it.
By the way, you shouldn't post a reply in an old thread posing a new question. It makes it harder for other forum users to find answers through the search function. Instead, you should have created a new thread with a link referencing back to this thread.
To be honest, this code is way beyond my knowledge in programing and iLogic. Is there any books you can recommend, like iLogic for dummies or something?
Are you familiar with level of detail reps? I think your problem may be related to your patterned sub-assemblies toggling from your custom LOD to the master LOD, which happens when you work with parts lists. If this is the case, the code I posted in the last reply should help you as is. Try adding it as a rule and see what it does for you. Just edit the LODname = "Custom" line to whatever name you're setting your LODs to (or don't).
I keep this rule in the root of my project's work directory and call it as an external rule in my assembly template.
Yes, I`m familiar with LOD.
All the sub assemblies are in a LevelofDetail01, so this is working. I tried your code, and it only sets the lod to custom, which in my case doesn`t change anything.
The photos of my problem is attached.
My assembly consists of vertical posts which are lined up next to each other with a center distance. There is a total of 20 posts, and I have a parameter which is called No_of_posts. If i set no of post to 16, it will suppress 4 posts etc. The rails are connected to each post. If I have 15 posts, there will be 14 rails. The rails is suppressd automatically depending on the number of posts. So the rails which should be copied into a pattern is ready. I set the post to a maximum of 20 posts, then all the rails which should be copied is active. I make a pattern with a total of 9 rails. By using the code Curtis supplied, I have a parameter called "Number_of_rails". When I enter 3 rails, the other 6 is suppressed.
Now, when the number of posts change, the number of rails will also change. If I for instance set no of post to 15, the rails which shouldnt be there is suppressed in element 1, but not in the other elements.
Hopefully my explanation was good enough
I just realised. If No of rails is set to 1, then I make all the changes to the model, ie set number of posts, distances etc, and then set no of rails , the pattern will be correct. so it looks like all that is needed is to update the pattern. Anyone got a code for this?
No. My guess is that the pattern does not realise that the pattern has changed, so in the Inventors understanding there is nothing that needs to be updated.