Sub FA Set objRS = Map.Selectionlayer.Records objRS.Bookmark = ThisEvent.Bookmark 'define coordinate systems Set pLLCS = Application.CreateAppObject( "CoordSys" ) Set pMCS = Application.CreateAppObject( "CoordSys" ) 'Set up Coordinate Systems \\\\\-----This is where the problem is-----/////////// pMCS.Import("\\My Documents\gis\Coordinate System\NAD 1983 UTM Zone 15N.prj") pLLCS.Import("\\My Documents\gis\Coordinate System\North American Datum 1983.prj") 'Create Map Points and assign coordinate systems Set pMapPt = Application.CreateAppObject("Point") Set pLLPt = Application.CreateAppObject("Point") Set pMapPt.CoordinateSystem = pMCS Set pLLPt.CoordinateSystem = pLLCS 'Set x/y values for original point pMapPt.X = objRS.Fields.Shape.X pMapPt.Y = objRS.Fields.Shape.Y 'transpose the coordinate to lat long Set pLLPt = pLLCS.Project(pMapPt) For Each f in objRS.Fields Select Case Ucase(f.name) CASE "LATSTRING" f.Value = DMS(pLLpt.Y, "y") CASE "LONSTRING" f.Value = DMS(pLLpt.X, "x") End Select Next objRS.Update Set pMapPt = Nothing Set pLLPt = Nothing Set pMCS = Nothing Set pLLCS = Nothing Set objLyr = Nothing Set objRS = Nothing End Sub Function DMS(v, xy) absV = abs(v) degInt = Floor(absV) min = multDenom(absV, degInt) if xy = "x" then degInt = degInt * -1 end if minInt = Floor(min) sec = round(multDenom(min, minInt),4) DMS = degInt & " " & minInt & " " & sec End Function Function Floor(d) dTmp = Round(d) if dTmp > d then dTmp = dTmp - 1 End if Floor = dTmp End Function Function multDenom(d, dInt) d = d - dInt multDenom = d*60 End Function
'Set up Coordinate Systems pMCS.Import("C:\Program Files (x86)\ArcGIS\ArcPad10.0\Coordinate System\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 15N.prj") pLLCS.Import("C:\Program Files (x86)\ArcGIS\ArcPad10.0\Coordinate System\Geographic Coordinate Systems\North America\North American Datum 1983.prj")
Solved! Go to Solution.
"\\My Documents"to
"\My Documents"
Hi Jason,
I tend to write my scripts using Preferences.Properties("AppletsPath") so it doesn't matter if the script is on Mobile or PC.
Hope this helps.
Cheers,
Gareth
Hi Gareth, I would assume that the above is only true when you keep to having only one path defined in your applets tag in the config file and not as below
<PATHS public="C:\Users\Public\Documents\ArcPad" data="C:\Temp\Data" applets="C:\Temp\Applets1;C:\Temp\Applets2" styles="" extensions="" templates=""/>
Rolf