'CONSTRUCTS AND POPULATES FIELDS OF A POINT SHAPEFILE TO STORE VALUES EXTRACTED FROM A LOADED THEME IN A 3X3 NEIGHBOURHOOD 'LOADING SCRIPTS ' 1. Double-click on an empty area on the bar containing all buttons, The "Customize" dialog appears ' 2. In the "Type" pull-down, select "View" ' 3. In the "Category" pull-down, select "Buttons", The display right below the pull down changes to show an array of buttons ' 4. Slide the scrollbar (below the button display) to the right and select the last button by clicking on it, Now click on "New" ' 5. A new blank button appears. Double-click on the blank area to the right of the entry "Click" (just below the button display) ' 6. The "Script Manager" Dialog appears, Click on "New", Enter any name in the input box that appears (prefix it with "Z_" so that it goes in the last) ' 7. A new blank script document (With the name just specified) appears. Delete whatever is on it... ' 8. Either copy-paste this ENTIRE script on the document, or, click on the button with the open-folder icon (tooltip reads "Load text file") and navigate to this file ' 9. Either done, click on the button with the tick-mark icon ("compile"). If spatial analyst is not loaded, there will be some error message, Load it ' 10. After the script is compiled (the tick-mark buton should be grayed out), close the script window and return to the view ' 11. Click on the new button to run the script theView=Av.GetActiveDoc TheThemes=TheView.GetActiveThemes ThePrj=TheView.GetProjection PointTheme=TheThemes.Get(0) GridTheme=TheThemes.Get(1) GCSZ=100 PointFTab=PointTheme.GetFtab TheGrid=GridTheme.GetGrid PointFtab.SetEditable(TRUE) 'MakeFields F1=Field.Make("Cell1",#FIELD_DECIMAL,10,4) F2=Field.Make("Cell2",#FIELD_DECIMAL,10,4) F3=Field.Make("Cell3",#FIELD_DECIMAL,10,4) F4=Field.Make("Cell4",#FIELD_DECIMAL,10,4) F5=Field.Make("Cell5",#FIELD_DECIMAL,10,4) F6=Field.Make("Cell6",#FIELD_DECIMAL,10,4) F7=Field.Make("Cell7",#FIELD_DECIMAL,10,4) F8=Field.Make("Cell8",#FIELD_DECIMAL,10,4) F9=Field.Make("Cell9",#FIELD_DECIMAL,10,4) FieldList={F1,F2,F3,F4,F5,F6,F7,F8,F9} PointFtab.AddFields(FieldList) for each pnt in PointFtab ptshp=PointFtab.ReturnValue(PointFtab.FindField("Shape"),pnt) x=ptshp.getX y=ptshp.getY 'Create new Coordinates 'cell 1: x1=x-100 y1=y+100 point1=point.Make(x1,y1) 'cell 2: x2=x y2=y+100 point2=point.Make(x2,y2) 'cell 3: x3=x+100 y3=y+100 point3=point.Make(x3,y3) 'cell 4: x4=x-100 y4=y point4=point.Make(x4,y4) 'cell 5 x5=x y5=y point5=point.Make(x5,y5) 'cell 6: x6=x+100 y6=y point6=point.Make(x6,y6) 'cell 7: x7=x-100 y7=y-100 point7=point.Make(x7,y7) 'cell 8: x8=x y8=y-100 point8=point.Make(x8,y8) 'cell 9: x9=x+100 y9=y-100 point9=point.Make(x9,y9) PointList={Point1,Point2,Point3,Point4,Point5,Point6,Point7,Point8,Point9} ValueList=TheGrid.CellValueList (PointList, ThePrj) PointFtab.SetValue(F1,pnt,ValueList.Get(0)) PointFtab.SetValue(F2,pnt,ValueList.Get(1)) PointFtab.SetValue(F3,pnt,ValueList.Get(2)) PointFtab.SetValue(F4,pnt,ValueList.Get(3)) PointFtab.SetValue(F5,pnt,ValueList.Get(4)) PointFtab.SetValue(F6,pnt,ValueList.Get(5)) PointFtab.SetValue(F7,pnt,ValueList.Get(6)) PointFtab.SetValue(F8,pnt,ValueList.Get(7)) PointFtab.SetValue(F9,pnt,ValueList.Get(8)) end PointFtab.SetEditable(FALSE)