/3.0 (Extension.1 Name: "Buffer Theme Builder Extension" Dependencies: "$AVBIN/avdlog.dll\n" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 12 Roots: 13 Roots: 14 Roots: 15 Roots: 16 Roots: 17 Roots: 18 Roots: 19 Roots: 20 Roots: 21 Roots: 22 Roots: 23 Roots: 24 Roots: 25 Roots: 26 Roots: 27 Roots: 28 Roots: 29 Roots: 30 Roots: 31 Version: 30 About: "Builds shape files of buffers from themes. Version 1.0" CanUnloadScript: 75 UnloadScript: 76 InstallScript: 77 UninstallScript: 78 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 ) (List.4 Child: 5 Child: 9 Child: 11 ) (List.5 Child: 6 Child: 7 Child: 8 ) (AVStr.6 S: "View" ) (AVStr.7 S: "ButtonBar" ) (AVStr.8 S: "BufferTheme.RunDialog" ) (Butn.9 Disabled: 1 Help: "Create Buffer Theme//Runs Buffer Theme Manager" Tag: "Runs Buffer Theme Manager Dialog Box. Created by Kevin O'Malley, 2/17/1998." Update: "View.SelectableThemesUpdate" Icon: 10 Click: "BufferTheme.RunDialog" ) (AVIcon.10 Name: "bufficon.bmp" Data: 4e442049 6d616765 00010014 00110000 Data: 01541111 11111111 11111111 11111111 Data: 000f1111 11111111 11111111 11111111 Data: 11000f00 0f111111 11111100 00000011 Data: 11111111 11000000 0f111111 11111100 Data: 10101000 11111111 11000000 00000f11 Data: 11111100 10001010 00111111 11000000 Data: 000f1111 11111100 10100010 10001111 Data: 11000000 0f111111 11111111 00101000 Data: 10100011 1100000f 11111111 11111111 Data: 11001010 00101000 11000f11 11111111 Data: 11111111 11110010 10001010 00000000 Data: 11111111 11111111 11111100 10100010 Data: 10101010 00111111 11111111 11110010 Data: 10100000 00000010 10001111 11111111 Data: 11001010 10000010 10101000 10100011 Data: 11111111 00101010 00001010 00001010 Data: 00101000 11111111 00101000 00101000 Data: 11110010 10001000 11111111 00101010 Data: 10100011 11111100 10101000 11111111 Data: 11000000 00001111 11111111 00000000 Data: 11111111 11111111 11111111 11111111 Data: 11111111 11110000 04000000 00008080 Data: 80000000 80000080 80000080 00008080 Data: 00008000 00008000 80004080 80004040 Data: 0000ff80 00008040 0000ff00 40000040 Data: 8000ffff ff00c0c0 c0000000 ff0000ff Data: ff0000ff 0000ffff 0000ff00 0000ff00 Data: ff0080ff ff0080ff 0000ffff 8000ff80 Data: 80008000 ff004080 ff000200 a0000200 Data: dc000000 00000000 0000595d 2100ba00 Data: 7f000000 34000200 ac000000 11000000 Data: 04000000 00000000 00000000 00000000 Data: 00000000 a000b67f 00000000 1c005b00 Data: d8005b00 b800b47f ff00ffff bc005b00 Data: 2600b37f c0005d00 ac000000 0a000000 Data: 01000000 00000000 a4005b00 12000000 Data: 6300f7bf ac000000 0a000000 01000000 Data: 00000000 af00ec84 3f000000 d0005b00 Data: 2300f7bf 00000000 27000100 9900f9bf Data: 7900f7bf 0c000000 f4005b00 2e00f7bf Data: af00ec84 00000000 ec002752 00000000 Data: 46000000 4a000200 2e000000 2f000000 Data: 3f002701 00002752 3f002701 5000fa3b Data: 4f000400 00000000 0000f91a b3000000 Data: 00000100 00000a00 0000fa3b 10000000 Data: 00000000 3c00347a ff002752 5000413c Data: 4f00ffff 27000000 00002752 3f003458 Data: 8c000000 0300f91a b300e782 17000000 Data: 00000000 01000a00 ac003f01 00000800 Data: 00002f17 5900b37f 14005b00 94005b00 Data: 0700b47f ff00ffff a0005b00 e200b37f Data: 14005b00 ac005b00 c200b47f ff00ffff Data: b8005b00 b000b37f 14005b00 c4005b00 Data: 3500b47f ff00ffff d0005b00 61004100 Data: 14005b00 dc005b00 6e004100 ff00ffff Data: e8005b00 c1004100 14005b00 f4005b00 Data: dc004100 ff00ffff 00005b00 18004100 Data: 14005b00 f4005b00 25004100 ff00ffff Data: 00005b00 9c004100 11000000 01000000 Data: 00000000 9800b67f 01000000 00000000 Data: 00000000 00000000 e4001201 01000000 Data: 00000000 00000000 66002380 00000000 Data: 00000000 05000000 00000000 00000000 Data: 00000000 00000000 4c000000 ac000000 Data: 00000000 44005d00 00000000 05000000 Data: 03000000 b0005d00 04000000 b4005b00 Data: 40000000 00000000 4c005d00 26000800 Data: 13001c00 78005d00 00000000 f200b47f Data: 00000000 00000000 c800b77f 00000000 Data: 00000000 42004646 49004f4e 2e006d70 Data: 00000f02 6e00fc01 cd000f02 c4002752 Data: 04000400 2a000200 28000000 ff001718 Data: d8000200 fa003103 17000000 00000000 Data: 3a000100 00000200 36002887 d3000300 Data: e4000400 6c002000 6f000000 05005069 Data: 00006868 00002487 b200e066 00005069 Data: 00003087 b2001701 98001a05 00000000 Data: 02009804 00000000 fe000000 00005069 Data: 00007287 00005a87 00000000 00000100 Data: 00000000 c0000000 6600b27f 1700b57f Data: e0006f68 2f00a087 6e001701 64002f01 Data: 00000000 c0000000 a0000000 90000000 Data: 68000000 6f000000 01000000 e0000000 Data: 00002f01 e0005d00 68000000 aa00b27f Data: 1700b57f 68002979 0600fe7f fe007705 Data: ec00ac11 2700c613 fe000002 00080007 Data: 00200001 00020000 00000000 0000 ) (Numb.11 N: 22.00000000000000 ) (List.12 ) (List.13 ) (Script.14 Name: "BufferTheme.cbx_Distance.Field.Update" SourceCode: "'BufferTheme.cbx_Distance.Field.Update\n'part of Buffer Theme Manager Extension\n\n' Checks to see if User has chosen to use a Distance Field\n' If so, adds the Themes numeric fields to Checkbox\n' If not, deletes list from checkbox and disables\n\nradio = self.GetDialog.FindByName(\"rad_Distance.Field\")\n\nif (radio.IsSelected) then\n aVTab = self.GetDialog.GetServer\n theList = aVTab.GetFields\n aList={}\n for each i in theList\n if (i.IsTypeNumber) then \n aList.Add(i)\n end\n end \n self.DefineFromList (aList)\n self.SetEnabled(TRUE)\nelse\n self.DefineFromList({})\n self.SetEnabled(FALSE)\nend " ) (Script.15 Name: "BufferTheme.cbx_Distance.Units.Update" SourceCode: "'BufferTheme.cbx_Distance.Units.Update\n'part of Buffer Theme Manager Extension\n\nuList = {\"Degrees\",\"Meters\",\"Feet\",\"Kilometers\",\"Miles\",\"NauticalMiles\",\"Milimeters\",\"Centimeters\",\"Inches\",\"Yards\"}\nviewUnits=self.GetDialog.GetActiveDoc.GetUnits\nif (viewUnits<>\"#UNITS_LINEAR_DEGREES\".asEnum) then\n uList.Remove(uList.FindByValue(\"Degrees\"))\nend\nself.DefineFromList(uList)" ) (Script.16 Name: "BufferTheme.cbx_Output.ManyBuffs.One.Update" SourceCode: "'BufferTheme.cbx_Output.ManyBuffs.One.Update\n'part of Buffer Theme Manager Extension\n\nradMany = self.GetDialog.FindByName(\"rad_Output.ManyBuffs\")\n\nchkAll = self.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\")\n\nif (radMany.IsSelected) then\n if (chkAll.IsSelected) then\n self.DefineFromList({})\n self.SetEnabled(FALSE)\n else\n tempList={}\n inList = self.GetDialog.GetServer.GetFields\n for each fld in inList\n if (fld.IsTypeShape.Not) then\n tempList.Add(fld)\n end\n end \n se lf.DefineFromList(tempList)\n self.SetEnabled(TRUE)\n end \nelse \n self.DefineFromList({})\n self.SetEnabled(FALSE) \nend\n" ) (Script.17 Name: "BufferTheme.cbx_Theme.Select" SourceCode: "'BufferTheme.cbx_Theme.Select\n'part of Buffer Theme Manager Extension\n\naTheme = self.GetCurrentValue\nself.GetDialog.SetServer(aTheme.GetFTab)\nself.BroadcastUpdate\nself.GetDialog.FindByName(\"cbx_Type\").Update\nself.GetDialog.FindByName(\"cbx_Output.ManyBuffs.One\").Update\n" ) (Script.18 Name: "BufferTheme.cbx_Theme.Update" SourceCode: "'BufferTheme.cbx_Theme.Update\n'part of Buffer Theme Manager Extension\n\naDoc = self.GetDialog.GetActiveDoc\nif (aDoc.Is(View) and aDoc.GetThemes.IsEmpty.Not) then\n self.SetEnabled(true)\n theThemes = aDoc.GetThemes\n self.DefineFromList(theThemes)\n self.GetDialog.SetServer(theThemes.Get(0).GetFTab)\nelse\n self.SetEnabled(false)\n self.Empty\nend\nself.GetDialog.FindByName(\"cbx_Type\").Update\nself.GetDialog.FindByName(\"cbx_Output.ManyBuffs.One\").Update\n" ) (Script.19 Name: "BufferTheme.cbx_Type.Update" SourceCode: "'BufferTheme.cbx_Type.Update\n'part of Buffer Theme Manager Extension\n\nthemeType = self.GetDialog.GetServer.FindField(\"Shape\").GetType\ntypeList = {}\nif (themeType.AsString = \"FIELD_SHAPELINE\") then\n typeList = {\"Line\",\"Nodes\",\"NodeF\",\"NodeT\"}\nelse\n if (themeType.asString = \"FIELD_SHAPEPOLY\") then\n typeList = {\"Boundary\",\"Inside/Outside\",\"Polygon+/Polygon-\"}\n else \n typeList = {\"Point\"}\n end\nend \n\nself.DefineFromList(typeList)\nself.SetEnabled(TRUE)" ) (Script.20 Name: "BufferTheme.chk_Output.ManyBuffs.All.Click" SourceCode: "'BufferTheme.cbx_Output.ManyBuffs.All.Click\n'part of Buffer Theme Manager Extension\n\ncbxOne = self.GetDialog.FindByName(\"cbx_Output.ManyBuffs.One\")\nchkAll = self.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\")\n\nif (chkAll.IsSelected) then\n cbxOne.SetEnabled(FALSE)\n cbxOne.Update\nelse\n cbxOne.SetEnabled(TRUE)\n cbxOne.Update\nend" ) (Script.21 Name: "BufferTheme.chk_Theme.SelectedFeatures.Update" SourceCode: "'BufferTheme.chk_Theme.SelectedFeatures.Update\n'part of Buffer Theme Manager Extension\n\naDoc = self.GetDialog.GetActiveDoc\nif (aDoc.Is(View) and aDoc.GetThemes.IsEmpty.Not and ((self.GetDialog.GetServer.GetNumSelRecords)>0)) then\n self.SetEnabled(TRUE)\n self.SetSelected(TRUE) \nelse\n self.SetEnabled(FALSE)\n self.SetSelected(FALSE)\nend" ) (Script.22 Name: "BufferTheme.lbt_Cancel.Click" SourceCode: "'BufferTheme.lbt_Cancel.Click\n'part of Buffer Theme Manager Extension\n\n' Cancel the Dialog\n\ntheDialog = self.GetDialog\n\n' PUT NULL RESULTS INTO LIST AND SEND THEM BACK TO RUN BUTTON TO CANCEL\n\nresultList = {}\n\ntheDialog.SetModalResult(resultList)\n\ntheDialog.Close\n\n\n" ) (Script.23 Name: "BufferTheme.lbt_GO.Click" SourceCode: "'BufferTheme.lbt_GO.Click\n'part of Buffer Theme Manager Extension\n\n' Get user inputs for entire dialog box\n\ntheDialog = self.GetDialog\n\n' GET THE INPUTS FROM DIALOG\n\ntheTheme = theDialog.FindByName(\"cbx_Theme\").GetSelection\n\nselectionOnly = theDialog.FindByName(\"chk_Theme.SelectedFeatures\").IsSelected\n\nuserUnits = theDialog.FindByName(\"cbx_Distance.Units\").GetSelection\n\nmanual = theDialog.FindByName(\"rad_Distance.Manual\").IsSelected\n\nmanDistance = theDialog.FindByName(\"txl_Distance.Manual\").GetText\n\ndistFie ld = theDialog.FindByName(\"cbx_Distance.Field\").GetSelection\n\nbuffType = theDialog.FindByName(\"cbx_Type\").GetSelection\n\nmanyBuffs = theDialog.FindByName(\"rad_Output.ManyBuffs\").IsSelected\n\nallFields = theDialog.FindByName(\"chk_Output.ManyBuffs.All\").IsSelected\n\noneField = theDialog.FindByName(\"cbx_Output.ManyBuffs.One\").GetSelection\n\n' PUT RESULTS INTO LIST AND SEND THEM BACK TO RUN BUTTON\n\nresultList = {theTheme,selectionOnly,userUnits,manual,manDistance,distField,\n buffType,manyBuffs,allFiel ds,oneField}\n\ntheDialog.SetModalResult(resultList)\n\ntheDialog.Close\n\n\n" ) (Script.24 Name: "BufferTheme.Open" SourceCode: "'BufferTheme.Open\n'part of Buffer Theme Manager Extension\n\n' Dialog Box Open Script\n' Selects and updates various controls in the Dialog Box\n' Sets the listners, too\n'\n' Author: Kevin O'Malley\n' Date: 02/17/1998\n\ncbxTheme = self.FindByName(\"cbx_Theme\")\ncbxTheme.Update\n\nchkTheme = self.FindByName(\"chk_Theme.SelectedFeatures\")\nchkTheme.Update\n\ncbxDistance = self.FindByName(\"cbx_Distance.Units\")\ncbxDistance.Update\n\nradDistance = self.FindByName(\"rad_Distance.Manual\")\nradDistance.Select\n\nradManyBuffs = self.Fin dByName(\"rad_Output.ManyBuffs\")\nradManyBuffs.Select\n\ntxlDistanceManual=self.FindByName(\"txl_Distance.Manual\")\ntxlDistanceManual.Update\n\ncbxDistanceField=self.FindByName(\"cbx_Distance.Field\")\ncbxDistanceField.Update\n\ncbxType = self.FindByName(\"cbx_Type\")\ncbxType.Update\n\nself.FindByName(\"chk_Output.ManyBuffs.All\").SetSelected(TRUE)\n\ncbxOutputOne = self.FindByName(\"cbx_Output.ManyBuffs.One\")\ncbxOutputOne.Update\n\ncbxTheme.SetListeners({chkTheme,cbxDistanceField,cbxType,cbxOutputOne})\n\nself.FindByName(\"cpa_Outpu t.ManyBuffs.Field\").SetEnabled(TRUE)\ncbxOutputOne.SetEnabled(FALSE)" ) (Script.25 Name: "BufferTheme.rad_Distance.Field.Click" SourceCode: "'BufferTheme.rad_Distance.Field.Click\n'part of Buffer Theme Manager Extension\n\nself.GetDialog.FindByName(\"txl_Distance.Manual\").Update\nself.GetDialog.FindByName(\"cbx_Distance.Field\").Update" ) (Script.26 Name: "BufferTheme.rad_Distance.Manual.Click" SourceCode: "'BufferTheme.rad_Distance.Manual.Click\n'part of Buffer Theme Manager Extension\n\nself.GetDialog.FindByName(\"txl_Distance.Manual\").Update\nself.GetDialog.FindByName(\"cbx_Distance.Field\").Update" ) (Script.27 Name: "BufferTheme.rad_Output.ManyBuffs.Click" SourceCode: "'BufferTheme.rad_Output.ManyBuffs.Click\n'part of Buffer Theme Manager Extension\n\nself.GetDialog.FindByName(\"cpa_Output.ManyBuffs.Field\").SetEnabled(TRUE)\nself.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\").SetEnabled(TRUE)\nself.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\").SetSelected(TRUE)\ncbxMany = self.GetDialog.FindByName(\"cbx_Output.ManyBuffs.One\")\ncbxMany.Update\n" ) (Script.28 Name: "BufferTheme.rad_Output.OneBuff.Click" SourceCode: "'BufferTheme.rad_Output.OneBuff.Click\n'part of Buffer Theme Manager Extension\n\nself.GetDialog.FindByName(\"cpa_Output.ManyBuffs.Field\").SetEnabled(FALSE)\nself.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\").SetEnabled(FALSE)\nself.GetDialog.FindByName(\"chk_Output.ManyBuffs.All\").SetSelected(FALSE)\nself.GetDialog.FindByName(\"cbx_Output.ManyBuffs.One\").Update\n" ) (Script.29 Name: "BufferTheme.txl_Distance.Manual.Update" SourceCode: "'BufferTheme.txl_Distance.Manual.Update\n'part of Buffer Theme Manager Extension\n\nradio = self.GetDialog.FindByName(\"rad_Distance.Manual\")\n\nif (radio.IsSelected) then\n self.SetEnabled(TRUE)\n self.SetText(\"0.0\")\nelse\n self.SetText(\"0.0\")\n self.SetEnabled(FALSE)\nend " ) (Script.30 Name: "BufferTheme.RunDialog" SourceCode: "'BufferTheme.RunDialog\n' part of Buffer Theme Manager Extension\n' \n' BufferTheme Primary Run Script\n' Author: Kevin O'Malley, KevOMalley@juno.com\n' Date: 02/17/1998\n'\n' Runs the Dialog Box, then takes User input and creates buffer theme based on that input.\n' Concept, structure and code taken or modeled after ESRI script AV3Buffs.ave, found on\n' ESRI web site.\n\n\n' FIRST CHECK IF THE VIEW HAS ITS UNITS SET\n\ntheView = av.GetActiveDoc\n\nif (theView.GetUnits=\"#UNITS_LINEAR_UNKNOWN\".asEnum) then\n Ms gBox.Error(\"Before running, please select\"+NL+\"the map units for the view, \"+theView.asString,\"No units!\")\n exit\n \n' IF OK, RUN THE PROGRAM \n\nelse \n\n ' OPEN THE DIALOG BOX AND RECEIVE ITS RESULTS\n ' (GO OR CANCEL BUTTON ON DIALOG WILL CLOSE THE DIALOG)\n \n theDialog = av.FindDialog(\"BufferTheme\")\n theDialog.Open\n resultList = theDialog.GetModalResult\n \n ' Cancel button was used\n if (resultList.Count=0) then exit\n end\n \n ' TURN RESULTS INTO PARAMETERS\n \n theTheme = resultList.Get(0)\n s electionOnly = resultList.Get(1)\n userUnits = resultList.Get(2)\n manual = resultList.Get(3)\n manDistance = resultList.Get(4)\n distField = resultList.Get(5)\n buffType = resultList.Get(6)\n manyBuffs = resultList.Get(7)\n allFields = resultList.Get(8)\n oneField = resultList.Get(9)\n \n ' MAKE OTHER NEEDED PARAMETERS\n \n thePrj = theView.GetProjection\n theFTab = theTheme.GetFTab\n inFields = theFTab.GetFields\n \n viewUnits = theView.GetUnits\n \n \n ' CREATE OUTPUT THEME NAME\n \n fName = FileName.Mak e(av.GetProject.GetWorkDir.AsString).MakeTmp(\"buff\",\"shp\")\n \n repFlag = 0\n \n while (repFlag = 0)\n outName = FileDialog.Put(fName,\"*.shp\",\"Output Theme Name\")\n if (outName = NIL) then\n exit\n elseif (outName.GetBaseName.AsTokens(\".\").Get(0).Contains(\" \")) then\n MsgBox.Warning(\"Output theme name not specified. Please re-enter\",\"Warning\")\n else\n repFlag = 1\n end\n end\n \n repFlag = 0\n \n ' CREATE OUTPUT FTAB AND CREATE NEW FIELDS BASED ON USER INPUT\n \n outFTab = FTab.MakeNew(outName,Polygon)\n outFields = List.Make\n outFields.Add(Field.Make(\"Buff_id\",#FIELD_LONG,8,0))\n outFields.Add(Field.Make(\"Buff_dist\",#FIELD_FLOAT,12,5))\n outFields.Add(Field.Make(\"Buff_area\",#FIELD_FLOAT,12,5))\n \n if (allFields) then\n for each fld in inFields\n if (fld.IsTypeShape.Not) then\n outFields.Add(fld.Clone)\n end\n end\n elseif (manyBuffs) then\n outFields.Add(oneField.Clone)\n end\n \n outFTab.AddFields(outFields)\n \n outShapeField = outFTab.FindField(\" Shape\")\n outIdField = outFTab.FindField(\"Buff_id\")\n outDistField = outFTab.FindField(\"Buff_dist\")\n outAreaField = outFTab.FindField(\"Buff_area\")\n \n ' GET RECORDS TO BUFFER, AND SAVE ORIGINAL SELECTION\n \n theSelection = theFTab.GetSelection\n tempSelect = BitMap.Make(theSelection.GetSize)\n tempSelect.Copy(theSelection)\n \n if (selectionOnly.Not) then \n theFTab.GetSelection.SetAll\n theSelection = theFTab.GetSelection\n end\n \n ' SET STATUS BAR\n \n av.ShowMsg(\"Buffering\"++theTheme.GetName+\".. .\")\n av.ShowStopButton\n av.SetStatus(0)\n \n ' GET BUFFER UNITS\n \n buFrom = (\"#UNITS_LINEAR_\"+userUnits.UCase).AsEnum\n buTo = theView.GetUnits\n \n ' START MAKING BUFFERS\n \n xrec = 0\n inShapeField = theFTab.FindField(\"Shape\")\n \n for each irec in theSelection\n \n xrec = xrec + 1\n \n ' BRING IN SHAPES BASED ON REQUESTED BUFFER TYPE\n \n if (buffType = \"Boundary\") then\n fShape = theFTab.ReturnValue(inShapeField,irec).AsPolyLine\n elseif (buffType.Contains(\"Node\")) then\n p List = theFTab.ReturnValue(inShapeField,irec).AsMultiPoint.AsList\n if (buffType = \"Nodes\") then\n fShape = Point.Make(pList.Get(0).GetX,pList.Get(0).GetY)\n tShape = Point.Make(pList.Get(pList.Count - 1).GetX,pList.Get(pList.Count - 1).GetY)\n elseif (buffType = \"NodeF\") then\n fShape = Point.Make(pList.Get(0).GetX,pList.Get(0).GetY)\n else\n fShape = Point.Make(pList.Get(pList.Count - 1).GetX,pList.Get(pList.Count - 1).GetY)\n end\n else\n fShape = theFTab.Ret urnValue(inShapeField,irec)\n end\n \n ' CALCULATE BUFFER DISTANCE\n \n if (manual) then\n bufNum = manDistance.AsNumber\n else\n bufNum = theFTab.ReturnValue(distField,irec)\n end\n \n if (bufNum.isNull) then\n bufNum = 0\n end\n \n bufDist = Units.Convert(bufNum,buFrom,buTo)\n if ((bufNum < 0) and (bufDist > 0)) then\n bufDist = bufDist * -1 \n end\n \n if ((buffType <> \"Inside/Outside\") and (buffType <> \"Polygon+/Polygon-\")) then\n bufNum = bufN um.Abs\n bufDist = bufDist.Abs\n end\n \n ' CREATE BUFFER POLYGON\n \n xPoly = fShape.ReturnBuffered(bufDist)\n if (buffType = \"Inside/Outside\") then\n bufPoly = fShape.ReturnMerged(xPoly)\n if (xPoly.IsEmpty) then\n bufPoly = fShape\n end\n elseif (buffType = \"Nodes\") then\n bufPoly = xPoly\n tPoly = tShape.ReturnBuffered(BufDist)\n else \n bufPoly = xPoly\n end\n \n ' CALCULATE BUFFER POLYGON AREA\n \n bufArea = Units.ConvertArea(bufPoly.ReturnA rea,buTo,buFrom)\n if (buffType = \"Nodes\") then\n tArea = Units.ConvertArea(tPoly.ReturnArea,buTo,buFrom)\n end\n \n ' CREATE BUFFER POLYGON ATTRIBUTE RECORD\n \n orec = outFTab.AddRecord\n outFTab.SetValue(outShapeField,orec,bufPoly)\n outFTab.SetValueNumber(outIdField,orec,xrec)\n outFTab.SetValueNumber(outDistField,orec,bufNum)\n outFTab.SetValueNumber(outAreaField,orec,bufArea)\n if (manyBuffs) then\n if (allFields.Not) then\n outFTab.SetValue(outFTab.FindField(oneFie ld.AsString),orec,theFTab.ReturnValue(oneField,irec))\n else\n xCount = 0\n for each newrec in outFTab.GetFields\n if (xCount > 3) then\n outFTab.SetValue(newrec,orec,theFTab.ReturnValue(inFields.Get(xCount-3),irec))\n end\n xCount = xCount + 1\n end\n end \n end \n \n ' IF NODES BUFFER OF LINE, MAKE EXTRA RECORD FOR T RECORD\n \n if (buffType = \"Nodes\") then\n orec = outFTab.AddRecord\n outFTab.SetValue(outShape Field,orec,tPoly)\n outFTab.SetValueNumber(outIdField,orec,xRec * -1)\n outFTab.SetValueNumber(outDistField,orec,bufNum)\n outFTab.SetValueNumber(outAreaField,orec,tArea)\n if (manyBuffs) then\n if (allFields.Not) then\n outFTab.SetValue(outFTab.FindField(oneField.AsString),orec,theFTab.ReturnValue(oneField,irec))\n else\n xCount = 0\n for each newrec in outFTab.GetFields\n if (xCount > 3) then\n outFTab.SetValue(newrec,orec,theFTab.R eturnValue(inFields.Get(xCount-3),irec))\n end\n xCount = xCount + 1\n end\n end \n end \n end \n \n ' UPDATE STATUS BAR\n \n proceed = av.SetStatus((xrec / theSelection.Count) * 100)\n if (proceed.Not) then\n av.ClearStatus\n av.ShowMsg(\"Stopped\")\n exit\n end \n \n end 'for each irec\n \n av.SetStatus(100)\n \n outTheme = FTheme.Make(outFTab)\n theView.AddTheme(outTheme)\n\n \n ' MODIFY OUTPUT THEME\n \n if (manyBuffs.Not) th en\n theView.SetEditableTheme(outTheme)\n outFTab = outTheme.GetFTab\n \n shpList = List.Make\n \n ' GET OUTPUT THEME RECORDS\n \n outNumRecs = outFTab.GetNumRecords\n \n ' SET MODIFY ROUTINE STATUS BAR\n \n av.ShowMsg(\"Modifying\"++outTheme.GetName+\"...\")\n av.ShowStopButton\n av.SetStatus(0)\n \n ' START MODIFY ROUTINE\n \n for each orec in (outNumRecs - 1)..0\n \n ' OVERLAY SHAPES\n \n selShape = outFTab.ReturnValue(outShapeField,orec)\n \n shpList = shpList.Add(selShape)\n outFTab.SelectByShapes(shpList,#VTAB_SELTYPE_NEW)\n if (outFTab.GetSelection.Count > 1) then\n outTheme.UnionSelected\n outFTab.Refresh\n end\n\n' DISPLAY MODIFY ROUTINE STATUS\n\n proceed = av.SetStatus((orec / outNumRecs) * 100)\n \n if (proceed.Not) then\n av.ClearStatus\n av.ShowMsg(\"Stopped\")\n exit\n end\n\n' END MODIFY ROUTINE\n \n end\n\n av.SetStatus(100)\n\n outTheme.ClearSelection\n outFTab.Flush\n\n ' SET UPDATE ROUTINE STATUS BA R\n\n av.ShowMsg(\"Modifying\"++outTheme.GetName+\"...\")\n av.ShowStopButton\n av.SetStatus(0)\n \n ' START UPDATE ROUTINE\n\n for each orec in outFTab\n\n ' CALCULATE OUTPUT THEME POLYGON AREA\n\n fShape = outFTab.ReturnValue(outShapeField,orec)\n bufArea = Units.ConvertArea(fShape.ReturnArea,buTo,buFrom)\n \n ' UPDATE OUTPUT THEME FTAB\n\n outIdField = outFTab.FindField(\"Buff_id\")\n outDistField = outFTab.FindField(\"Buff_dist\")\n outAreaField = outFTab.FindField(\"Buff_area\")\n \n outFTab.SetValue(outIdField,orec,1)\n if (manual) then\n outFTab.SetValue(outDistField,orec,bufNum)\n else\n outFTab.SetValue(outDistField,orec,0)\n end\n outFTab.SetValue(outAreaField,orec,bufArea)\n \n ' END UPDATE ROUTINE\n\n end\n \n end 'if (manyBuffs.Not) \n\n av.SetStatus(100)\n\n outFTab.SetEditable(FALSE)\n\n outTheme.SetVisible(TRUE)\n \n theFTab.SetSelection(tempSelect)\n theFTab.UpdateSelection\n \n av.ClearMsg\n av.ClearStatus\n \nend ' THE WHOLE PROGRAM" ) (AVDLog.31 Name: "BufferTheme" X: 267 Y: 63 W: 252 H: 374 ConstrainedControlNames: 32 ConstrainedControlNames: 33 Constraints: 34 Constraints: 35 Server: 36 ControlPanel: 37 Title: "Buffer Theme" Modal: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Open: "BufferTheme.Open" DefaultButton: 74 ) (AVStr.32 S: "lbt_GO" ) (AVStr.33 S: "blt_Cancel" ) (Numb.34 N: 85.00000000000000 ) (Numb.35 N: 85.00000000000000 ) (Nil.36 ) (CPanel.37 Child: 38 Child: 40 Child: 41 Child: 53 Child: 54 Child: 65 Child: 66 ResBox: 67 ResBox: 68 ResBox: 69 ResBox: 70 ResBox: 71 ResBox: 72 ResBox: 73 Listening: 1 ) (AVCBBox.38 InternalName: "cbx_Theme" Update: "BufferTheme.cbx_Theme.Update" NextControl: 39 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Theme to buffer:" Select: "BufferTheme.cbx_Theme.Select" ) (Nil.39 ) (AVCBox.40 InternalName: "chk_Theme.SelectedFeatures" Update: "BufferTheme.chk_Theme.SelectedFeatures.Update" Listening: 1 Label: "Buffer only selected features" Constraints: 0x55 ) (CPanel.41 InternalName: "cpa_Distance" Child: 42 Child: 43 Child: 44 Child: 46 Child: 47 Constraints: 0x55 ResBox: 48 ResBox: 49 ResBox: 50 ResBox: 51 ResBox: 52 Label: "Buffer Distance" VisibleBorder: 1 Listening: 1 ) (AVCBBox.42 InternalName: "cbx_Distance.Units" Update: "BufferTheme.cbx_Distance.Units.Update" NextControl: 39 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Select Units:" ) (RButn.43 InternalName: "rad_Distance.Manual" Constraints: 0x55 Listening: 1 Label: "Enter a distance" Click: "BufferTheme.rad_Distance.Manual.Click" ) (TextLine.44 InternalName: "txl_Distance.Manual" Update: "BufferTheme.txl_Distance.Manual.Update" Label: " " Constraints: 0x55 Listening: 1 TextType: 45 NextControl: 39 ) (AVEnum.45 Name: "TEXTLINE_TYPE_REAL" ) (RButn.46 InternalName: "rad_Distance.Field" Constraints: 0x55 Listening: 1 Label: "Use a distance field" Click: "BufferTheme.rad_Distance.Field.Click" ) (AVCBBox.47 InternalName: "cbx_Distance.Field" Update: "BufferTheme.cbx_Distance.Field.Update" NextControl: 39 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (RectD.48 Left: 18.00000000000000 Top: 118.00000000000000 Right: 205.00000000000000 Bottom: 19.00000000000000 ) (RectD.49 Left: 14.00000000000000 Top: 57.00000000000000 Right: 125.00000000000000 Bottom: 42.00000000000000 ) (RectD.50 Left: 128.00000000000000 Top: 61.00000000000000 Right: 205.00000000000000 Bottom: 41.00000000000000 ) (RectD.51 Left: 14.00000000000000 Top: 80.00000000000000 Right: 159.00000000000000 Bottom: 65.00000000000000 ) (RectD.52 Left: 47.00000000000000 Top: 201.00000000000000 Right: 203.00000000000000 Bottom: 83.00000000000000 ) (AVCBBox.53 InternalName: "cbx_Type" Update: "BufferTheme.cbx_Type.Update" NextControl: 39 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Type of Buffer" ) (CPanel.54 InternalName: "cpa_Output" Child: 55 Child: 56 Child: 57 Constraints: 0x55 ResBox: 62 ResBox: 63 ResBox: 64 Label: "Output" VisibleBorder: 1 Listening: 1 ) (RButn.55 InternalName: "rad_Output.OneBuff" Constraints: 0x55 Listening: 1 Label: "Combine all buffers into one shape" Click: "BufferTheme.rad_Output.OneBuff.Click" ) (RButn.56 InternalName: "rad_Output.ManyBuffs" Constraints: 0x55 Listening: 1 Label: "One buffer for each feature" Click: "BufferTheme.rad_Output.ManyBuffs.Click" ) (CPanel.57 InternalName: "cpa_Output.ManyBuffs.Field" Child: 58 Child: 59 Constraints: 0x55 ResBox: 60 ResBox: 61 Label: "Choose field(s) to put into output" VisibleBorder: 1 Listening: 1 ) (AVCBox.58 InternalName: "chk_Output.ManyBuffs.All" Listening: 1 Label: "All Fields" Click: "BufferTheme.chk_Output.ManyBuffs.All.Click" Constraints: 0x55 ) (AVCBBox.59 InternalName: "cbx_Output.ManyBuffs.One" Update: "BufferTheme.cbx_Output.ManyBuffs.One.Update" NextControl: 39 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "One Field:" ) (RectD.60 Left: 13.00000000000000 Top: 32.00000000000000 Right: 158.00000000000000 Bottom: 18.00000000000000 ) (RectD.61 Left: 13.00000000000000 Top: 136.00000000000000 Right: 175.00000000000000 Bottom: 37.00000000000000 ) (RectD.62 Left: 7.00000000000000 Top: 106.00000000000000 Right: 202.00000000000000 Bottom: 88.00000000000000 ) (RectD.63 Left: 7.00000000000000 Top: 34.00000000000000 Right: 212.00000000000000 Bottom: 12.00000000000000 ) (RectD.64 Left: 25.00000000000000 Top: 87.00000000000000 Right: 206.00000000000000 Bottom: 30.00000000000000 ) (LButn.65 InternalName: "lbt_GO" Label: "GO!" Click: "BufferTheme.lbt_GO.Click" ) (LButn.66 InternalName: "blt_Cancel" Label: "Cancel" Click: "BufferTheme.lbt_Cancel.Click" ) (RectD.67 Left: 20.00000000000000 Top: 120.00000000000000 Right: 236.00000000000000 Bottom: 17.00000000000000 ) (RectD.68 Left: 48.00000000000000 Top: 53.00000000000000 Right: 219.00000000000000 Bottom: 36.00000000000000 ) (RectD.69 Left: 20.00000000000000 Top: 165.00000000000000 Right: 237.00000000000000 Bottom: 57.00000000000000 ) (RectD.70 Left: 21.00000000000000 Top: 271.00000000000000 Right: 237.00000000000000 Bottom: 176.00000000000000 ) (RectD.71 Left: 20.00000000000000 Top: 312.00000000000000 Right: 235.00000000000000 Bottom: 200.00000000000000 ) (RectD.72 Left: 46.00000000000000 Top: 352.00000000000000 Right: 108.00000000000000 Bottom: 327.00000000000000 ) (RectD.73 Left: 146.00000000000000 Top: 351.00000000000000 Right: 197.00000000000000 Bottom: 330.00000000000000 ) (Nil.74 ) (Script.75 Name: "BufferTheme.CanUnload" SourceCode: "'BufferTheme.CanUnload\n'part of Buffer Theme Manager Extension\n\nreturn (System.CanUnloadLibrary(self.GetDependencies.get(0)))" ) (Script.76 Name: "BufferTheme.Unload" SourceCode: "'BufferTheme.Unload\nDialog.DetachFromExtension(self)" ) (Script.77 Name: "BufferTheme.Install" SourceCode: "'BufferTheme.Install\n'Taken from Extension Builder\n\n'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.Get(3)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Controls\n'\nfor each totalControl in theControlList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The cont rol Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex)\nend\n\n\n'Add the menus\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\" The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n themenu=menu.make\n themenu.setlabel(mMenu)\n theMbar.add(themenu,999)\n end\n \n themenu.add(thecontrol, theCindex)\nend\n \n \n'Add the Tool Menus\n\nfor each totalControl in theToolMenuList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control \n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrol set=av.getproject.findGUI(aControl.get(0)).GetToolBar\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex)\nend\n\n\nav.getproject.setmodified(true)\n\n\n'And the scripts add themselves\n" ) (Script.78 Name: "BufferTheme.Uninstall" SourceCode: "'BufferTheme.Uninstall\n'Taken from Extension Builder\n\n'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.get(3)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n end\nend\n\n'Removethe Controls\n'\nfor each t otalControl in theControlList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This se quence finds the appropiate control set\n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n\n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n theControlSet.remove(theControl)\n if (thecontrol = \"ToolBar\") then\n theControlSet.selectdefault\n end\n end\nend\n\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Eror\")\n 'return(nil)\n else\n \n thething=themenu.getcontrols.find(thecontrol)\n if (thething<>NIL) then \n themenu.remove(thecontrol) \n end\n 'msgbox.info(themenu.GetControls.count.asstring,\"\")\n if (themenu.GetControls.count<1) then\n theMbar.remove(themenu)\n end\n end\nend\n \nfor each totalControl in theToolMenuList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This sequence fin ds the appropiate control set\n thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n\n \n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n theControlSet.remove(theControl)\n theControlSet.selectdefault\n end\n\nend\n \n\n'And the scripts delete themselves\n\n\nav.getproject.setmodified(true)\n" )