csmtcsmt

how to close "Current" Map Document?

Discussion created by csmtcsmt on Dec 2, 2010
Latest reply on Aug 29, 2013 by NPPD_IP
How can I close a map document via python?
I want to run a script which references the map document

mxd = arcpy.mapping.MapDocument("Current")
...
do_some_stuff()
....
mxd.saveACopy(r"C:\xx\yy\zz.mxd")
os.startfile(r"C:\xx\yy\zz.mxd")

and now i would like to close the "old" mxd???

The only thing I found to work is:
os._exit()

but this kind of kills ArcMap too brutal...
e.g. ArcSOCP.exe and ArcSOMP.exe won't close (for the next 10 min..)
is there anything like:
mxd.close()       ????
or a better closing method?

Sure, it is just one click to exit Arcmap. It is not extremely important, but nevertheless I would like to enforce closing the mapDocument in my script (in a proper way)...

Outcomes