HOW TO
' View.TextTool(ASCII) ' theView = av.GetActiveDoc if (theView.GetGraphics.EditText.Not) then pt = theView.GetDisplay.ReturnUserPoint ' ask for ascii value and convert newstr = "" strlist = msgbox.input("Enter ASCII values (0-255) separated by commas:","ASCII value(s)...","") if(strlist = nil) then exit end for each astr in strlist.astokens(",") if(astr.isnumber) then goodstr = astr.asnumber if((goodstr < 0) or (goodstr > 255)) then msgbox.error(goodstr.asstring++" is not between 0 and 255","Bad Value") continue end newstr = newstr ++ goodstr.aschar else msgbox.error(astr++"is not a valid numeric value...","Bad value") continue end end t = GraphicText.Make(newstr, pt) t.SetDisplay(theView.GetDisplay) theView.GetGraphics.UnselectAll t.SetSelected(TRUE) if (t.EditText) then theView.GetGraphics.Add(t) end av.GetProject.SetModified(true) end ' Layout.Text(ASCII) ' theLayout = av.GetActiveDoc if (theLayout.GetGraphics.EditText.Not) then pt = theLayout.GetDisplay.ReturnUserPoint ' ask for ascii value and convert newstr = "" strlist = msgbox.input("Enter ASCII values (0-255) separated by commas:","ASCII value(s)...","") if(strlist = nil) then exit end for each astr in strlist.astokens(",") if(astr.isnumber) then goodstr = astr.asnumber if((goodstr < 0) or (goodstr > 255)) then msgbox.error(goodstr.asstring++" is not between 0 and 255","Bad Value") continue end newstr = newstr ++ goodstr.aschar else msgbox.error(astr++"is not a valid numeric value...","Bad value") continue end end t = GraphicText.Make(newstr, pt) t.SetDisplay(theLayout.GetDisplay) theLayout.GetGraphics.UnselectAll t.SetSelected(TRUE) if (t.EditText) then theLayout.GetGraphics.AddName(t) av.GetProject.SetModified(true) end end
Get help from ArcGIS experts
Download the Esri Support App