Sub Create(swApp As SldWorks.SldWorks) End Sub Dim pm As clsPMP 'Create the PMP Set pm = New clsPMP pm.Create swApp Public Const lngGroup1ID As Long = 0 Public Const lngGroup2ID As Long = 1 Public Const lngSelID As Long = 2 Public Const lngOptionRedID As Long = 3 Public Const lngOptionGreenID As Long = 4 Public Const lngOptionBlueID As Long = 5 Dim pmHandler As clsPMPHandler Sub Create(swApp As SldWorks.SldWorks) Set pmHandler = New clsPMPHandler End Sub Dim pmHandler As clsPMPHandler Dim pmPage As SldWorks.PropertyManagerPage2 Dim lngErrors As Long Sub Create(swApp As SldWorks.SldWorks) Set pmHandler = New clsPMPHandler Set pmPage = swApp.CreatePropertyManagerPage("Change Face Color", _ swPropertyManagerOptions_OkayButton + swPropertyManagerOptions_CancelButton + _ swPropertyManagerOptions_LockedPage, pmHandler, lngErrors) End Sub If lngErrors = 0 Then 'Display the PMP pmPage.Show2 0 Else Debug.Print "Error creating PropertyManager page." Debug.Print "Error code: " & lngErrors End If 'Message pmPage.SetMessage3 "Select any number of faces and select a color.", _ swImportantMessageBox, swMessageBoxMaintainExpandState, "Message" Dim pmHandler As clsPMPHandler Dim pmPage As SldWorks.PropertyManagerPage2 Dim pmGroup1 As SldWorks.PropertyManagerPageGroup Dim pmGroup2 As SldWorks.PropertyManagerPageGroup Dim pmSelection As SldWorks.PropertyManagerPageSelectionbox Dim pmOptionRed As SldWorks.PropertyManagerPageOption Dim pmOptionGreen As SldWorks.PropertyManagerPageOption Dim pmOptionBlue As SldWorks.PropertyManagerPageOption Dim lngErrors As Long 'Group box Set pmGroup1 = pmPage.AddGroupBox(lngGroup1ID, "Select faces", _ swGroupBoxOptions_Expanded + swGroupBoxOptions_Visible) 'Selection box Set pmSelection = pmGroup1.AddControl(lngSelID, swControlType_Selectionbox, _ "Select faces", swControlAlign_Indent, swControlOptions_Visible + _ swControlOptions_Enabled, Empty) pmSelection.SingleEntityOnly = True pmSelection.Height = 15 pmSelection.SetSelectionFilters swSelFACES pmSelection.SetStandardPictureLabel swBitmapLabel_SelectFace 'Group box Set pmGroup2 = pmPage.AddGroupBox(lngGroup2ID, "Select color", _ swGroupBoxOptions_Expanded + swGroupBoxOptions_Visible) 'Option buttons Set pmOptionRed = pmGroup2.AddControl(lngOptionRedID, swControlType_Option, _ "Red", swControlAlign_Indent, swControlOptions_Visible + _ swControlOptions_Enabled, Empty) pmOptionRed.Checked = True Set pmOptionGreen = pmGroup2.AddControl(lngOptionGreenID, swControlType_Option, _ "Green", swControlAlign_Indent, swControlOptions_Visible + _ swControlOptions_Enabled, Empty) Set pmOptionBlue = pmGroup2.AddControl(lngOptionBlueID, swControlType_Option, _ "Blue", swControlAlign_Indent, swControlOptions_Visible + _ swControlOptions_Enabled, Empty) PropertyManagerPage2Handler9_OnSubmitSelection = True Dim r As Integer, g As Integer, b As Integer r = 255 g = 0 b = 0 r = g = b = 0 If Id = lngOptionRedID Then r = 255 If Id = lngOptionGreenID Then g = 255 If Id = lngOptionBlueID Then b = 255 If Reason = swPropertyManagerPageClose_Okay Then Dim vMatPropValues As Variant vMatPropValues = swModel.MaterialPropertyValues swModel.SelectedFaceProperties RGB(r, g, b), vMatPropValues(3), _ vMatPropValues(4), vMatPropValues(5), vMatPropValues(6), _ vMatPropValues(7), vMatPropValues(8), False, Empty End If swModel.ClearSelection2 True r = g = b = 0