Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
You can activate an LOD from an iLogic rule, using API code. But I wouldn't recommend it. Changing the LOD is a heavyweight operation: each LOD is like a separate assembly document. If you have made changes in the current LOD, Inventor will ask you if you want to save them before switching.
If you were to activate a custom LOD, run some code, and then put the LOD back to Master, then you wouldn't see the changes in the custom LOD. That's the only place where you can see the components that are suppressed and unsuppressed. And component suppression is the only reason you need a custom LOD for iLogic rules. If you have rules that don't need to suppress and unsuppress, then you can run them in the Master LOD.
If you do need to suppress and unsuppress, I recommend leaving the assembly in the custom LOD. You can save it and when you re-open it it will open in the custom LOD again (by default). The LOD can become your working environment for that particular assembly.
Thanks for the reply, Mike, and the information.
My desire was to run a code that calculated the height and width of an assembly for crating. However, we have some components in our assembly that won't actually be installed before crating (I know, don't ask!) but rather on site later. Therefore, I was hoping to write a quick routine that would suppress these components, measure the assembly, and then unsuppress the components again.
However, I can do it as you've mentioned, with a custom LOD active. I will attempt now to set error trapping in the event that a user tries running the code with the wrong LOD active...
Thanks again.
@mark5DGVX , to create a new custom LOD in Inventor 2021 and earlier, right click on Level of Detail in the assembly browser.
If a custom LOD already exists, then double-click on it to activate it.