Hi Glenn,
it is a little unclear about what you need to do here.
Are you trying to get a spatial reference that is not hard-coded in a script?
If so, you can get the spatial reference from your input data in the script and then carry it over to the other data you create.
This would look like:
sr = arcpy.Describe(infc).spatialReference # with infc being your input data
Kat
def initializeParameters(self): """Refine the properties of a tool's parameters. This method is called when the tool is opened.""" prjFile = os.path.join(arcpy.GetInstallInfo()["InstallDir"], "Coordinate Systems/Geographic Coordinate Systems/North America/NAD 1983.prj") spatialRef = arcpy.SpatialReference(prjFile) self.params[1].value = spatialRef.name # parameter 1 is a string, just to test self.params[2].value = spatialRef # parameter 2 is a SpatialReference return
I didn't need to go to the trouble of finding the path to a *.prj.
On the tool properties I entered "GDA 1994 MGA Zone 55" (without the double quotes) in as the Default which replaced it with the very long text equivalent. Then when I opened the tool the spatial reference showed up as GDA_1994_MGA_Zone_55.