5 Replies Latest reply on May 24, 2016 10:07 AM by Danny Bradford

    Issues with managing selections with Property Manager Page

    Danny Bradford

      Greetings,

       

      I am building a Property Manager Page to allow users to interactively select 2 edges and a face on parts within an assembly. The final goal is to automate the creation of a hole in one part then linear pattern the hole.

       

      I have the new button creating the hole in a part, however I cannot get the pattern to function to work properly and I am fairly certain the issue is with the Property Manager Page. The issue is, again just a very educated guess, with the filtering function. The first step in the Linear pattern is to systematically select the Hole feature, however the property Manager Page is active and it has a filter that forces a user to only select edges and/or faces. So I am stuck in that I want to keep the filter but during the automation I need to break out of that Property Manager Page so I am free to select the Hole Feature.

       

      Stepping through the code I can see where during the Hole selection process Solidworks is moving through the Property Manager Page and it is clear that one of the user selection boxes is highlighted continuously and it also blanks out during the automation.

       

      So bottom line is how do I keep the property manager page active but exit the focus of all the user selection boxes so that I can select features and anything else that is required?

       

      Solidworks and ePDM 2015; VB.Net

       

      Here is the user interface as it stands with the user selection complete and ready to hit the go button. See how the first user selection is in focus? That is what I believe is the problem.

        • Re: Issues with managing selections with Property Manager Page
          Artem Taturevych

          Hi Danny,

           

          There are several ways you can solve this problem

           

          • You can create a dummy filter box with corresponding filters and focus it when you need to create a feature (PropertyManagerPageSelectionbox::SetSelectionFocus). But I'm not a big fan of this approach
          • What I did when I needed similar functionality is allowing all selections in my boxes but limiting the filters based on the state within the PropertyManagerPage2Handler9::OnSubmitSelection handler. So your selection box allows selecting of faces, edges, features etc. But before user click the 'Add Pins' button you only allow selection of faces and edges within the OnSubmitSelection but enable selection of features when you are inserting the pin. But you need to restore the selections afterwards.
          • You can also try to use SelectionMgr::AddSelectionListObjects method. Perhaps it would allow selection bypassing PMP (I haven't checked this).

           

          You also need to use the swPropertyManagerOptions_LockedPage flag while creating PMP to allow feature creation.

           

          Thanks,
          Artem