macroScript pb_SPbVC category:"Piranha-Bytes" buttonText:"PolySel VC" toolTip:"Select Polys by Vertex count" ( rollout ro_SelPolyByVertCount "Select Polys by Vert Count" ( button ui_GetPolys "Get Polys from Object" pos:[5,5] width:150 height:20 button ui_PolyV1 "1 Vertex Polys: 0" pos:[5,35] width:150 height:20 button ui_PolyV2 "2 Vertex Polys: 0" pos:[5,55] width:150 height:20 button ui_PolyV3 "3 Vertex Polys: 0" pos:[5,75] width:150 height:20 button ui_PolyV4 "4 Vertex Polys: 0" pos:[5,95] width:150 height:20 button ui_PolyV5 "5 Vertex Polys: 0" pos:[5,115] width:150 height:20 button ui_PolyV6 "6 Vertex Polys: 0" pos:[5,135] width:150 height:20 button ui_PolyV7 ">6 Vertex Polys: 0" pos:[5,155] width:150 height:20 button ui_PolyTotal "Total Polys: 0" pos:[5,175] width:150 height:20 local PolyArray = #() local PolyObj on ui_GetPolys pressed do ( PolyObj = (getCurrentSelection())[1] --- get current Object if ((PolyObj != undefined) and ((classof PolyObj) == Editable_Poly)) then --- check if EditablePoly ( ui_GetPolys.caption = PolyObj.name subobjectlevel = 4 --- Enter Poly SubobjectLevel polyCount = PolyObj.faces.count --- get PolyCount PolyArray = #() --- Initialize Arrays for storing Polys.. for p=1 to 7 do append PolyArray #() --- 7 are needed for f=1 to polyCount do --- Go through all faces... ( vertCount = ((polyOp.getVertsUsingFace PolyObj #(f)) as array).count --- get number of vertices of poly if vertCount < 7 then append PolyArray[vertCount] f --- append it to the array else append PolyArray[7] f ) ui_PolyV1.caption = "1 Vertex Polys: " + (PolyArray[1].count as string) --- set ui ui_PolyV2.caption = "2 Vertex Polys: " + (PolyArray[2].count as string) ui_PolyV3.caption = "3 Vertex Polys: " + (PolyArray[3].count as string) ui_PolyV4.caption = "4 Vertex Polys: " + (PolyArray[4].count as string) ui_PolyV5.caption = "5 Vertex Polys: " + (PolyArray[5].count as string) ui_PolyV6.caption = "6 Vertex Polys: " + (PolyArray[6].count as string) ui_PolyV7.caption = ">6 Vertex Polys: " + (PolyArray[7].count as string) ui_PolyTotal.caption = "Total Polys: " + (polyCount as string) ) else ( polyObj = undefined ui_GetPolys.caption = "Get Polys from Object" messageBox "No Editable_Poly selected!" ) ) on ui_PolyV1 pressed do (if ((PolyObj != undefined) and (PolyArray[1] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[1]); forceCompleteRedraw()) on ui_PolyV2 pressed do (if ((PolyObj != undefined) and (PolyArray[2] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[2]); forceCompleteRedraw()) on ui_PolyV3 pressed do (if ((PolyObj != undefined) and (PolyArray[3] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[3]); forceCompleteRedraw()) on ui_PolyV4 pressed do (if ((PolyObj != undefined) and (PolyArray[4] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[4]); forceCompleteRedraw()) on ui_PolyV5 pressed do (if ((PolyObj != undefined) and (PolyArray[5] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[5]); forceCompleteRedraw()) on ui_PolyV6 pressed do (if ((PolyObj != undefined) and (PolyArray[6] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[6]); forceCompleteRedraw()) on ui_PolyV7 pressed do (if ((PolyObj != undefined) and (PolyArray[7] != undefined)) then (polyop.SetFaceSelection PolyObj PolyArray[7]); forceCompleteRedraw()) ) createDialog ro_SelPolyByVertCount style:#(#style_Sysmenu, #style_toolwindow) )