'Look up "View (Class)" in ArcView 3.1 help 'Most of this from the SetSpheroid and Projection Class example. 'Although the CoordSys example is also useful. 'A rectangle for the entire world aRect = Rect.MakeXY(-180,-90,180,90) 'Create the projection object aPrj = Lambert.Make(aRect) aPrj.SetDescription("GRIB-Lambert") aPrj.SetCentralMeridian(-95.000000) aPrj.SetReferenceLatitude(25.000000) aPrj.SetLowerStandardParallel(25.000000) aPrj.SetUpperStandardParallel(25.000000) aPrj.SetFalseEasting(0) aPrj.SetFalseNorthing(0) aPrj.SetSpheroid(#SPHEROID_SPHERE) 'Get the name of the View to change. aViewName = msgBox.Input("Name of view to change projection for", "Which View", "View1") if (aViewName = nil) then exit end flag = MsgBox.YesNo ("To use the correct spheroid (of the earth) we have to create a coordinate system. Shall I?", "Spheroid Correction?", false) if (flag) then 'Get the Projection's Spheroid and modify it aSphere = aPrj.GetSpheroid aSphere.SetName("GRIB Sphere") aSphere.SetMajorAndMinorAxes(6371200.000000,6371200.000000) aSphere.SetUnits(#UNITS_LINEAR_METERS) 'Create a Coordinate System aPrjName = msgBox.Input("Enter a projection Category", "Projection Category?", "My Custom Projections") if (aPrjName = nil) then exit end aCoordSys = CoordSys.Make aCoordSys.SetName(aPrjName) thePrjs = aCoordSys.GetProjections thePrjs.Add(aPrj) aTypeName = msgBox.Input("Enter a projection type?", "Projection type", "GRIB") if (aTypeName = nil) then exit end aPrj.SetDescription(aTypeName) 'Add this sphere & projection to the default.prj file. if (file.exists("$HOME/default.prj".AsFilename).not) then defprj = ODB.Make("$HOME/default.prj".AsFilename) else flag = MsgBox.YesNo ("Overwrite the custom projection file?", "Overwrite?", false) if (flag) then defprj = ODB.Make("$HOME/default.prj".AsFilename) else defprj = ODB.Open("$HOME/default.prj".AsFilename) end end defprj.Add(aCoordSys) defprj.Commit end ' Apply the projection to the selected View aView = av.GetProject.FindDoc(aViewName) aView.SetProjection(aPrj)