7 Replies Latest reply on Aug 9, 2013 6:42 PM by Oleg Bezyaev

    PropertyManagerPage autohiding.

    Oleg Bezyaev

      I create PropertyManagerPage from WinForm control. When I highlight/focused my selectionbox and select any sketch line my PMP is closing. If I select faces, edges - PMP steel open. Why? And how can I fix this so that my PMP still remained open.

        • Re: PropertyManagerPage autohiding.
          Artem Taturevych

          Do you say that your created the PMP with ActiveX control? Try to use the SldWorks::CreatePropertyManagerPage with swPropertyManagerOptions_LockedPage option.

          ____________________________________________________

          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: PropertyManagerPage autohiding.
              Oleg Bezyaev

              Hi Artem.

              PMP was created with "IPropertyManagerPageWindowFromHandle".

               

              The proposed code no results.

              controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;

              align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;

              options = (int)swAddControlOptions_e.swControlOptions_Enabled +

                                    (int)swAddControlOptions_e.swControlOptions_Visible +

                                    (int)swPropertyManagerPageOptions_e.swPropertyManagerOptions_LockedPage;

               

               

              usercontrol1 = (IPropertyManagerPageWindowFromHandle)group1.AddControl(UserControl1ID, controlType, "Dot Net Control", align, options, "This is a WinForm");

              usercontrol1.Height = 970;

              If I select object with type swSelEXTSKETCHSEGS - PMP is closing.

                • Re: PropertyManagerPage autohiding.
                  Artem Taturevych

                  Hi Oleg,

                   

                  Strange. Have never used WindowFromHandle. Always using the ActiveX: swControlType_ActiveX

                   

                  Can you try 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: PropertyManagerPage autohiding.
                      Oleg Bezyaev

                      If I create the control as swControlType_ActiveX, I will have my UserControl (WinForms) make a separate project? As with the example TaskPane.

                      Now I have my UserControl (PMP_Part) added as part of the current project.

                      If I just replace controlType on swControlType_ActiveX, the panel will not be created.

                       

                      controlType = (int) swPropertyManagerPageControlType_e.swControlType_ActiveX;

                      align = (int) swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;

                      options = (int) swAddControlOptions_e.swControlOptions_Enabled +

                                             (int) swAddControlOptions_e.swControlOptions_Visible +

                                             (int) swPropertyManagerPageOptions_e.swPropertyManagerOptions_LockedPage;

                       

                       

                      usercontrol1 = (IPropertyManagerPageActiveX) group1.AddControl (UserControl1ID, controlType, "Dot Net Control", align, options, "This is a WinForm");// NOT NULL

                       

                      bool bRet = usercontrol1.SetClass ("3e883709-cf1a-4231-b57a-8c795ab68e9e", "");//RETURN TRUE

                       

                      ...

                      public void Show()

                              {

                       

                       

                                  myControl = new PMP_Part(userAddin);

                       

                                  if (swPropertyPage != null)

                                  {

                                      swPropertyPage.Show();

                                  }

                                  myControl = usercontrol1.GetControl();//RETURN NULL

                              }

                       

                       

                      ...

                      public int OnActiveXControlCreated(int id, bool status)// STATUS IS FALSE

                              {

                                  //return -1;

                                  return 0;

                              }

                       


                  • Re: PropertyManagerPage autohiding.
                    Oleg Bezyaev

                    I had to put the property into a function "protected void CreatePropertyManagerPage ()"