'PROJUTM returns the utm and lat/long coordinates of the 'selected POint. 'will only work on UTM Zone 10 Coverages 'alter thePrj object to use in differenent projections 'Attach script to apply button in View Tool Menu 'Jim.Szpara@Pacificorp.com theProj = av.Getproject theView = av.GetActiveDoc if (theView = nil) then theView = theProj.FindDoc("oregon") end 'Name of Test View 'theView.SetUnits(#UNITS_LINEAR_FEET) 'IF UNITS ARE FEET theView.SetUnits(#UNITS_LINEAR_METERS) theprj=transverseMercator.Make(theView.REturnExtent) 'Alter this to reflect Theme Projection 'theprj = theView.GetProjection.ReturnExtent) ' if view is Projected 'Set Projection Parameters if View is not projected 'theprj.SetSpheroid(#SPHEROID_GRS80) 'Alter here for NAD27 thePrj.SetSpheroid(#SPHEROID_CLARKE1866) theprj.SetCentralMeridian(-123.00)' FOR UTM ZONE 10 theprj.SetScale(0.9996) thePrj.SetFalseEasting(500000.00) ' if we have meters 'thePrj.SetFalseEasting(1640416.665) 'When Projected units are feet theprj.SetFalseNorthing(0.00) p = theView.GetDisplay.ReturnUserPoint utmN = p.GetY.SetFormat("dddddddd.ddd").abs utmE = p.getX.SetFormat("dddddddd.ddd").abs 'msgbox.info("The Easting is: = " +utmE.Asstring + nl+ "The Northing is " ++utmN.Asstring,"UTM ZONE 10") latlongpt = p.returnUnProjected(theprj) 'latlongpt = (p/(3.280833333@3.2808333333)).returnUnProjected(theprj) ' Activate for Feet long = latlongpt.getx.SetFormat("ddd.ddddddd").abs lat = latlongpt.gety.SetFormat("ddd.ddddddd").abs longdeg = long.Truncate latdeg = lat.truncate 'msgbox.info (" the latdeg = :" +longdeg.asString,"") longmin = ((long - longdeg) * 60).Abs latmin = (( lat-latdeg) * 60).Abs longsecT = longmin.truncate LatsecT = latmin.truncate longsec = ((longmin - longsecT) * 60).abs.truncate latsec = ((latmin - LatsecT) * 60).abs.Truncate 'msgbox.info("longitude in DMS is: " +longdeg.ABs.asstring ++longsecT.asString ++Longsec.asstring ++"W" ,"LONGITUDE") head = ("lat/long") msgbox.info("The Easting is: = " +utme.Asstring ++"E" + nl+ "The Northing is " ++utmn.Asstring ++"N" + nl + "Latitude is: = " +Latdeg.abs.Asstring ++LatsecT.asString ++latsec.asString ++"N" + nl+ "Longitude is:" +longdeg.ABs.asstring ++longsecT.asString ++Longsec.asstring ++"W","UTM LAT/LONG") 'msgbox.info("The Easting is: = " +utme.Asstring +"E" + nl+ "The Northing is " '++utmn.Asstring +"N" + nl + "The Latitude is: = " +Lat.Asstring ++"W" + nl+ '"The Longitude is " ++Long.Asstring ++"N","UTM LAT/LONG")