Just going to add a bit more information to this post, to help save others some time later, if they should attempt to try some alternative ways to do this. When we are in a weldment type assembly, there are 4 different 'editing modes' or 'environments' (the default assembly mode, the preparations mode, the welds mode, and the machining mode). We can activate or exit each of those modes by code also. Since it would seem logical to edit or modify a weld bead while in welds mode, I did try several of the usual ways to suppress or hide a weld bead while in both the default assembly mode, and while in welds mode, but the mode did not seem to make a difference. I also checked in the WeldsComponentDefinition.Occurrences collection, but it does not contain any occurrences. Another angle that was explored was utilizing the SurfaceBody.Visible property. The WeldsComponentDefinition.SurfaceBodies collection only contained 1 body, even though several welds of different types existed in it. When that one body was highlighted, all the welds of all types were highlighted, so they were all part of one SurfaceBody object. So, no luck there either. I also tried multiple ways of selecting a single Inventor.WeldBead object, but most of those fail also. For example, the Document.SelectSet.Select() method would not select it ; the CommandManager.DoSelect() method would not select it. I also tried using the shortcut way to get the Inventor.BrowserNode for that WeldBead directly (BrowserPane.GetBrowserNodeFromObject method), but that failed also. So, to select it prior to executing the ControlDefinition for toggling its suppression, I had to step down through the model browser nodes the traditional way, then use its BrowserNode.DoSelect method, just like in the older posts. Sometimes there are multiple ways to get something done...other times there mostly just multiple ways to fail at getting something done, but just one way that works. 🙄😉
Wesley Crihfield

(Not an Autodesk Employee)