prjFile = prjPath + "/" + "NAD 1983 UTM Zone 10N.prj" sr = arcpy.SpatialReference(prjFile) <--- runtime error 999999 for DF in MAP.ListDataFrames(MXD): DF.spatialReference = sr
Hello,This is the path created by our Arc install:prjPath = "C:/Program Files(x86)/ArcGIS/Desktop10.0/Coordinate Systems/Projected Coordinate Systems/UTM/NAD 1983/"prjFile = prjPath + "NAD 1983 UTM Zone 10N.prj"sr = arcpy.SpatialReference(prjFile)The last statement causes a run-time error. I recreated that path as:"C:/My Program Files(x86)/ArcGIS/Desktop10.0/Coordinate Systems/Projected Coordinate Systems/UTM/NAD 1983/"and it works fine. The only difference I can think of is that the original "Program Files(x86)" folder is read-only where my "My Program Files(x86)" folder is read-write.Any ideas?Thanks,Scott
I'm getting a runtime error when trying this. prjFile = prjPath + "/" + "NAD 1983 UTM Zone 10N.prj" sr = arcpy.SpatialReference(prjFile) <--- runtime error 999999 for DF in MAP.ListDataFrames(MXD): DF.spatialReference = sr I'm just entering this one line at a time in the python command line window as follows: import arcpy prjPath = "C:/Program Files .../" prjFile = prjPath + "NAD 1983 UTM Zone 10N.prj" mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] sr = arcpy.SpatialReference(prjFile) Then get the runtime error. Am I missing something, or does this not work with "CURRENT", or by entering one line at a time? Thanks, Scott
sr = arcpy.SpatialReference(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 10N.prj")
mxd = arcpy.mapping.MapDocument("current") df = arcpy.mapping.ListDataFrames(mxd)[0] df.spatialReference = sr
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.