' Count Parts of Polygons.AVE ' Modifies Explode.ave. Modified by Tim Thomas. ' ****************************************************************************** ' Explodes shapes and counts how many parts ' ****************************************************************************** '**** do it! theView = av.GetActiveDoc theFTab = theView.GetActiveThemes.Get(0).GetFTab theFTab.SetEditable(true) numRecs = theFTab.GetNumRecords shapeField = theFTab.FindField("Shape") countField = Field.Make("KtParts",#FIELD_LONG,4,0) theFTab.AddFields({countField}) av.ShowMsg("Exploding multi-part polygons") av.ShowStopButton for each r in theFTab theShape = theFTab.ReturnValue(ShapeField,r) theFTab.SetValue(countField,r,theShape.Explode.Count) av.SetStatus(100*(r+1)/numRecs) end ' Clears message in message bar av.ClearMsg theFTab.SetEditable(false) theFTab.UpdateSelection