Actually, no. I was concerned about that at first too, but in fact it seems to work BETTER for that purpose.
My version of the code does not actually affect the visibility settings of the individual work features - it just uses the global visibility to turn them all off. When the second part of the code runs, you would think it would indiscriminately turn all the planes back on.
However, that isn't what it actually does. Instead, turning the Object Visibility back on just lets the individual feature visibility settings take back over. So, essentially it resets them to the way you had it set before running the code, without the need to store the previous settings in an array.
You can test it out for yourself pretty easily. Make a part with two work planes. Turn the visibility for one of them off. Then go to the View tab, and uncheck Object Visibility for work planes. Both planes will be gone. Go back to Object Visibility and turn it back on - only the previously visible plane will reappear.
Thanks for posting the example code. Indeed that looks like a much more simple code solution.
The only thing I can think of that might be an issue would the work plane visibility at the assembly level, since the View tab method is a display override of the right click Visibility setting it often creates frustration at the assembly level when those planes that are turned off at the part level using the View tab method, show back up at the assembly level. But if that is not a concern, then I see no reason your example would not work just as well or better.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
That's good to know, thanks for the update.
I don't think that's going to be a problem, at least the way we're using this. Our rule turns the object visibility off at the part level, but then turns it right back on after the measurement is taken. I haven't seen it behave visually any differently than your previous version of the rule did.
If it has any problems like what you're describing, it would only occur for someone doing something that is abnormal for us anyway.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.