+ Reply to Thread
Results 1 to 5 of 5

Thread: How to get just MGA Zone from Dynamic Text

  1. #1
    Graeme Browning
    Join Date
    Apr 2010
    Posts
    185
    Points
    31
    Answers Provided
    5


    0

    Default How to get just MGA Zone from Dynamic Text

    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:

    Code:
    <dyn type="dataFrame" name="Main Map" property="sr" srProperty="name"/>
    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

    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:
    1. Set the name property on the SpatialReference object after creating it to be "zone 56"
    2. 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?
    Last edited by graeme; 03-05-2012 at 02:18 PM.

  2. #2
    Jeffrey Barrette

    Join Date
    Oct 2009
    Posts
    711
    Points
    201
    Answers Provided
    64


    0

    Default Re: How to get just MGA Zone from Dynamic Text

    I don't think you can do this with Dynamic Text elements. You will need to add your own text element and update its value using arcpy.mapping.

    Jeff

  3. #3
    Graeme Browning
    Join Date
    Apr 2010
    Posts
    185
    Points
    31
    Answers Provided
    5


    0

    Default Re: How to get just MGA Zone from Dynamic Text

    Thanks Jeff

    I'll now do it that "pseudo dynamic text" way.

    I'll probably also float this as an ArcGIS Idea to see if it is just me that has been looking for it.

  4. #4
    Stephen Lead
    Join Date
    May 2010
    Posts
    772
    Points
    160
    Answers Provided
    31


    1
    This post is marked as the answer

    Default Re: How to get just MGA Zone from Dynamic Text

    Hi Graeme,

    Here is a hack-y version - update the label inside the PRJ file using a text editor.

    This seems to work, although it might not be advisable/supported.

    Cheers,
    Steve

    Click image for larger version

Name:	dynamic text2.png
Views:	42
Size:	20.2 KB
ID:	12501

  5. #5
    Graeme Browning
    Join Date
    Apr 2010
    Posts
    185
    Points
    31
    Answers Provided
    5


    0

    Default Re: How to get just MGA Zone from Dynamic Text

    Thanks Steve

    I think your workaround should work without any/many side effects as long as the *.prj file gets re-edited with each major upgrade to a new version. It's certainly simpler than what I do, so will be usable without having to dive into Python, VB, etc.

    - Graeme

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts