1 Reply Latest reply on Mar 5, 2014 10:44 AM by Simon Turner

    User property manager page call back

    Kieu Tran

      Hello experts,

       

      If you know about property manager page API please take a bit your gold-time to help me. I have used SwVBAddin template to create a property page like that:

      userPropMMgrPage.png

      Very simple to understand my target. Look at Sample Group I, I chose an option in the combo-box then chose a solid-body in the selection (Selection 1 in the picture), click Apply button then I want to create Case 1 in the list-box. With Case 1 will contain information about name of this option and solid-body (Case 1 is an array, maybe). Then, I chose other option and other solid-body, then click Apply will create Case 2... I know that I have to custome in EventHandling.vb but I don't know how to code exactly.

       

      And the second question, I have two selection-box with the same selection type (swSelectType_e.swSelSOLIDBODIES). How can I chose same solid-body in all of two selection-box?

       

      This is my code in UserPMPage.vb

              'Add Controls to Group1

              'group1

              'Combo1

              controlType = swPropertyManagerPageControlType_e.swControlType_Combobox

              leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              combo1 = group1.AddControl(combo1ID, controlType, "", leftAlign, options, "Chose Option")

              If Not combo1 Is Nothing Then

                  Dim items() As String = New String() {"Option 1", "Option 2", "Option 3"}

                  combo1.Height = 50

                  combo1.Style = swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly

                  combo1.AddItems(items)

              End If

       

              'label1

              label1 = group1.AddControl(label1ID, 1, "Selection 1: ", 1, 3, "")

              'Selection1

              controlType = swPropertyManagerPageControlType_e.swControlType_Selectionbox

              leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              selection1 = group1.AddControl(selection1ID, controlType, "", leftAlign, options, "Displays items selected in main view")

              If Not selection1 Is Nothing Then

                  Dim filter() As Integer = New Integer() {swSelectType_e.swSelSOLIDBODIES}

                  selection1.Height = 30

                  selection1.SetSelectionFilters(filter)

              End If

       

              'Button 1

              controlType = swPropertyManagerPageControlType_e.swControlType_Button

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              button1 = group1.AddControl(button1ID, controlType, "Apply", 0, options, "Apply")

       

              'listbox1

              controlType = swPropertyManagerPageControlType_e.swControlType_Listbox

              leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              list1 = group1.AddControl(list1ID, controlType, "", leftAlign, options, "")

              If Not list1 Is Nothing Then

                  Dim items() As String = New String() {"Case 1", "Case 2"}

                  list1.Height = 50

                  list1.AddItems(items)

              End If

       

              'Group 2

              'label2

              label2 = group2.AddControl(label2ID, 1, "Selection 2: ", 1, 3, "")

              'Selection2

              controlType = swPropertyManagerPageControlType_e.swControlType_Selectionbox

              leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              selection2 = group2.AddControl(selection2ID, controlType, "", leftAlign, options, "Displays items selected in main view")

              If Not selection2 Is Nothing Then

                  Dim filter() As Integer = New Integer() {swSelectType_e.swSelSOLIDBODIES}

                  selection2.Height = 30

                  selection2.SetSelectionFilters(filter)

              End If

       

       

      Thanks you for reading!

       

      Best Regards,

      Kieu Tran.