I created an asset that I am rying to control by iLogic. I Created as a multi-body solid and figured I would simply toggle the visibility on and off of the solid bodies I didn't want to see in any particular configuration. I can't seem to figure out how to toggle the visibility of the solid bodies however. I can suppress individual features, but that gets to be a little complicated as I have to toggle more than a dozen features for each config as opposed to just the 4 solid bodies. Can this be done?
Hi Corey,
You can expand the Solid Bodies folder in the browser and select a body to toggle its visibility using the context menu command.
Yizhou
Yes I realize that I can do this manually. However I need to control this trough iLogic inside a Factory asset, is this possible?
Hi Corey,
Sure, it is possible that the visibility of the bodies is controlled by iLogic. However, you should bring the VBA code into the iLogic as attanchment presented. In the sample, we can change the user parameter "BodyShow" from True to False to turn the bodies on and off.
Hope this will be helpful to you.
Thanks,
-Xuesong
HI Thomas -
The code posted is not quite correct. It needs a "Next" statement that terminates the "For" block.
This link can help explain the syntax here: https://msdn.microsoft.com/en-us/library/5z06z1kb.aspx
So here, you'd need something like this:
For i = 1 to oMultiBodies.Count
oBody = oMultiBodies.Item(i)
If oBody.Name = ...
End If
Next
Jeff
Is there any disadvantage of turning the visibility of the solid bodies off instead of supressing all the features in the Factory Design Suite?
I have some models with a few features and it takes up to a minute to supress them all. Turning the visibility of the solid bodies off just takes a second!
Regards
Corey,
There is another technique to do this without having to use iLogic. In lieu of rewriting everything here, I am giving you a link to a blog post I wrote a couple of months back. Basically one could also utilize a technique called "conditional suppression" which sets features to be suppressed base on parameter values. These parameters can then be passed to published assets by setting them as key parameters. This is a good technique for those who aren't as comfortable with iLogic. Hope this opens up additional possibilities for you and have a most blessed day!
Link to Blog Post: http://www.mastergraphics.com/wordpress/2014/inventor-tips-tricks-conditional-feature-suppression/
Peace,
Pete
Nice article, Pete.