I'm using Python and ArcPy to automate mapping and have a requirement to project on-the-fly to the appropriate MGA Zone (in Australia) and to report that zone in a text element.
It works well as long as I am happy to use this dynamic text string:
For example, this will display GDA 1994 MGA Zone 56 when my spatial reference has been set to C:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\National Grids\Australia\GDA 1994 MGA Zone 56.prj
<dyn type="dataFrame" name="Main Map" property="sr" srProperty="name"/>
However, my client has a requirement to just put out zone 56 instead of GDA 1994 MGA Zone 56 and so I have been trying to figure out how to have the Dynamic Text get hold of just the zone 56 part instead.
Two things that I have tried so far are:
- Set the name property on the SpatialReference object after creating it to be "zone 56"
- Rename the *.prj file to be called "zone 56.prj" before creating the SpatialReference from it
Neither appears to provide a solution.
I could resort to just creating a pseudo-dynamic text element, but before doing that, does anyone know another way to enable a dynamic text element to pull out just the zone number from a spatial reference like this?