AnsweredAssumed Answered

Dynamically add/remove controls from property manager pages

Question asked by Johannes Kronberger on Jun 3, 2016
Latest reply on Jun 13, 2016 by Johannes Kronberger

In a property manager page we have a combo box that displays a list of paths to SolidWorks models (*.sldprt files).

From the selected model we get the list of equations in this file and would like to display controls to modify the values of these equations.

Because every file has a different number of equations we need to replace the controls every time the user selects another model.

The docs are quite clear on that you can only add controls while the page is closed (2016 SOLIDWORKS API Help - AddControl2 Method (IPropertyManagerPage2)), so the only way we see is either

* Close the page -> Recreate the controls -> Show the page again

* Create controls for all models in the combo box and then show/hide them as needed.

Because neither of these approaches is perfect we are looking for another solution to solve this.

Any ideas?

Outcomes