4 Replies Latest reply on Nov 1, 2013 8:22 AM by Mohammed Elkalakhi

    Trouble with pinned PropertyManager page

    Mohammed Elkalakhi

      Hello everybody;

       

      I work on an Add-in for solidworks,

      I want to stay in the menu after validation


      So i added a pin in the interface so that then user can choose whether to execute the function once,
      or if he wishes to remain in the menu to execute it several times.

       

      But i can't re-display the PropertyManager page after the add-in finishes its work.

       

      This my code :

       

      Private swDoc As ModelDoc2

      Private sispmpage As PropertyManagerPage2

       

      Public Sub AfterClose() Implements IPropertyManagerPage2Handler9.AfterClose

       

      ' Code to start the work of the add-in

       

        swDoc.ClearSelection2(True)

       

      If pinned Then

       

      sispmpage.Show2(0) ' <=== carshes here

      sispmpage.Pinned = True

       

      End If

       

      End

       

      End Sub


      Thank you in advance
        • Re: Trouble with pinned PropertyManager page
          Artem Taturevych

          You do not need to reopen you Property Page if it is pinned. I assumed you are trying to implement the pin manually. You just need to use the swPropertyManagerOptions_PushpinButton parameter as ‘option’ argument for the SldWorks::CreatePropertyManagerPage. In this case SolidWorks will take care of this.

          ____________________________________________________

          Regards,

          Artem Taturevych, Application Engineer at Intercad (Australia)

           

          translationXpert – add-in to translate SolidWorks models

          myIntercad an integrated tool for SolidWorks Professionals

          LinkedIn SolidWorks API Education Group

            • Re: Trouble with pinned PropertyManager page
              Mohammed Elkalakhi

              Hello Artem,

               

              Thank you for your replay,

               

              I know that by default, if the property manager page is pinned, the dialog is not closed.

               

              But if it is pinned; IPropertyManagerPage2Handler8::OnClose(swPropertyManagerPageClose_Apply) is called and IPropertyManagerPage2Handler8::AfterClose is not called.

               

              And i have to call the IPropertyManagerPage2Handler8::AfterClose handler to allows my add-in to do his work.

               

              So to call IPropertyManagerPage2Handler8::AfterClose  i used the Err.Raise method with a value of 0 in the implementation of

              IPropertyManagerPage2Handler8::OnClose(swPropertyManagerPageClose_Apply)

               

              To avoid aggravating the user, who expected the PropertyManager page  to remain pinned, i tryed to re-display and re-pin the PropertyManager page after the add-in finishes its work, but this is not accomplished.

               

              Thanks

                • Re: Trouble with pinned PropertyManager page
                  Artem Taturevych

                  Hello Mohammed,

                   

                  I would suggest you the following scenario to manage this:

                   

                  1) Create a page which includes these two options:

                   

                  swPropertyManagerOptions_PushpinButton - to show the pin button

                  swPropertyManagerOptions_LockedPage - to allow rebuild operations when PMP is active

                   

                  2) Do work you need from within the OnClose notification. You may identify the state using the 'reason' parameter of OnCLose:

                   

                  swPropertyManagerPageClose_Okay - green tick is clicked and PMP is not pinned

                  swPropertyManagerPageClose_Cancel - red cross is ticked

                  swPropertyManagerPageClose_Apply - green tick is clicked and PMP is pinned

                   

                  Please note because you are using the swPropertyManagerOptions_LockedPage it is safe to do all your work from within the OnClose event. AfterClose is no longer required.

                   

                  Hope it helps.

                  ____________________________________________________

                  Regards,

                  Artem Taturevych, Application Engineer at Intercad (Australia)

                   

                  translationXpert – add-in to translate SolidWorks models

                  myIntercad an integrated tool for SolidWorks Professionals

                  LinkedIn SolidWorks API Education Group