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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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