Jump to content
Sign in to follow this  
Benomar

Problem with an Arcpy code

Recommended Posts

Hi everybody,

This is my first time to this forum and I have a little problem with arcpy code:

 

#Current map document

mxd = arcpy.mapping.MapDocument("CURRENT")

 

#Export 

x = raw_input("Insert the Name please ")

 

arcpy.mapping.ExportToJPEG(mxd,x+".jpg")

 

what is wrong with this code, I need your help Please.

 

Share this post


Link to post
Share on other sites

try with full path befor inputing the name of jpg, i should work

 

arcpy.mapping.ExportToJPEG(mxd,"C:\\"+x+".jpg")

Share this post


Link to post
Share on other sites

import arcpy
from arcpy import mapping as ma

path_original = arcpy.GetParameterAsText(0)
newtitle = arcpy.GetParameterAsText(1)
path_expotert = arcpy.GetParameterAsText(2)

mappa = ma.MapDocument(path_original)
ma.ExportToJPEG(mappa,path_expotert +'/' + newtitle + '.jpg')
 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.