AnsweredAssumed Answered

Unable to select anything in PropertyManagerPage::SelectionBox

Question asked by Omkar Deshpande on Aug 24, 2017
Latest reply on Aug 24, 2017 by Omkar Deshpande



    I am developing an Addin. I need to use PropertyManagerPage. I have put a Selection Box on the page, which should allow user to select a dimension. But when PMPage is shown, i cannot select anything in SolidWorks. Please note that, I have copied PMPHandler.vb class to UserPMPage.vb class.



    Sub Show()


    End Sub


    Sub CreatePage()

        'handler = New PMPageHandler()

        'handler.Init(iSwApp, userAddin)

        Dim options As Integer

        Dim errors As Integer


        options = swPropertyManagerButtonTypes_e.swPropertyManager_OkayButton + swPropertyManagerButtonTypes_e.swPropertyManager_CancelButton + swPropertyManagerPageOptions_e.swPropertyManagerOptions_LockedPage

        ppage = iSwApp.CreatePropertyManagerPage("Assign Dimensions", options, Me, errors)

    End Sub


   Sub AddControls()

        Dim options As Integer

        Dim leftAlign As Integer

        Dim controlType As Integer

        Dim filters(0) As Object


        options = swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded + swAddGroupBoxOptions_e.swGroupBoxOptions_Visible

        group1 = ppage.AddGroupBox(group1ID, "Thk", options)


        controlType = swPropertyManagerPageControlType_e.swControlType_Selectionbox

        leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

        options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

        selbox1 = group1.AddControl2(selbox1ID, swPropertyManagerPageControlType_e.swControlType_Selectionbox, "Thk", swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge, options, "Select Thk")

        filters(0) = swSelectType_e.swSelDIMENSIONS

        selbox1.AllowMultipleSelectOfSameEntity = False

        selbox1.AllowSelectInMultipleBoxes = False

        selbox1.Height = 50

        selbox1.Mark = 1


        selbox1.SingleEntityOnly = True


    Public Function OnSubmitSelection(Id As Integer, Selection As Object, SelType As Integer, ByRef ItemText As String) As Boolean Implements IPropertyManagerPage2Handler9.OnSubmitSelection

        OnSubmitSelection = True

    End Function


Am I missing something? Any help is appriciated.

Thanks in advance!