4 Replies Latest reply on Jun 13, 2016 4:50 AM by Johannes Kronberger

    Dynamically add/remove controls from property manager pages

    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?