#author NBOS Software #desc Increments a label as the map is clicked #customtool Label Counter #toolbase Circle #toolset Custom Tools #button RandomCityName.bmp Dim o, oT Dim n, m Dim CitySize Dim x, y Dim sLang, sFont Dim GroupID sFont = "Times New Roman" o = GetLastMapObject() map = GetCurrentMap() sCnt = map.GetField( "LastCount") nCnt = 0 If Len( sCnt) < 1 Then nCnt = 0 Else nCnt = CInt( sCnt) End If nCnt = nCnt + 1 oT = CreateMapObject( "Text") oT.Text = CStr( nCnt) map.SetField "LastCount", CStr( nCnt) oT.FontSize = 72 * 4000 oT.BrushColor = rgb( 0, 0, 0) oT.PenColor = Rgb( 0, 0, 0) '----- Add the objects to the map oT.AddPoint o.GetPointX(1), o.GetPointY(1) oT.AddPoint o.GetPointX(1), o.GetPointY(1)+ 200 oT.AddPoint o.GetPointX(1)+600000, o.GetPointY(1) oT.AddPoint o.GetPointX(1)+600000, o.GetPointY(1)+200000 oT.FontName = sFont '----- Delete the circle because we no longer need it map.DeleteObject( map.ObjectCount) '----- Add the text n = map.AddObject( oT)