/3.1 (Extension.1 Name: "CLU Quality Control extension" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 22 Roots: 23 Roots: 73 Roots: 74 Roots: 75 Roots: 76 Roots: 77 Roots: 78 Roots: 79 Roots: 80 Roots: 81 Roots: 82 Roots: 83 Roots: 84 Roots: 85 Roots: 86 Version: 31 About: "Digitizing Quality Control Tools extension - Version Date: 08/6/99 03:19 PM" InstallScript: 87 UninstallScript: 88 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 ) (AVDLog.4 Name: "ErrorCheck1" X: 826 Y: 179 W: 229 H: 122 ConstrainedControlNames: 5 ConstrainedControlNames: 6 Constraints: 7 Constraints: 8 Server: 9 ControlPanel: 10 Title: "Multipart Polygon Error Check" EscapeEnabled: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Close: "ErrorCheck1.Close" Open: "ErrorCheck1.Open" DefaultButton: 21 ) (AVStr.5 S: "lb_next" ) (AVStr.6 S: "lb_fix" ) (Numb.7 N: 85.00000000000000 ) (Numb.8 N: 85.00000000000000 ) (Nil.9 ) (CPanel.10 Child: 11 Child: 12 Child: 14 Child: 16 ResBox: 17 ResBox: 18 ResBox: 19 ResBox: 20 Listening: 1 ) (LButn.11 InternalName: "lb_next" Label: "Next Record" Click: "ErrorCheck1.lb_next.Click" ) (TextLine.12 InternalName: "tl_errcount" Text: "1" Label: "Total Errors" Constraints: 0x55 Listening: 1 TextType: 13 NextControl: 9 ) (AVEnum.13 Name: "TEXTLINE_TYPE_ALL" ) (TextLine.14 InternalName: "tl_current" Text: "1" Label: "Current" Constraints: 0x55 Listening: 1 TextType: 15 NextControl: 9 ) (AVEnum.15 Name: "TEXTLINE_TYPE_ALL" ) (LButn.16 InternalName: "lb_fix" Label: "Separate" Click: "FSA Separate Multipart Polygons" ) (RectD.17 Left: 35.00000000000000 Top: 111.00000000000000 Right: 107.00000000000000 Bottom: 72.00000000000000 ) (RectD.18 Left: 15.00000000000000 Top: 60.00000000000000 Right: 132.00000000000000 Bottom: 40.00000000000000 ) (RectD.19 Left: 15.00000000000000 Top: 31.00000000000000 Right: 132.00000000000000 Bottom: 11.00000000000000 ) (RectD.20 Left: 129.00000000000000 Top: 110.00000000000000 Right: 201.00000000000000 Bottom: 71.00000000000000 ) (Nil.21 ) (List.22 ) (List.23 Child: 24 Child: 31 Child: 38 Child: 45 Child: 52 Child: 59 Child: 66 ) (List.24 Child: 25 Child: 29 Child: 30 ) (List.25 Child: 26 Child: 27 Child: 28 ) (AVStr.26 S: "View" ) (AVStr.27 S: "Quality Control" ) (AVStr.28 S: "FSA Show Multipart Polygons" ) (Choice.29 Label: "Check Multipart Polygons" Click: "FSA Show Multipart Polygons" Shortcut: "Keys.None" ) (Numb.30 ) (List.31 Child: 32 Child: 36 Child: 37 ) (List.32 Child: 33 Child: 34 Child: 35 ) (AVStr.33 S: "View" ) (AVStr.34 S: "Quality Control" ) (AVStr.35 S: "FSA Check for Overlaps" ) (Choice.36 Label: "Check for Overlapping Polygons" Click: "FSA Check for Overlaps" Shortcut: "Keys.None" ) (Numb.37 N: 1.00000000000000 ) (List.38 Child: 39 Child: 43 Child: 44 ) (List.39 Child: 40 Child: 41 Child: 42 ) (AVStr.40 S: "View" ) (AVStr.41 S: "Quality Control" ) (AVStr.42 S: "FSA Show Sliver Polygons" ) (Choice.43 Label: "Show Sliver Polygons" Click: "FSA Show Sliver Polygons" Shortcut: "Keys.None" ) (Numb.44 N: 2.00000000000000 ) (List.45 Child: 46 Child: 50 Child: 51 ) (List.46 Child: 47 Child: 48 Child: 49 ) (AVStr.47 S: "View" ) (AVStr.48 S: "Quality Control" ) (AVStr.49 S: "FSA Show Void Polygons" ) (Choice.50 Label: "Show Void Polygons" Click: "FSA Show Void Polygons" Shortcut: "Keys.None" ) (Numb.51 N: 3.00000000000000 ) (List.52 Child: 53 Child: 57 Child: 58 ) (List.53 Child: 54 Child: 55 Child: 56 ) (AVStr.54 S: "View" ) (AVStr.55 S: "Quality Control" ) (AVStr.56 S: "FSA Clean Polygons" ) (Choice.57 Label: "Clean Polygons" Click: "FSA Clean Polygons" Shortcut: "Keys.None" ) (Numb.58 N: 4.00000000000000 ) (List.59 Child: 60 Child: 64 Child: 65 ) (List.60 Child: 61 Child: 62 Child: 63 ) (AVStr.61 S: "View" ) (AVStr.62 S: "Quality Control" ) (AVStr.63 S: "FSA Random Selection" ) (Choice.64 Label: "Random Sample Selection" Click: "FSA Random Selection" Shortcut: "Keys.None" ) (Numb.65 N: 5.00000000000000 ) (List.66 Child: 67 Child: 71 Child: 72 ) (List.67 Child: 68 Child: 69 Child: 70 ) (AVStr.68 S: "View" ) (AVStr.69 S: "Quality Control" ) (AVStr.70 S: "FSA Stack Autolabel" ) (Choice.71 Tag: "Fields.shp,Clunumber,Tract,Farm,Hel,Calcacres" Label: "Multi-item Autolabel" Click: "FSA Stack Autolabel" Shortcut: "Keys.None" ) (Numb.72 N: 6.00000000000000 ) (List.73 ) (Script.74 Name: "Open ErrorCheck" SourceCode: "_theList = self.Get(0)\n_theTheme = self.Get(1)\n_theType = self.Get(2)\ntheDialog = av.GetProject.FindDialog(\"ErrorCheck1\")\ntheDialog.Open" ) (Script.75 Name: "ErrorCheck1.Open" SourceCode: "theCurrent = self.FindByName(\"tl_current\")\ntheTotal = self.FindByName(\"tl_errcount\")\nNextButton = self.FindByName(\"lb_next\")\nFixButton = self.FindByName(\"lb_fix\")\n\nif (_theType = \"Multipart\") then\nself.SetTitle(\"Multipart Polygon Error Check\")\nFixButton.SetVisible(True)\nFixButton.SetEnabled(True)\nFixButton.SetLabel(\"Separate\")\nFixButton.SetClick(\"FSA Separate Multipart Polygons\")\nelseif (_theType = \"Overlap\") then\nself.SetTitle(\"Overlapping Polygon Error Check\")\nFixButton.SetVisible(True)\nFixButton.SetEnabl ed(True)\nFixButton.SetLabel(\"Delete\" + nl + \"Graphics\")\nFixButton.SetClick(\"FSA Select&Delete Graphics\")\nelseif (_theType = \"Void\") then\nself.SetTitle(\"Void Polygon Error Check\")\nFixButton.SetVisible(False)\nelseif (_theType = \"Sliver\") then\nself.SetTitle(\"Sliver Polygon Error Check\")\nFixButton.SetVisible(False)\n\nend\n\n\ntheTotal.SetText(_theList.Count.AsString)\ntheCurrent.SetText(\"1\")\n\ntheView = av.GetActiveDoc\ntheGraphics = theView.GetGraphics\n\ntheShape = _theList.Get(0)\n \ntheFTab = _theTheme.GetFTab\nshpFld = theFTab.FindField(\"Shape\")\n\ntheFTab.SelectByPolygon(theShape,#VTAB_SELTYPE_NEW)\n\nif (_theType = \"Overlap\") then\n gShpdiff = GraphicShape.make(theShape)\n bgcolor = Color.GetBlue\n bgcolor.SetTransparent(TRUE)\n aVFill = VectorFill.Make\n aVFill.SetStyle(#VECTORFILL_STYLE_DOT)\n aVFill.SetColor(Color.GetRed)\n aVFill.SetBgColor(bgcolor)\n aVFill.SetOLColor(Color.GetBlack)\n gShpDiff .SetSymbol(aVFill)\n theGraphics.Add(gShpDiff)\n\nelse\n for each x in theFTab.GetSelection\n testShp = theFTab.ReturnValue(shpFld,x)\n \n if (testShp <> theShape) then\n theFTab.GetSelection.Clear(x)\n end\n end\n theFtab.UpdateSelection\nend\n\nav.run(\"View.ZoomToSelected\",nil)\n\nif (theView.ReturnScale < 300) then\ntheView.GetDisplay.ZoomToScale(300)\nend\n\n\n" ) (Script.76 Name: "ErrorCheck1.Close" SourceCode: "_theList = {}\n_theTheme = nil\n_theType = nil" ) (Script.77 Name: "ErrorCheck1.lb_next.Click" SourceCode: "theCurrent = self.GetDialog.FindByName(\"tl_current\")\n\nListCount = _theList.Count\n\nCurVal = theCurrent.GetText.AsNumber\n\nNewVal = CurVal + 1\n\nif (NewVal > ListCount) then\nreturn nil\nend\n\ntheCurrent.SetText(NewVal.AsString)\ntheView = av.GetActiveDoc\ntheGraphics = theView.GetGraphics\n\n\ntheShape = _theList.Get(CurVal)\n\ntheFTab = _theTheme.GetFTab\nshpFld = theFTab.FindField(\"Shape\")\n\ntheFTab.SelectByPolygon(theShape,#VTAB_SELTYPE_NEW)\n\nif (_theType = \"Overlap\") then\n gShpdiff = GraphicShape.make(th eShape)\n bgcolor = Color.GetBlue\n bgcolor.SetTransparent(TRUE)\n aVFill = VectorFill.Make\n aVFill.SetStyle(#VECTORFILL_STYLE_DOT)\n aVFill.SetColor(Color.GetRed)\n aVFill.SetBgColor(bgcolor)\n aVFill.SetOLColor(Color.GetBlack)\n gShpDiff.SetSymbol(aVFill)\n theGraphics.Add(gShpDiff)\n\nelse\n for each x in theFTab.GetSelection\n testShp = theFTab.ReturnValue(shpFld,x)\n \n i f (testShp <> theShape) then\n theFTab.GetSelection.Clear(x)\n end\n end\n theFtab.UpdateSelection\nend\n\n\nav.run(\"View.ZoomToSelected\",nil)\n\nif (theView.ReturnScale < 300) then\ntheView.GetDisplay.ZoomToScale(300)\nend\n\n\n\n\n\n" ) (Script.78 Name: "FSA Separate Multipart Polygons" SourceCode: " 'program: FSA Separate Multipart Polygons\n 'programmer: Jim Heald, FSA\n 'date: 4/22/99\n '\n 'purpose: Separates polygons which have been combined but are not adjacent.\n '\n \n theView = av.GetActiveDoc\n theTheme = theView.GetActiveThemes.Get(0)\n \n \n thePoly = Polygon.MakeNull\n anFTab = theTheme.GetFTab\ntheBitmap = anFTab.GetSelection\n'theBitmap.Clearall\nshapeF = anFTab.FindField(\"Shape\")\n\ntheFields = anFTab.GetFields\ntheCount = theFields.Count\ntheDict = Dictionary.Make(theCount)\n\nif (anFTab.StartEditingWithR ecovery) then\n for each x in anFTab.GetSelection\n theshape = anFTab.QueryShape (x, theView.GetProjection, thePoly)\n\n thePolys = thePoly.explode\n\n if (thePolys.count > 1) then \n 'theBitmap.Set(x)\n' anFTab.UpdateSelection\n 'av.Run(\"View.ZoomToSelected\",nil)\n ' theView.Invalidate\n 'yesno = MsgBox.YesNo(\"Do you want to Separate the Polygons?\",\"Title\",TRUE)\n\n for each theItem in theFields\n\n if (theItem.Getname <> \"Shape\") then\n theValue = anFTab.ReturnValue(theItem, x)\n theDic t.Add(theItem,TheValue)\n end\n \nend\n \n 'if (yesno) then\n anFTab.RemoveRecord(x)\n for each newpoly in thePolys\n newRec = anFTab.AddRecord \n anFTab.SetValue( shapeF, newRec, newpoly )\n\n theKeys = theDict.ReturnKeys\n \n for each keyval in theKeys\n theVal = theDict.Get(keyval)\n anFTab.SetValue(keyval, newRec, theVal)\n end\n\n end\n 'end\nend\n\ntheBitmap.Clearall\nend\n\nend\n\nanFTab.StopEditingWi thRecovery(TRUE)\n ' query and apply selection \n \n anFTab.UpdateSelection\n \nav.PurgeObjects \n theView.Invalidate\n\n\n" ) (Script.79 Name: "FSA Select&Delete Graphics" SourceCode: "theView = av.GetActiveDoc\ntheTheme = theView.GetActiveThemes.Get(0)\n\nanFTab = theTheme.GetFTab\n\nanFTab.StopEditingWithRecovery(TRUE)\n\nav.run(\"Graphic.SelectAll\",nil)\nav.run(\"View.DeleteGraphics\",nil)" ) (Script.80 Name: "FSA Show Multipart Polygons" SourceCode: " 'program: FSA Show Multipart Polygons\n 'programmer: Jim Heald, FSA\n 'date: 4/22/99\n '\n 'purpose: highlights polygons which have been combined but are not adjacent.\n '\n \n theView = av.GetActiveDoc\n theTheme = theView.GetActiveThemes.Get(0)\n \n \n thePoly = Polygon.MakeNull\n anFTab = theTheme.GetFTab\n shpFld = anFTab.FindField(\"Shape\")\n theList = List.Make\n\ntheBitmap = anFTab.GetSelection\ntheBitmap.ClearAll\ntheGraphics = theView.GetGraphics\n for each x in anFTab\n thePoly = anFTab.ReturnValue(shpFld,x)\n\n thePolys = thePoly.explode\n\n if (thePolys.count > 1) then \n ' theBitmap.Set(x)\n' theGShape = GraphicShape.make(thePoly)\n' bgcolor = Color.GetBlue\n' bgcolor.SetTransparent(TRUE)\n' aVFill = VectorFill.Make\n' aVFill.SetStyle(#VECTORFILL_STYLE_DOT)\n' aVFill.SetColor(Color.GetRed)\n' aVFill.SetBgColor(bgcolor)\n' aVFill.SetOLColor(Color.GetBlack)\n' theGShape.SetSymbol(aVFill)\n'\n'\n' theGraphics.Add(theGShape)\ntheList.Add(thePoly)\n \n end\n\n end\n\n\n\n ' query and apply selection \n \n anFTab.UpdateSelection\n theView.Invalidate\n\nif (theList.Count > 0) then\nav.Run(\"Open ErrorCheck\",{theList,theTheme,\"Multipart\"})\nelse\nMsgBox.Info(\"No Errors Found\",\"Multipart Polygon Error Checking\")\nend\n" ) (Script.81 Name: "FSA Check for Overlaps" SourceCode: "' program: FSA Check for Overlaps\n' programmer: Jim Heald, FSA\n'\n' date: 12/22/98\n'\n' purpose: Checks the active Theme for overlapping polygons and creates a graphic\n' shape for each overlap that it finds.\n'\ntheView = av.GetActiveDoc\ntheTheme = theView.GetActiveThemes.Get(0)\n\ntheGraphics = theView.GetGraphics\ntheList = List.Make\ntheFTab = theTheme.GetFTab\ncompTab = theFTab.Clone\nshpFld = theFTab.FindField(\"Shape\")\ncshpFld = compTab.FindField(\"Shape\")\n\ntheBitmap = theFTab.GetSelection\ntheBitmap.Clea rAll\n'theFTab.SetSelection(theBitMap)\nshpDiff = Polygon.MakeNull\ntheCount = theFTab.GetNumRecords\ni = 0\n\nfor each x in theFTab\ntheShape = TheFTab.ReturnValue(shpFld,x)\ni = i + 1\n\ncompTab.SelectByPolygon(theShape,#VTAB_SELTYPE_NEW)\ncompTab.UpdateSelection\nav.ShowStopButton \nav.ShowMsg(\"Checking for Overlapping Polygons\")\n\n progress = (i/theCount) * 100 \n doMore = av.SetStatus( progress ) \n if (not doMore) then\n MsgBox.Warning(\"Operation Cancelled.\",\"Overlapping Polygon Check\") \n return nil \n end \n\n for each y in compTab.GetSelection\n compShape = compTab.ReturnValue(cshpFld,y)\n if (theShape <> compShape) then\n if (compShape.Intersects(theShape)) then\n shpDiff = compShape.ReturnIntersection(theShape)\n\n if (shpDiff.IsNull.Not) then\n count = 1\n for each shpdiffx in theList\n testx = shpdiffx.ReturnDifference(shpDiff)\n if (testx.IsNull) then\n co unt = count + 1\n end\n end\n if (count = 1) then\n theList.Add(shpDiff)\n end\n end\n end\n end\n \n end\n \nend \ncompTab = nil\n \n\ntheList.RemoveDuplicates\nav.PurgeObjects\n\nIf (theList.count > 0) then\n'MsgBox.Warning(\"Dataset has Overlapping Polygons\",\"FSA CLU Digitizing Tool\")\nav.Run(\"Open ErrorCheck\",{theList,theTheme,\"Overlap\"})\nelse\nMsgBox.Info(\"No Overlaps Found\",\"Overlapping Polygon Error Check\" )\nend\nav.ClearMsg" ) (Script.82 Name: "FSA Show Sliver Polygons" SourceCode: " 'program: FSA Show Sliver Polygons\n 'programmer: Jim Heald, FSA\n 'date: 4/22/99\n '\n 'purpose: highlights polygons which have an area less than .9 acres.\n '\n \n theView = av.GetActiveDoc\n theTheme = theView.GetActiveThemes.Get(0)\n 'ADDED BY JIM HEALD, FSA TO GENERALIZE THE CALCULATION DEPENDING ON WHAT THE\n'VIEW UNITS ARE SET TO\n\nacrefac = 0\nif (theView.GetUnits = #UNITS_LINEAR_CENTIMETERS) then\nacrefac = 0.00000002471\nelseif (theView.GetUnits = #UNITS_LINEAR_FEET) then\nacrefac = 0.000022956\nelseif (theView. GetUnits = #UNITS_LINEAR_INCHES) then\nacrefac = 0.000000159\nelseif (theView.GetUnits = #UNITS_LINEAR_KILOMETERS) then\nacrefac = 247.1054\nelseif (theView.GetUnits = #UNITS_LINEAR_METERS) then\nacrefac = 0.0002471\nelseif (theView.GetUnits = #UNITS_LINEAR_MILES) then\nacrefac = 640\nelseif (theView.GetUnits = #UNITS_LINEAR_MILLIMETERS) then\nacrefac = 0.0000000002471\nelseif (theView.GetUnits = #UNITS_LINEAR_NAUTICALMILES) then\nacrefac = 483.276612\nelseif (theView.GetUnits = #UNITS_LINEAR_UNKNOWN) then\nacrefac = 0. 0002471\n'ASSUME THAT UNKNOWN UNITS ARE METERS FOR THESE APPLICATIONS\nelseif (theView.GetUnits = #UNITS_LINEAR_YARDS) then\nacrefac = 0.0002066\nend\n\ntheThreshold = MsgBox.Input(\"Enter Threshold Size (default is 0.02 acres)\",\" FSA CLU Digitizing Tool\", \"0.02\") \n \n\n anFTab = theTheme.GetFTab\n shpFld = anFTab.FindField(\"Shape\")\n theList = List.Make\n\ntheBitmap = anFTab.GetSelection\ntheBitmap.ClearAll\ntheGraphics = theView.GetGraphics\n\n for each x in anFTab\n theShape = anFTab.ReturnValue (shpFld,x)\n\n theAr ea = theShape.ReturnArea \n theAcres = theArea * acrefac\n if (theAcres < theThreshold.AsNumber ) then \n' theBitmap.Set(x)\n' theGShape = GraphicShape.make(theShape)\n' bgcolor = Color.GetBlue\n' bgcolor.SetTransparent(TRUE)\n' aVFill = VectorFill.Make\n' aVFill.SetStyle(#VECTORFILL_STYLE_DOT)\n' aVFill.SetColor(Color.GetRed)\n' aVFill.SetBgColor(bgcolor)\n' aVFill.SetOLColor(Color.Get Black)\n' theGShape.SetSymbol(aVFill)\n' theGraphics.Add(theGShape)\n theList.Add(theShape)\n end\n\n end\n\n\n\n ' query and apply selection \n \n anFTab.UpdateSelection\n 'theView.Invalidate\n\nif (theList.Count > 0) then\nav.Run(\"Open ErrorCheck\",{theList,theTheme,\"Sliver\"})\nelse\nMsgBox.Info(\"No Errors Found\",\"Sliver Polygon Error Checking\")\nend\n\n" ) (Script.83 Name: "FSA Show Void Polygons" SourceCode: " 'program: FSA Show Hole Polygons\n 'programmer: Jim Heald, FSA\n 'date: 4/22/99\n '\n 'purpose: highlights polygons which have been combined but are not adjacent.\n '\n \n theView = av.GetActiveDoc\n theTheme = theView.GetActiveThemes.Get(0)\n \n' theFname = LineFile.Make(\"test.dat\".AsfileName,#FILE_PERM_WRITE)\n\n \n thePoly = Polygon.MakeNull\n anFTab = theTheme.GetFTab\n shpFld = anFTab.FindField(\"Shape\")\n\n theList = List.Make\ntheBitmap = anFTab.GetSelection\n theBitmap.ClearAll\ntheGraphics = theView.GetGraphics\nE rrCount = 1\n for each x in anFTab\n thePoly = anFTab.ReturnValue(shpFld,x)\n\n thePolys = thePoly.AsPolyline\n PCount = thePolys.CountParts\n PCount = PCount - 1\n \n theMpoint = thePolys.AsMultipoint.AsList\n PList = theMpoint.AsList\n newlist = List.Make\n For each x in PList\n theY = x.GetY\n theY.SetFormat(\"d.dddddddddddd\")\n theX = x.GetX\n theX.SetFormat(\"d.dddddddddddd\")\n newlist.Add(theX.AsString ++ theY.AsString)\n' theFname.WriteELT(theX.AsString ++ theY.AsString)\n end\n noDup s = newlist.Clone\n noDups.RemoveDuplicates\n \n ' theFname.WriteELT(\"++++++++++++++++++++++++++++\")\n' for each x in noDups\n' theFname.WriteELT(x)\n' end\n' theFname.Close\n \n\n'MsgBox.ListAsString(newList,newList.Count.AsString,\"All Points\")\n'MsgBox.ListAsString(NoDups,Nodups.Count.AsString,\"NoDups\")\n'MsgBox.Info(PCount.AsString,\"Polygon Parts\")\n\n if ((newList.count - PCount) >= (NoDups.Count + 2 )) then \n 'theBitmap.Set(x)\n' theGShape = GraphicShape.make(thePoly)\n' bgcolor = Color.GetBlue\n' bgcolor.SetTransparent(TRUE)\n' aVFill = VectorFill.Make\n' aVFill.SetStyle(#VECTORFILL_STYLE_DOT)\n' aVFill.SetColor(Color.GetRed)\n' aVFill.SetBgColor(bgcolor)\n' aVFill.SetOLColor(Color.GetBlack)\n' theGShape.SetSymbol(aVFill)\n'\n'\n' theGraphics.Add(theGShape)\n if (thePoly.Explode.Count = 1) then\n theList.Add(thePoly)\n end\n\n ErrCount = ErrCount + 1\n end\n\n end\n\n\n\n ' query and apply selection \n \n anFTab.UpdateSelection\n 'theView.Invalidate\n\n\nif (theList.Count > 0) then\nav.Run(\"Open ErrorCheck\",{theList,theTheme,\"Void\"})\nelse\nMsgBox.Info(\"No Errors Found\",\"Void Polygon Error Check\")\nend\n\n\n\n" ) (Script.84 Name: "FSA Clean Polygons" SourceCode: "theView = av.GetActiveDoc\ntheTheme = theView.GetActiveThemes.Get(0)\ntheFTab = theTheme.GetFTab\ntheCount = theFTab.GetNumRecords\n\nShapeFld = theFTab.FindField(\"Shape\")\ni = 0\n\nfor each rec in theFTab\n av.ShowStopButton\n av.ShowMsg(\"Cleaning Polygons\")\n \ni = i + 1 \n progress = (i/theCount) * 100 \n doMore = av.SetStatus( progress ) \n if (not doMore) then \n break \n end\n\ntheShape = theFTab.ReturnValue(ShapeFld,rec)\n\ntheShape.clean\nif (theFtab.StartEditingWithRecovery) then\ntheFTab.SetVal ue(ShapeFld,rec,theShape)\nend\n\nend\n\ntheFTab.StopEditingWithRecovery(true)\nav.ClearMsg" ) (Script.85 Name: "FSA Random Selection" SourceCode: "'FSA Random Selection\n' Programmer: Jim Heald\n' Date: 8/3/99\n'\n' Purpose: This program selects a random sample of \n' polygons from a coverage to approximate a 90 percent\n' confidence level sample for checking. Call Rodney Johnson\n' at (801)975-3500 for the origin of this algorithm.\n\ntheView = av.GetActiveDoc\ntheTheme = theView.GetActiveThemes.Get(0)\ntheFTab = theTheme.GetFTab\n\ntheCount = theFTab.GetNumRecords\n\ntheSampleSize = theCount/ (((theCount - 1) * 0.000652) + 1)\n\ntheSampleSize = theSampleSize.Ceilin g\n\ntheList = list.make\n\nfor each i in 0..theCount\ntheRand = Number.MakeRandom(0,(theCount - 1))\n\ntheList.Add(theRand)\n\ntheList.RemoveDuplicates\n\n av.ShowStopButton \n av.ShowMsg(\"Selecting Polygons for Random Check\")\n \n progress = (theList.Count/theSampleSize) * 100 \n doMore = av.SetStatus( progress ) \n if (not doMore) then \n break \n end\n\n\nif (theList.Count = theSampleSize) then\nbreak\nend\n\nend\nav.SetStatus(100)\n\n'MsgBox.Info(theSampleSize.asString,theList.Count.AsString)\ntheBitmap = theFTab.GetSelection\ntheBitmap.Clearall\n\nfor each x in theList\ntheBitmap.Set(x)\nend\ntheFTab.UpdateSelection\nav.ClearMsg\n\n" ) (Script.86 Name: "FSA Stack Autolabel" SourceCode: "' Name FSA.LableStacked.Tool\n' File zLableStackedTool.txt\n' Application Stacked Label Tool (zlabstak.avx)\n' Function Labels active theme with stacked labels where user clicks\n' Parameters \n' Returns NIL upon error\n' Called by\n' Calls to View.Return Color\n' Requires Active feature theme, \"Graphic.Label Defaults\" dialog\n' Variables\n' History (Symbology setting technique from ESRI's View.LabelTool script)\n' Altered 4-99, Donna Holderfield SAIC\n' Altered 8 -99, Jim Heald USDA to add Autolabeling\n' Version 3.1\n' Desc An Apply event script for a Tool control in a view DocGUI that\n' adds stacked labels to features. Stacked labels annotate features with more \n' than one field value. This script labels the first active theme in the View.\n' The stacked label fields and Alais are chosen from a Msgbox and are valid for as long \n' as the theme remains active. To label a theme, make it active, click on a \n' feature, and choose the fields to label it with fro m the Msgbox that opens. \n' Continue labeling other features with the same set of stacked label fields\n' by leaving the theme active and clicking on features with this tool. To label \n' the same active theme with a different set of stack label fields, hold down \n' the Shift Key while using this tool and choose a new set of fields from the \n' Msgbox that opens. Label a different theme by making it active and then use\n' this tool. Note, this script uses the Tool control's Tag property to store \n' the name of the theme and stack label fields. There is no need to set the Tag \n' property in advance or at any time during or after using this script.\n\n' Stacked Labels are symbolized with the same text symbol used for normal Labels\n' in ArcView. Modify this text symbol in the Graphics>Text and Label Defaults\n' dialog by clicking on the \"Tag Tool\" icon.\n\n' Apply: FSA.LabelStacked.Tool\n' Tag: zLabelStacked.ToolUpdate\n\n' Get Graphic Text default settings for Tag Tool (\"Ltool1\" object tag)\n \nCPC = av.FindDialog(\"Graphic.Label Defaults\")\nIconList = CPC.FindByName(\"CalloutIcons\")\nthePrefs = IconList.GetObjectTag.Get(\"Ltool1\")\n\n '(0) Font Family (String) \n '(1) Font Style (String)\n '(2) Font Size (Number)\n '(3) Font Color (String)\n '(10) UseDefFont (Boolean)\n\nCFont = thePrefs.Get(0)\nCStyle = thePrefs.Get(1)\nCSize = thePrefs.Get(2)\nUseDef = thePrefs.Get(10)\nif (thePrefs.Get(3) = \"Unnamed Color\") then\nav.GetSymbolwin.ReturnCurrentSymbol(#SYM BOL_TEXT).Clone\n end\n\n\n\n\n' Get parameter from SELF\n\nif (SELF.is(control)) then\n theParameter = SELF.GetTag.AsTokens(\",\")\nelse\n return NIL\nend\n\n' Exit if no active theme\n\ntheView = av.GetActiveDoc\nif ((theView.GetActiveThemes.Count) = 0) then\n return NIL\nend\ntheTheme = theView.GetActiveThemes.Get(0)\nif ((theTheme.IsVisible.Not) or (theTheme.CanLabel.Not)) then\n return NIL\nend\n \n' If the name of the active theme and the theme name stored\n' in the Control's tag property are the same and the Shift\n' K ey is not down, then set the flag to not open a MsgBox to \n' select label fields.\n\nselect = TRUE\n'if (theParameter.Count > 0 ) then\n' theThemeName = theParameter.Get(0)\n' if ((theTheme.GetName = theThemeName) and (System.IsShiftKeyDown.Not)) then\n' select = FALSE\n' end\n'end\n\nif (select) then\n\n ' Exit if no visible fields\n\n theFieldsVisible = List.Make\n for each f in theTheme.GetFtab.GetFields\n if ((f.IsVisible) and (f.IsTypeShape.Not)) then\n theFieldsVisible.Add(f)\n end\n end\n if (the FieldsVisible.IsEmpty) then\n theMsg = \"No visible fields\"\n msgbox.Error(theMsg,theTheme.GetName)\n av.ShowMsg(\"\")\n return NIL\n end\n\n ' Open Msgbox and select label fields\n\n theMsg = \"Select label fields\"\n theTitle = \"Label\"++theTheme.GetName\n theFields = Msgbox.MultiListAsString(theFieldsVisible,theMsg,theTitle)\n if (theFields = NIL) then\n SELF.SetTag(\"\")\n return NIL\n end \n\n ' Store theme and label field names as Control Tag property\n \n theParameter = theTheme.GetName\n for e ach f in theFields\n theParameter = theParameter+\",\"+f.GetAlias\n end\n \n SELF.SetTag(theParameter)\n\nelse \n\n ' Get label field names from Control Tag Property\n \n theFields = list.Make\n for each i in 1..(theParameter.Count - 1)\n if (theTheme.GetFtab.FindField(theParameter.Get(i)) <> NIL) then\n theFields.Add(theTheme.GetFtab.FindField(theParameter.Get(i)))\n end\n if (theFields.IsEmpty) then\n return NIL\n end\n end \n\nend\n\n' Get Shape Field\n\nfor each f in theTheme.GetFtab.GetFields\n if (f.isTypeShape) then\n theShapeField = f\n break\n end\nend\n\nif (theTheme.GetFtab.GetSelection.Count = 0) then\ntheTheme.GetFTab.GetSelection.SetAll\nend\n\n' Return list of record numbers where user clicks point, loop\n' to each record, return value strings for each label field, and\n' construct a string for the stacked label.\n\n'pt = theView.GetDisplay.ReturnUserPoint \n'theRecList = theTheme.FindByPoint(pt)\n'if (theRecList.IsEmpty.Not) then \n i = 0\n for each rec in theTheme.GetFTab.GetSelection\n rcoun t = 1\n theShape = theTheme.GetFTab.REturnValue(theShapeField,rec)\n pt = theShape.ReturnCenter\n theString = \"\"\n fcount = 1\n for each f in theFields\n if ((rcount = 1) and (fcount = 1)) then\n theSymSize = theTheme.ReturnSymbolSize(rec)\n theShape = theTheme.GetFtab.ReturnValue(theShapeField,rec)\n theString = f.GetAlias+ \": \" +theTheme.ReturnValueString(f.GetAlias,rec)\n elseif ((rcount > 1) and (fcount = 1)) then\n if (theTheme.ReturnValueString(f.GetAlias,rec).Coun t > 0) then\n theString = theString+NL+theTheme.ReturnValueString(f.GetAlias,rec)\n else\n theString = theString+NL+f.GetName\n end\n ' if((theTheme.ReturnValueString(f,rec)\n else\n if (theTheme.ReturnValueString(f.GetAlias,rec).Count > 0) then\n theString = theString+NL+f.GetAlias+\": \"+theTheme.ReturnValueString(f.GetAlias,rec)\n end\n end\n fcount = fcount + 1\n end\n rcount = rcount + 1\n ' Make graphic text. Symbolize the text w ith either the default text\n' symbol or the one set in the Graphics>Text and Label Defaults dialog \n' for the Tag Tool. Position it relative to the feature's shape using\n' the theme's text positioner.\n\nt = GraphicText.Make(theString, pt)\nt.SetSelected(TRUE)\nt.SetDisplay(theView.GetDisplay)\n'theSym = theTheme.GetLabelTextSym\n't.SetSymbol(theSym)\ntheTheme.SetFixedSizeText(FALSE)\nif (theTheme.GetFixedSizeText.Not) then\n theView.GetDisplay.HookupSymbol(t.GetSymbol)\nend\n'if (not UseDef) then\n ' t.GetSymbol.SetF ont(Font.make(\"Arial\",\"Bold\"))\n' t.GetSymbol.SetSize(14)\n ' t.GetSymbol.SetColor(Color.GetWhite)\n ' t.Invalidate\n'end\nthePrj = theView.GetProjection\nif (thePrj.IsNull.Not) then\n theShape = theShape.ReturnProjected(thePrj)\nend\ntp = theTheme.GetTextPositioner\ntp.Calculate(theShape,t.GetExtent,theSymSize,pt)\nt.SetOrigin(tp.GetOrigin)\nt.SetAngle(tp.GetAngle)\ntheView.GetGraphics.Add(t)\n\nav.ShowStopButton \ni = i + 1\nav.ShowMsg(\"Labeling Polygons....\")\nprogress = (i/theTheme.GetFTab.GetSelection.Count) * 100 \ndoMore = av.SetStatus( progress ) \nif (not doMore) then \nbreak \nend \n\n\n\n end\n'else\n' System.Beep\n' return NIL\n'end\ntheView.GetGraphics.UnselectAll\nav.ClearMsg\nav.ClearStatus\n'theTheme.GetFTab.GetSelection.ClearAll\n'theTheme.GetFTab.UpdateSelection\ntheView.Invalidate\n\nav.GetProject.SetModified(true)\n\n" ) (Script.87 Name: "My Extension Install" SourceCode: "'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.Get(4)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Dialogs\n'\nfor each adialog in theDialogs\n theProject.addDialog(adialog)\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 c ontrol\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 thec ontrolset=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\"+acontr ol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=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.88 Name: "My Extension Uninstall" SourceCode: "'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.get(4)\ntheProject=Av.getproject\n\n\n'Remove 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'Remove the Dialogs\n'\nfor each adialog in theDialogs\n the Project.RemoveDialog(adialog.AsString)\nend\n\n'Removethe Controls\n'\nfor each totalControl 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 sequence 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 b e 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) th en\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 pr oject.\",\"Script Eror\")\n return(nil)\n end\n \n 'This sequence finds 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" )