python and ARCView GIS desktop

Andrew MacIntyre andymac at bullseye.apana.org.au
Fri Sep 9 19:52:00 EDT 2005


GISDude wrote:
> hi all. I am a newbie, so be kind.
> I am using ARCView GIS 9.1 and python win. I am trying to develop a
> module using the GZIP module in my ARCView map session. What I am
> attempting to do (I think) is use the zip mod to zip up all the files
> in a .mxd document into one neat little zipped file, ready to copy to
> cd or email(if it's small enough(.
> 
> I got this idea while using autocad. There is a function in autocad
> (E-TRANSMIT) that allows you to press the button on the toolbar and it
> will zip up all files(and dependent files too) in the current drawing
> and have it in one zip file ready for email.

I think that ESRI intended that the Map Publisher (extra cost; outputs 
.pmf files as I recall) be used for this purpose.  This is at least 
partly because map documents can contain all sorts of layers that don't 
exist as readily accessible files on your local machine.

> I was wondering if anyone had any ideas. Maybe I could use VBA or
> something else?

If you are only using shapefiles, what you are after should be doable, 
and using VBA is probably the least painful way to do it.  One trap that 
comes to mind is that dataset filenames are stored in .mxds in absolute 
form by default - you will need to change the setting in the normal.mxt 
which enables relative paths. There are examples of creating commands in 
the ArcObjects developers kit (I can't remember whether this is 
installed by default).  You also might be able to use the InfoZip DLL 
directly from VBA to package everything (after you've figured out what 
needs to be packaged).

-------------------------------------------------------------------------
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen ACT 2616
Web:    http://www.andymac.org/               |        Australia



More information about the Python-list mailing list