' ********************************************************** ' Bounding Rectangle.AVE ' Makes a bounding rectangle for the Theme that is twice the ' extent. ' ' Written by Tim Thomas on 12/10/01. ' ' Used ideas from the following: ' Find Gaps and Overlaps ' Author: David M. Theobald, davet@nrel.colostate.edu ' Date: August 1999 ' ************************************************************ theView = av.GetActiveDoc theActiveTheme = theView.GetActiveThemes.Get(0) theFTab = theActiveTheme.GetFTab ' ************************************************************ ' Make new shapefile ' ************************************************************ FTabFN = theFTab.GetSrcName.GetFileName baseString = FTabFN.GetBaseName extString = FTabFN.GetExtension newString = FTabFN.AsString.Substitute(baseString,"") new2String = baseString.Substitute(extString,"shp") newFTabFN = FileDialog.Put( (newString + "Rect " + new2String).AsFileName, "*.shp","Rectangle shapefile name") newFTab = FTab.MakeNew(newFTabFN,Polygon) newShapeField = newFTab.FindField("Shape") idField = Field.Make ("RectID", #FIELD_BYTE, 2, 0) newFTab.AddFields ( { idField } ) rec = newFTab.AddRecord theRect = theActiveTheme.ReturnExtent.Scale ( 2 ) newFTab.SetValue ( newShapeField, rec, theRect.AsPolygon ) newFTab.SetValue ( idField, rec, 1) newFTab.SetEditable ( FALSE ) newFTheme = FTheme.Make ( newFTab ) theView.AddTheme ( newFTheme )