AnsweredAssumed Answered

How to pass mxd as argument

Question asked by froberts on Dec 22, 2012
Latest reply on Dec 22, 2012 by froberts
I have a simple script that is doing some parsing of the mxd that I pass it.  The script works just fine if I hard code the name of the mxd into the script, however I would like to pass the full path of the mxd to the script when I run it. This seems to be an issue since the examples I have seen all have the ???r??? in them prior to the path and mxd name.  For example(this works by the way):

mxd = arcpy.mapping.MapDocument(r"C:\Data\GISData\PythonCode\test.mxd")

I???ve tried a number of things but haven???t figured out how to get around this simple problem.  For Example:

mxdIn = sys.argv[0] mxd = arcpy.mapping.MapDocument(mxdIn)

Also tried:

mxdIn = sys.argv[0] mxd = arcpy.mapping.MapDocument(r (mxdIn))

Thanks for your help in advance!