GIS Tips & Tricks

A weblog dedictated to the lifelong pursuit of cartographic bliss in GIS.

Wednesday, October 26, 2005

Add Date, Time & File Name Stamp to an ArcMAP Layout

I have never figured out why there is no INSERT DATE option in ArcMAP. Maybe it's just me but normally I put a DATE on my layouts. Isn't it a cartographic standard?

Fortunately there are a many ArcScripts out there that allow you to add a DATE STAMP to your layout and they usually include a FILE NAME option as well.

The organization I'm currently GISing for has admin rights really locked down so registration of .DLLs for Tool Controls is difficult. Luckily I was able to find a Date Stamp script at the ESRIs ArcScripts site that's creates a button control that allows you to add a text box for Date, Time, & File Name on your map. It's opensource code too which means it's easy to customize for your own enjoyment. Use this link to download the zip file to your PC and follow the instructions in the txt file.

Once installed you'll have a date stamp icon on one of your toolbars.

When added to your map the fully manipulable textbox will look something like this:

Wednesday, October 26, 2005 11:24:00 AM
C:\somedirectory\thenameofyourmap.mxd


Kudos to Jonathan Garner for creating this script.

5 Comments:

  • At 11:37 AM, Anonymous Anonymous said…

    Thanks for this link, much appreciated.

     
  • At 6:25 AM, Anonymous Anonymous said…

    Here's another easy way:

    Option Explicit

    Private WithEvents m_pActiveViewEvents As Map
    Private Function MxDocument_BeforeCloseDocument() As Boolean
    UnSetEvents
    End Function

    Private Function MxDocument_OpenDocument() As Boolean
    SetEvents
    End Function

    Public Sub SetEvents()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    Set m_pActiveViewEvents = pMxDoc.PageLayout
    End Sub

    Public Sub UnSetEvents()
    Set m_pActiveViewEvents = Nothing
    End Sub

    ' add time and by whom map printed
    ' date/time changes when layout refreshed -- you usually have to actually refresh it yourself to get the time to change correctly
    ' add a textbox that says something like pTextElement.Text below

    Private Sub m_pActiveViewEvents_ViewRefreshed(ByVal pView As IActiveView, _
    ByVal phase As esriViewDrawPhase, _
    ByVal data As Variant, _
    ByVal Envelope As IEnvelope)

    Dim pGC As IGraphicsContainer
    Set pGC = pView
    pGC.Reset
    Dim pElement As IElement
    Set pElement = pGC.Next
    Do While Not pElement Is Nothing
    If TypeOf pElement Is ITextElement Then
    Dim pTextElement As ITextElement
    Set pTextElement = pElement
    If Mid(pTextElement.Text, 1, 8) = "Printed:" Then ' look for the textelement to be refreshed
    pTextElement.Text = "Printed: " & Format(Time, "h:nn AM/PM") & " on " & Format(Date, "mm/dd/yyyy") & " by Chad Cooper" '& _
    'vbNewLine & put whatever else you want here on a new line - uncomment line continuer on above line at end too ...
    End If
    End If
    Set pElement = pGC.Next
    Loop

    End Sub

    Gives you this:

    Printed: 8:25 AM on 02/02/2006 by Chad Cooper

     
  • At 4:41 AM, Anonymous Anonymous said…

    Hello
    Thank you very much for the tip, it works very well
    Eric R.

     
  • At 7:16 AM, Blogger Joel said…

    Great Blog! I just started my own so I could post a comment. I've been GISing every single day for the past 2.5 years and I love every minute of it. I'm wondering if you know of a script or if any like what I'm about to describe exists. The majority of the maps that I create are for DEP Permit applications and I end up using 4-5 different layers to make 4-5 maps. I add all the layers to one map, set it up then save the map as the different MXDs and then change the title. Is there any kind of dynamic text box script that would display "Soils Map" when the soils layer is turned on and then "Geology Map" when the geology layer is turned on? That would really make my life easier. I could have one map with all my data and use it to print all 5 maps I need. I've played with the Map Book extension, didn't do what I needed, but it does have a dynamic text box that displays the page number so I know it can be done. I thought I had a way around it this morning. I was going to use a "Phantom" Legend as a text box and add a "Phantom" Layer that would use the Text I want shown eg. "Soils Map" as the layer title. The problem is we have our titles at a 90 degree angle on the right side of our maps and you can't rotate the Legend.... Sorry to go on and on, I'm the only one at my office that knows much about GIS so it'll be nice to have some intelligent correspondence.

    Thanks,
    Joel

     
  • At 4:46 AM, Blogger Muhammad said…

    I have better Option which work with ArcMap and ArcReader after publishing from ArcMap by khaliq60@yahoo.com

    STEPS
    1. Create new point theme and draw point at any location
    The table of point theme look like this [ OBJECTID,SHAPE (value 1,Point) ]
    2. Add new table to SQL Server with field [ OBJECTID1 and insert one row with OBJECTID1=1 ]
    3. Create view
    SELECT OBJECTID1, GETDATE() AS SystemDate FROM dbo.myDate_table (your table in Step 2)
    4. Insert new Data Frame in ArcMap
    5. Add point theme (from Step 1, and View from Step 3) to newely creadted Data Frame
    6. Join point theme with View OBJECTID=OBJECTID1
    7. Show label of point theme using SystemDate field
    8. Make color of point theme as NO COLOR and Label color to your choice
    9. Adjust font and placement of the label onto your layout

     

Post a Comment

<< Home