/3.2 (Extension.1 Name: "Roadway Symbols V1.5 - 11/27/00" FirstRootClassName: "List" Roots: 2 Roots: 7 Roots: 9 Roots: 10 Roots: 11 Roots: 12 Roots: 13 Roots: 14 Roots: 15 Roots: 16 Version: 32 About: "This extension provides the user with the ability to symbolize roadfeatures based on a set of standard road symbols containedin the font DNR ROADWAY Symbols\nVersion 1.4 - 7/8/99" InstallScript: 12 UninstallScript: 16 ExtVersion: 1 ) (List.2 Child: 3 Child: 5 ) (Butn.3 Help: "Add Roadway Labels//Adds Roadway Labels for the Selected Features in the Active View" Icon: 4 Click: "rdsym.AddBatch" ) (AVIcon.4 Name: "inters.tif" Data: 4e442049 6d616765 00010011 000e0000 Data: 00f0ffff 00ffffff ff0000ff ffffffff Data: 00ffffff 00000000 00000000 00000000 Data: 000000ff ff00ffff ffffffff ffffffff Data: ffffff00 ff0000ff ffffffff ffffffff Data: ffffffff 00000000 00000000 00000000 Data: 00000000 00000000 00ffffff ffffffff Data: ffffffff ffff0000 ff00ffff ffffffff Data: ffffffff ffffff00 ffff00ff ffffffff Data: ffffffff ffffffff 00ffff00 00ffffff Data: ffffffff ffffffff 0000ffff ff00ffff Data: ffffffff ffffffff ff00ffff ffff0000 Data: ffffffff ffffffff ff0000ff ffffffff Data: 0000ffff ffffffff ff0000ff ffffffff Data: ffff0000 0000ff00 000000ff ffffffff Data: ffffffff ffff0000 00ffffff ffffffff Data: 00000000 06000000 00000000 80800000 Data: 00000000 80800000 80808080 00000000 Data: 00008080 80800000 80800000 80808080 Data: c0c0c0c0 c0c0c0c0 dcdcc0c0 a6a6caca Data: f0f04040 20200000 60602020 00008080 Data: 20200000 a0a02020 0000c0c0 20200000 Data: e0e02020 00000000 40400000 20204040 Data: 00004040 40400000 60604040 00008080 Data: 40400000 a0a04040 0000c0c0 40400000 Data: e0e04040 00000000 60600000 20206060 Data: 00004040 60600000 60606060 00008080 Data: 60600000 a0a06060 0000c0c0 60600000 Data: e0e06060 00000000 80800000 20208080 Data: 00004040 80800000 60608080 00008080 Data: 80800000 a0a08080 0000c0c0 80800000 Data: e0e08080 00000000 a0a00000 2020a0a0 Data: 00004040 a0a00000 6060a0a0 00008080 Data: a0a00000 a0a0a0a0 0000c0c0 a0a00000 Data: e0e0a0a0 00000000 c0c00000 2020c0c0 Data: 00004040 c0c00000 6060c0c0 00008080 Data: c0c00000 a0a0c0c0 0000c0c0 c0c00000 Data: e0e0c0c0 00000000 e0e00000 2020e0e0 Data: 00004040 e0e00000 6060e0e0 00008080 Data: e0e00000 a0a0e0e0 0000c0c0 e0e00000 Data: e0e0e0e0 00000000 00004040 20200000 Data: 40404040 00004040 60600000 40408080 Data: 00004040 a0a00000 4040c0c0 00004040 Data: e0e00000 40400000 20204040 20202020 Data: 40404040 20204040 60602020 40408080 Data: 20204040 a0a02020 4040c0c0 20204040 Data: e0e02020 40400000 40404040 20204040 Data: 40404040 40404040 60604040 40408080 Data: 40404040 a0a04040 4040c0c0 40404040 Data: e0e04040 40400000 60604040 20206060 Data: 40404040 60604040 60606060 40408080 Data: 60604040 a0a06060 4040c0c0 60604040 Data: e0e06060 40400000 80804040 20208080 Data: 40404040 80804040 60608080 40408080 Data: 80804040 a0a08080 4040c0c0 80804040 Data: e0e08080 40400000 a0a04040 2020a0a0 Data: 40404040 a0a04040 6060a0a0 40408080 Data: a0a04040 a0a0a0a0 4040c0c0 a0a04040 Data: e0e0a0a0 40400000 c0c04040 2020c0c0 Data: 40404040 c0c04040 6060c0c0 40408080 Data: c0c04040 a0a0c0c0 4040c0c0 c0c04040 Data: e0e0c0c0 40400000 e0e04040 2020e0e0 Data: 40404040 e0e04040 6060e0e0 40408080 Data: e0e04040 a0a0e0e0 4040c0c0 e0e04040 Data: e0e0e0e0 40400000 00008080 20200000 Data: 80804040 00008080 60600000 80808080 Data: 00008080 a0a00000 8080c0c0 00008080 Data: e0e00000 80800000 20208080 20202020 Data: 80804040 20208080 60602020 80808080 Data: 20208080 a0a02020 8080c0c0 20208080 Data: e0e02020 80800000 40408080 20204040 Data: 80804040 40408080 60604040 80808080 Data: 40408080 a0a04040 8080c0c0 40408080 Data: e0e04040 80800000 60608080 20206060 Data: 80804040 60608080 60606060 80808080 Data: 60608080 a0a06060 8080c0c0 60608080 Data: e0e06060 80800000 80808080 20208080 Data: 80804040 80808080 60608080 80808080 Data: 80808080 a0a08080 8080c0c0 80808080 Data: e0e08080 80800000 a0a08080 2020a0a0 Data: 80804040 a0a08080 6060a0a0 80808080 Data: a0a08080 a0a0a0a0 8080c0c0 a0a08080 Data: e0e0a0a0 80800000 c0c08080 2020c0c0 Data: 80804040 c0c08080 6060c0c0 80808080 Data: c0c08080 a0a0c0c0 8080c0c0 c0c08080 Data: e0e0c0c0 80800000 e0e08080 2020e0e0 Data: 80804040 e0e08080 6060e0e0 80808080 Data: e0e08080 a0a0e0e0 8080c0c0 e0e08080 Data: e0e0e0e0 80800000 0000c0c0 20200000 Data: c0c04040 0000c0c0 60600000 c0c08080 Data: 0000c0c0 a0a00000 c0c0c0c0 0000c0c0 Data: e0e00000 c0c00000 2020c0c0 20202020 Data: c0c04040 2020c0c0 60602020 c0c08080 Data: 2020c0c0 a0a02020 c0c0c0c0 2020c0c0 Data: e0e02020 c0c00000 4040c0c0 20204040 Data: c0c04040 4040c0c0 60604040 c0c08080 Data: 4040c0c0 a0a04040 c0c0c0c0 4040c0c0 Data: e0e04040 c0c00000 6060c0c0 20206060 Data: c0c04040 6060c0c0 60606060 c0c08080 Data: 6060c0c0 a0a06060 c0c0c0c0 6060c0c0 Data: e0e06060 c0c00000 8080c0c0 20208080 Data: c0c04040 8080c0c0 60608080 c0c08080 Data: 8080c0c0 a0a08080 c0c0c0c0 8080c0c0 Data: e0e08080 c0c00000 a0a0c0c0 2020a0a0 Data: c0c04040 a0a0c0c0 6060a0a0 c0c08080 Data: a0a0c0c0 a0a0a0a0 c0c0c0c0 a0a0c0c0 Data: e0e0a0a0 c0c00000 c0c0c0c0 2020c0c0 Data: c0c04040 c0c0c0c0 6060c0c0 c0c08080 Data: c0c0c0c0 a0a0c0c0 c0c0ffff fbfbf0f0 Data: a0a0a0a0 a4a48080 80808080 ffff0000 Data: 00000000 ffff0000 ffffffff 00000000 Data: 0000ffff ffff0000 ffff0000 ffffffff Data: ffffffff ffff0002 00080006 00300000 Data: 00000000 00000000 0000 ) (Butn.5 Help: "Reset Road Symbol Parameters//Initialize/Reset Road Symbolization Parameters" Icon: 6 Click: "rdsym.Init" ) (AVIcon.6 Name: "AddFlag" Res: "Icons.AddFlag" ) (Tool.7 Help: "Interactive Road Symbol Tool//Interactively Add Roadway Symbols" Icon: 8 Cursor: "Cursors.CrossHair" Apply: "rdsym.AddInteractive" Click: "SymWin.DisplayFontPanel" ) (AVIcon.8 Name: "federal.tif" Data: 4e442049 6d616765 00010011 00110000 Data: 003421c2 00714700 ff7f8080 00808000 Data: 80c00180 60030020 02002002 00200200 Data: 20020060 0300c001 80c00180 2002001f Data: 7c0001c0 00000000 00000001 0001000b Data: 00010008 00000000 00000000 0000 ) (Script.9 Name: "rdsym.AddBatch" SourceCode: "' Name: rdsym.AddBatch\n'\n' Headline: Adds roadway symbology to a View in batch mode.\n'\n' Self: \n'\n' Returns: A symbol based on the road classification and number\n'\n' Description: \n'\n' Topics: \n'\n' Search Keys:\n'\n' Requires: An active Roads theme with an item that stores integer values from 1-4\n' representing the class of road\n' 1 - Interstate roadway shield\n' 2 - Federal Roadway shield\n' 3 - State trunk highways - square box\n' 4 - County trunk highways - Circle\n' and \n' an item that stores the road designation. The road designation can be alpha-\n' numeric but should be limited to 3 characters.\n'\n' History: Tim Loesch, MN DNR - Original Coding 4/14/97\n'-ESRI - ArcView 3.0\n'\n\n' get the active document, theme, and FTab\n'\nscript.the.setnumberformat(\"d\")\n\ntheview = av.getactivedoc\nif (theview.Is(View).not) then\n msgbox.error(\"This command only works on Views!\",\"rdsym.AddBatch\")\n return nil\nend\n\nthemelist = theview.geta ctivethemes\nif (themelist.count < 1) then\n msgbox.error(\"No Themes in the View\",\"Add Road Symbols\")\n return nil\nend\nthetheme = themelist.get(0)\nif (thetheme = nil) then\n msgbox.error(\"No Active Themes. Select a Theme and Try Again\",\"Add Road Symbols\")\n return nil\nend\n\ntheftab = thetheme.getftab\n\n'get the road class and designator fields from the ftab to make sure we have a good theme\n' active. That is, one that has the appropriate fields....\n'\nif (_fldlst = nil) then\n if (av.run(\"rdsym.Init\",\"dummy_str ing\") = nil) then\n return nil\n end\nend\n\nclassfield = theftab.findfield(_fldlst.get(0))\nif (classfield = nil) then\n msgbox.error(\"Unable to find the field that indentifies the road class\",\"rdsym.AddInteractive\")\n return nil\nend\n' get the road designator and shape field from the FTAB\nnumfield = theftab.findfield(_fldlst.get(1))\nif (numfield = nil) then\n msgbox.error(\"Unable to find the field that identifies the road number\",\"rdsym.AddInteractive\")\n return nil\nend\n\n\nif ( (_fldlst = nil) or (_pts = nil) or (_scale = nil) )then\n if (av.run(\"rdsym.Init\",{}) = nil) then\n return nil\n end\nend\n\n' Request from the user the minimum line length to symbolize\n'\nmunits = theview.getunits\n\nlengthexists = false\nif ( theftab.findfield(\"Length\") <> nil ) then\n lengthexists = true\n minlength = msgbox.input(\"Enter the smallest line you want symbolized (in Miles)\"+NL+\"Default is 1 mile\",\"Roadway Symbols\",\"1\")\n if (minlength = nil) then\n return nil\n end\n minlength = Units.Convert(minlength.asnumber,#UNITS_LINEAR _MILES,munits)\nend\n\n\n\n' get the scale of the view and calculate the point size of the text\n'\nscale = theview.returnscale\nssize = _pts / (scale / _scale)\n\nshapefield = theftab.findfield(\"Shape\")\n\n' now go through the file and symbolize the roads\n' first let's reselect the file and make sure we have only records with road classifications\n' between 1 and 8.\n'\n\nif (not lengthexists) then\n thequery = \"( [\"+classfield.asstring+\"]\"++\" > 0 ) and\"++ \"( [\"+classfield.asstring+\"]\"++\" < 8 )\"\n else\n thequery = \"( [\"+c lassfield.asstring+\"]\"++\" > 0 ) and\"++ \"( [\"+classfield.asstring+\"]\"++\" < 8 ) and ([length] >\"++minlength.asstring++\")\"\nend\n\nthebitmap = theftab.getselection\ntheftab.query(thequery,thebitmap,#VTAB_SELTYPE_NEW)\n\n' now clear the status bar and get it ready for monitoring the addition of the road symbols themselves\n'\nav.ClearMsg\nav.ClearStatus\ntotalrecs = theFTab.GetNumSelRecords\nav.ShowMsg(\"Creating Roadway Symbology for\"++totalrecs.asstring++\"road segments\")\nav.ShowStopButton\n\ni = 0\n\nfor each r in theBitmap\n theline = theftab.returnvalue(shapefield,r)\n\n' get the road designation, class, and length\n'\n thenum = theftab.returnvalue(numfield,r)\n if (thenum.Is(Number)) then\n thenum = thenum.asstring\n end\n theclass = theftab.returnvalue(classfield,r)\n if (theclass.Is(string)) then\n theclass = theclass.asnumber\n end\n\n if ( ((theclass > 0) and (theclass < 8)) and ((thenum <> \"0\") and (thenum <> \"\")) ) then\n ' set up the status bar progress stuff\n '\n i = i + 1\n progress = (i/totalrecs) * 100\n doMore = av.SetStatus (progress)\n if (not doMore) then\n break\n end\n av.run(\"rdsym.MakeSymbol\",{theline.returncenter,theclass,thenum,ssize})\n \n ' now attach the graphics to the active view\n '\n theTheme.GetGraphics.Merge(theView.GetGraphics.GetSelected)\n theTheme.GetGraphics.RemoveDuplicates\n theTheme.GetGraphics.SetVisible(theTheme.IsVisible)\n \n ' now unselect the symbol and invalidate the view\n '\n TheView.GetGraphics.UnSelectAll\n end\nend\n\nav.clearstatus\nav.clea rmsg\nthebitmap.clearall" ) (Script.10 Name: "rdsym.AddInteractive" SourceCode: "' get the View and the Active Theme and make sure there is an active theme!\n'\ntheView = av.GetActiveDoc\n\nthemelist = theview.getactivethemes\nif (themelist.count < 1) then\n msgbox.error(\"No Themes in the View\",\"Add Road Symbols\")\n return nil\nend\nthetheme = themelist.get(0)\nif (thetheme = nil) then\n msgbox.error(\"No Active Themes. Select a Theme and Try Again\",\"Add Road Symbols\")\n return nil\nend\n\n'now get the point from the user\n'\np = theView.GetDisplay.ReturnUserPoint\n\n\n' now get the feature table\n'\nthef tab = thetheme.getftab\n\n' set up a boolean\n'\nfound = FALSE\n\n'make sure the required global variables are set\n'\nif ( (_fldlst = nil) or (_pts = nil) or (_scale = nil) )then\n if (av.run(\"rdsym.Init\",{}) = nil) then\n return nil\n end\nend\n\n'get the scale of the current View display\n'\nscale = theview.returnscale\n\n' now calculate the size of the symbol (in points) based on the following\n' equation\n'\nssize = _pts / (scale / _scale)\n\n' check the classification field to make sure it is numeric or is a number tha t can\n' be changed into a numeric.\n'\nclassfield = theftab.findfield(_fldlst.get(0))\nif (classfield = nil) then\n msgbox.error(\"Unable to find the field that indentifies the road class\",\"rdsym.AddInteractive\")\n return nil\nend\n\n' get the number field. We will use the strings in this field to place values into\n' the roadway symbol\n'\nnumfield = theftab.findfield(_fldlst.get(1))\nif (numfield = nil) then\n msgbox.error(\"Unable to find the field that identifies the road number\",\"rdsym.AddInteractive\")\n return ni l\nend\n\n' get the shape field\n'\nshapefield = theftab.findfield(\"Shape\")\n\n' now get the point, find the arc, and retrieve the values for the road class and\n' the road symbol text.\n'\nif (thetheme.CanFindByPoint) then\n keys = thetheme.FindByPoint(p)\n TheView.GetGraphics.UnselectAll\n for each key in keys\n found = TRUE\n roadclass = theftab.ReturnValueString(ClassField,key)\n if (roadclass.getclass.getclassname <> \"Number\") then\n if ( (roadclass.getclass.getclassname <> \"String\") or (roadclass.isnu mber.not) ) then\n msgbox.info(\"The Field Values of\"++classfield.asstring++\"Cannot be Changed to Numbers\",\"Label Roads\")\n return nil\n end\n end\n roadnum = theftab.ReturnValueString(NumField, key)\n end\nend\n\nif ( not found ) then\n System.Beep\n return nil\nend\n\nif (roadclass.Is(String)) then\n roadclass = roadclass.asnumber\nend\n\nif (RoadNum.Is(Number)) then\n RoadNum = RoadNum.AsString\nend\n' if an arc was not found then alert the user else, send the point,\n' road class, and symbol stri ng to the script that actually creates the\n' marker symbol\n'\nif ((roadclass < 1) or (roadclass > 8)) then\n System.Beep\n msgbox.Error(\"Road Classification out of Range! Valid Values 1 - 8..\",Script.The.GetName)\n return nil\nend\n\nif ((Roadnum = \"0\") or (RoadNum = \"\")) then\n System.Beep\n If (roadnum = \"0\") then\n msgbox.Error(\"Road Designation '0' invalid\",Script.The.GetName)\n else\n msgbox.Error(\"Road Designation '' invalid\",Script.The.GetName) \n end\n return nil\nend\n\nav.run(\"rdsym.MakeSymbol\",{p ,roadclass,roadnum,ssize}) \n' attach the graphics to the currently active theme. This will cause\n' the symbols to turn off and on based on the current state of the\n' theme\n'\ntheTheme.GetGraphics.Merge(theView.GetGraphics.GetSelected)\ntheTheme.GetGraphics.SetVisible(theTheme.IsVisible)\n" ) (Script.11 Name: "rdsym.Init" SourceCode: "\ntheview = av.getactivedoc\n\nif (theview.getunits.asstring = \"UNITS_LINEAR_UNKNOWN\") then\n msgbox.error(\"This View doesn't have its map units set\"+NL+\n \"in the View's property sheet.\",\"Road Symbol Initialization\")\n return nil\nend\n\nthemelist = theview.getactivethemes\n\nif (themelist.count < 1 ) then\n msgbox.error(\"No Active Themes in View. Unable to Continue\",\"Initialize Road Symbols\")\n return nil\nend\n\nthetheme = themelist.get(0)\ntheftab = thetheme.getftab\nshapefield = theftab.findfield(\"Sha pe\")\n\nfieldlist = theftab.getfields\nclassfield = theftab.findfield(\"Road_class\")\nif ( (classfield = nil) or (self.is(Button)) ) then\n classfield = msgbox.listasstring(fieldlist,\"Which Field Contains the Road Classification?\"+NL+\n \"(Valid Values 1-4)\",\"Label Roads\")\nend\nif (classfield = nil) then return nil end\nclassfieldname = classfield.getname\n\n\nnumfield = theftab.findfield(\"Road_num\")\nif ( (numfield = nil) or (self.is(Button)) ) then\n numfield = msgbox.listasstring(fiel dlist,\"Which Field Contains the Road Numbers?\",\"Label Roads\")\nend\nif (numfield = nil) then return nil end\nnumfieldname = numfield.getname\n\nlabels = {\"Marker Size in Points (72 Points/Inch)\",\"Scale Markers to scale 1:\"}\ndefaults = {\"7\",\"24000\"}\nlst = msgbox.multiinput(\"Label Scaling Parameters\",\"Road Symbology\",labels,defaults)\nif (lst.count < 2) then return nil end\npnts = lst.get(0)\nscale = lst.get(1)\n\nif (pnts.isnumber) then\n _pts = pnts.asnumber\n else\n return nil\nend\nif (scale.isnumber) then\n _scale = scale.asnumber\n else\n return nil\nend\n\n_fldlst = {classfieldname,numfieldname}\n\nreturn true\n" ) (Script.12 Name: "rdsym.Install" SourceCode: "' Name: rdsym.Install\n' Headline: Road Symbology installation script\n'\n' Self: \n'\n' Returns:\n'\n' Description: rdsym.install\n'\n' Topics: Extensions, dnr, installation\n'\n' Search Keys: dnr, Installation\n'\n' History: Tim Loesch Original Coding 3-27-96\n'\n' Copywrite Minnesota Department of Natural Resources\n' ArcView 3.0\n'\nif (av.GetProject = nil) then\n return nil\nend\n\n' Check to make sure that the required font is installed\nthefont = font.make(\"DNR Road Symbols\",\"\")\nif (thefont = nil) then\n msgbox.info(\"Una ble to find required font 'DNR Road Symbols'!\"+NL+\"Unable to Continue\",\"Add Road Symbols\")\n exit\nend\n\n'install the buttons for the extension\nthebuttonlist = self.get(0)\nBatchButton = thebuttonlist.get(0)\nInitButton = thebuttonlist.get(1)\n\n'Now add the new tools\n'\nthebuttonbar = av.getproject.findgui(\"View\").GetButtonBar\nplacebutton = thebuttonbar.findbyscript(\"View.ClearSelect\")\nspacer = space.make\ntheButtonBar.Add(spacer,TheButtonBar.getcontrols.find(placebutton))\ntheButtonBar.Add(BatchButton,TheButtonBar .getcontrols.find(spacer))\ntheButtonBar.Add(InitButton,TheButtonBar.Getcontrols.find(BatchButton))\n\n\n'now add the interactive button\nthetoolbar = av.getproject.findgui(\"View\").GetToolBar\nplacebutton = thetoolbar.findbyscript(\"View.SnapTool\")\nintbutton = self.get(1)\nspacer = space.make\nthetoolbar.add(spacer,thetoolbar.getcontrols.find(placebutton))\nthetoolbar.add(intbutton,thetoolbar.getcontrols.find(spacer))\n\n'Initialize variable for symbology extension\n\n_fldlst = nil" ) (Script.13 Name: "rdsym.MakeExtension" SourceCode: "' Name: DNR.MakeExtension\n'\n' Headline: Road Symbol Generator \n'\n' Self: \n'\n' Returns: a road symbol based on the selected features road classification\n' and numbered based on it's road designation.\n'\n' Description: \n'\n' Topics: Extensions, Road Symbols, installation, make\n'\n' Search Keys: Installation, Make\n'\n' History: Tim Loesch original coding 1-7-97\n'\n' Copywrite Minnesota Department of Natural Resources\n' ArcView 3.0\n'\n' REQUIRES - a custom truetype font called ROADSYM.TTF\n'\ntheProject = av .getproject\ntheinstallscript = theproject.finddoc(\"rdsym.Install\").getscript\ntheuninstallscript = theproject.finddoc(\"rdsym.UnInstall\").getscript\n\nif ((theinstallscript = nil) or (theuninstallscript = nil)) then\n msgbox.info(\"Install or Uninstall script not compiled\",\"\")\n return nil\nend\n '$USEREXT\nmyextension = extension.make(\"$HOME\\rdsym.avx\".asfilename,\"Roadway Symbols V1.5 - 11/27/00\",theinstallscript,theuninstallscript, {})\n \n\n'Get the buttons that will go in the extension\nthe buttonbar = theproject.findgui(\"View\").getbuttonbar\n\nBatchButton = thebuttonbar.findbyscript(\"rdsym.AddBatch\")\nInitButton = thebuttonbar.findbyscript(\"rdsym.Init\")\n\nbuttonlist = {BatchButton,InitButton}\n\nmyextension.Add(buttonlist)\n\nthetoolbar = theProject.FindGui(\"View\").GetToolBar\nIntButton = thetoolbar.findbyscript(\"rdsym.AddInteractive\")\nmyextension.Add(IntButton)\n\n\nfor each d in av.getproject.getdocs\n If (d.Is(SEd) and (d.GetName.Left(\"rdsym\".count + 1) = \"rdsym.\")) then\n if (d.iscompiled.not) then \n d.compile\n end\n myExtension.Add(d.GetScript)\n end\nend\ntheDescription = \"This extension provides the user with the ability to symbolize road\"\ntheDescription = theDescription+\"features based on a set of standard road symbols contained\"\ntheDescription = theDescription+\"in the font DNR ROADWAY Symbols\"\ntheDescription = theDescription+NL+\"Version 1.4 - 7/8/99\"\n\nmyExtension.SetExtVersion(1.1)\nmyExtension.SetAbout(theDescription)\nMyExtension.commit\nfile.copy(\"$USEREXT/rdsym.avx\".asfilename,\"d:\\projec ts\\avproj\\roadsym\\rdsym.avx\".asfilename)\n\n" ) (Script.14 Name: "rdsym.MakeSymbol" SourceCode: "' get the active View\n'\ntheView = av.GetActiveDoc\n\n' as this script requries inputs, check to see if they are formatted correctly.\n' NOTE! For efficiencies sake there are minimal checks here and no error messages\n' these take up code and processing time so I don't do it, I just don't process\n' that record. It is your job to make sure that the parameters are correct!\n'\n' USAGE: av.run(\"rdsym.MakeSymbol\",{point location(Pointobject),road class 1 - 4(number object)\n' road text 3 chars or less(string object) }\n \nif ( self <> nil ) then\n pt = self.get(0)\n class = self.get(1)\n if (class.getclass.getclassname <> \"Number\") then\n class = class.asnumber\n end\n num = self.get(2).asstring\n if (num.count > 3) then\n num = num.left(3) \n end\n ssize = self.get(3)\n else\n return nil\nend\n\nthefont = font.make(\"DNR Road Symbols\",\"Normal\")\n'thefont.setstyle(\"Plain\")\nif (thefont = nil) then\n msgbox.info(\"Unable to find required font 'DN R Road Symbols'!\"+NL+\"Unable to Continue\",\"Add Road Symbols\")\n exit\nend\n\n' initial setup of the symbols\n' symbol one is a solid white background\n'\nsym1 = textsymbol.make\nsym1.setfont(thefont)\nsym1.setcolor(color.GetWhite)\ntheview.getdisplay.hookupsymbol(sym1)\nsym1.setsize(ssize)\nif (class = 5) then\n sym1.setsize(ssize * 1.5)\nend\n\n'symbol two is the transparent black outline\n'\nsym2 = textsymbol.make\nsym2.setfont(thefont)\nsym2.setcolor(color.getblack)\ntheview.getdisplay.hookupsymbol(sym2)\nsym2.setsize(ssize )\nif (class = 5) then\n sym2.setsize(ssize * 1.5)\nend\nif (class = 6) then\n sym2.setsize(ssize * 1.25)\nend\n\n' symbol three is the road name\n'\nsym3 = textsymbol.make\nsym3.setfont(thefont)\nsym3.setcolor(color.getblack)\ntheview.getdisplay.hookupsymbol(sym3)\nif ( num.asstring.count = 1 ) then\n sym3.setsize(ssize * 0.4)\nelseif ( num.asstring.count = 2 ) then\n sym3.setsize(ssize * 0.4)\nelseif ( num.asstring.count = 3 ) then\n sym3.setsize(ssize * 0.3)\nend\n\n' now make the graphic text and assign it to the symbol \n'\nif (class = 1) then\n 'make an interstate shield\n g1 = graphiclabel.makewithsym(\"*\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"+\",pt,sym2,{})\nelseif (class = 2) then\n ' make a federal shield\n g1 = graphiclabel.makewithsym(\",\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"-\",pt,sym2,{})\nelseif (class = 3) then\n ' make a state box\n g1 = graphiclabel.makewithsym(\"(\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\")\",pt,sym2,{})\nelseif (class = 4) then\n ' make a county circle\n g1 = graphiclabel.makewith sym(\".\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"/\",pt,sym2,{})\nelseif (class = 5) then\n ' Make a diamond symbol\n g1 = graphiclabel.makewithsym(\":\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"!\",pt,sym2,{})\nelseif (class = 6) then\n ' Make a triangle symbol\n g1 = graphiclabel.makewithsym(\"&\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"'\",pt,sym2,{})\nelseif (class = 7) then\n ' Make a pentagon symbol\n g1 = graphiclabel.makewithsym(\"$\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"%\",pt,sym2,{})\nelse if (class = 8) then\n ' Make an octogan symbol\n g1 = graphiclabel.makewithsym(\"\"\"\",pt,sym1,{})\n g2 = graphiclabel.makewithsym(\"#\",pt,sym2,{})\nelseif ((class < 1) or (class > 8)) then\n return nil\nend\ng3 = graphiclabel.makewithsym(num.asstring,pt,sym3,{})\n\n' add the first graphic, a solid black symbol\n'\ntheView.GetGraphics.Add(g1)\n\n' the next statement determines the center of the graphic and moves the graphic\n' origin to that point. This centers the graphic on the point you select rather \n' than to the up per right of the point.\n' In other terms, the next statement places the center of the graphic on the point\n' selected by the user....\n'\ntheorigin = g1.getorigin\nxoffset = g1.getextent.getx / 2\nyoffset = g1.getextent.gety / 2\nnewx = theorigin.getx - xoffset\nnewy = theorigin.gety - yoffset\ng1.setorigin(newx@newy)\n\n' now add the second graphic, the black outline\n'\ntheView.Getgraphics.add(g2)\ng2.setorigin(newx@newy)\n\n' now add the number of the road to the road symbol\n' because of the differing shapes, we have to place the text\n' a little different for classes 1,2 and 3,4\n'\n' To move the text down, make the yoffset divisor smaller\n' To move the text up, make the yoffset bigger\n' To move the text left, make the xoffset smaller\n' To move the text right, make the yoffset larger than one\n\ntheview.getgraphics.add(g3)\norigin = g3.getorigin\nif ( (class = 1) or (class = 2) )then\n xoffset = g3.getextent.getx / 1.95\n if (num.asstring.count < 3) then\n yoffset = g3.getextent.gety / 1.5\n else\n yoffset = g3.getextent .gety / 1.75\n end\nelseif ( (class = 3) or (class = 4) ) then\n if (num.asstring.count = 1) then\n xoffset = g3.getextent.getx / 1.25\n else\n xoffset = g3.getextent.getx / 1.5\n end\n yoffset = g3.getextent.gety / 1.75\nelseif ( class = 5 ) then\n xoffset = g3.getextent.getx / 1.95\n yoffset = g3.getextent.gety / 1.95 \nelseif ( class = 6 ) then\n xoffset = g3.getextent.getx / 2.9\n yoffset = g3.getextent.gety / 1.4\nelseif (class = 7) then\n xoffset = g3.getextent.getx / 2.0\n yoffset = g3.getextent.get y / 1.2\nelseif (class = 8) then\n xoffset = g3.getextent.getx / 2\n yoffset = g3.getextent.gety / 1.5\nend\n\n' now offset the text and place it in the graphic list\n'\nnewx = theorigin.getx - xoffset\nnewy = theorigin.gety - yoffset\ng3.setorigin(newx@newy)\n\n\n' now select the graphics and place them into their own graphic group\n'\ng1.select\ng2.select\ng3.select\n\nTheView.GetGraphics.groupselected\n\n\nav.GetProject.SetModified(true)\n" ) (Script.15 Name: "rdsym.ResetSymbols" SourceCode: "theview = av.getactivedoc\nthemelist = theview.getactivethemes\nif (themelist.count > 1) then\n msgbox.error(\"Too many themes active\",\"Reset Road Symbols\")\n exit\nend\nif (themelist.count < 1) then\n msgbox.error(\"No Themes active\",\"Reset Roads Symbols\")\n exit\nend\nthetheme = themelist.get(0)\ngrlist = theview.getgraphics\ngrlist.selectall\nif (grlist.count < 1) then\n msgbox.info(\"No road symbology associated with the Active Layer\",\"Re-Do Road Symbols\")\n exit\nend\ngrlist.unselectall\nrdsymlist = grlist\n\nmsgbox.in fo(rdsymlist.count.asstring,\"\")\n\nthefont = font.make(\"Roadway Symbols\",\"\")\n\nfor each t in rdsymlist\n slist = t.getgraphics\n for each asym in slist\n asym.setfont(font)\n end\nend\nif (thefont = nil) then\n msgbox.info(\"Unable to find required font 'Roadway Symbols'!\"+NL+\"Unable to Continue\",\"Add Road Symbols\")\n exit\nend\n\n\n \n\n" ) (Script.16 Name: "rdsym.Uninstall" SourceCode: "' Name: dnr.UnInstall\n'\n' Headline: road symbol extension uninstall script\n'\n' Self: \n'\n' Returns:\n'\n' Description: \n'\n' Topics: Extensions, DNR, installation\n'\n' Search Keys: DNR, Installation\n'\n' History: Tim Loesch Original Coding 3/27/97\n' Copywrite Minnesota Department of Natural Resources\n' ArcView 3.0\n'\nif (av.GetProject = nil) then\n return nil\nend\n\nif (av.GetProject.IsClosing) then\n return nil\nend\n\nThebuttonbar = av.GetProject.FindGUI(\"View\").getButtonBar\nButlist = self.get(0)\nfor each but in but list\n thebuttonbar.Remove(but)\nend\n\nthetoolbar = av.getproject.findgui(\"View\").GetToolBar\ntheToolBar.Remove(self.get(1))\n\nav.purgeobjects\n" )