Sunday, 15 March 2015

Making of Feature Toggler Part 02

..continued from Part 1

In the code window, type the following Imports statement at the top:


This statement allows using the Marshal class whose GetActiveObject method helps to connect to a running instance of Solid Edge as seen later.

Declare the following variables at the Form level:


The oModel variable has various features collection like Holes, Chamfers, Ribs, Rounds and Drafts which are traversed to enable or disable their Suppress states.

In the Form's Load event, perform some basic checks for Solid Edge running and if a Part document is opened and further if there are any features or models in the currently open Part:


The program is terminated each time a condition is not met using the End statement.

Inside the ListBox's SelectedIndexChanged event, the appropriate features collection is traversed using a For Each loop and the Suppressed state of each feature is toggled as below:


That's all for the programming side. For more details on how to call this command from the ribbon bar and downloading the program and its source code, continue to part 3...

Index of all Solid Edge Tips, Tutorials and Videos...