Data Driven Process

B

balparmak

I need to come up with a Python code to automate a map creation process butI am a little bit of lack of python knowledge. Any help would be much appreciated.
My problem is that I have a 20 mxd file which need an update process in timely manner(this is just one project) and pdf creation for each mxd then appended pdfs. At the moment, I have a tool which creates map index shape filefor at the layout view for each mxd.

I want to :
1 Loop through the index shape file's attribute (first one in the table of contents)
2 Select or zoom into first row then
-get mxd name from attribute table(its available in attribute table)
-specify the destinatin folder to save the mxd(i think that I can get that in attribute table as well) or specify it in the code.
-save mxd to specified location
-specify the destinatin folder to save the pdf file
-save pdf to specified location
3 Move to next row and do the same process in step 2
4 When reached the last row append all pdf files created into same locaition as pdfs
5 Close

Please help me!

Any Help would be much appreciated.

Thank you
 
G

Grant Rettke

If you set up 2 sample MDX files that are dead simple along with some
code to demonstrate what you are attempting, and some unit tests, then
you will be helping people to help you.

Most people probably do not have experience or familiarity with what
you are attemping.
 
B

balparmak

Thank you for your reply Grant,

I am trying to attach mxd's but no chance. As you said that i dont have much experience in python. I used to work with VBA but its not an option anymore with new ArcGIS 10.

How can I add mxd's here?
 
B

balparmak

Hi Grant

can you help me with this?

I am working with the python code below in ArcGIS to zoom into a shapefile's attribute table row features without selected until the end of table one by one.

I am trying to use this code but this one requires that a row is selected.

import arcpy

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

df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]

df.zoomToSelectedFeatures()

arcpy.RefreshActiveView()

Any Help?

Thanks
 
B

balparmak

Hi Grant

can you help me with this?

I am working with the python code below in ArcGIS to zoom into a shapefile's attribute table row features without selected until the end of table one by one.

I am trying to use this code but this one requires that a row is selected.

import arcpy

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

df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]

df.zoomToSelectedFeatures()

arcpy.RefreshActiveView()

Any Help?

Thanks
 
J

Jeffrey Ciesla

I'm just learning Python, so I doubt I could be much help, but I'd like to see how this progresses, maybe learn a little more about the language.
 
S

Steven D'Aprano

Thank you for your reply Grant,

I am trying to attach mxd's but no chance. As you said that i dont have
much experience in python. I used to work with VBA but its not an option
anymore with new ArcGIS 10.

How can I add mxd's here?

The same way you would attach any other file.

What program are you using to send these posts? Are you using email or
Usenet? Posting from a web interface or a smart phone or a desktop
application? We are not mind-readers, nor are we watching you, so how can
we tell you what button to click or command to give?
 
S

Steven D'Aprano

I am working with the python code below in ArcGIS to zoom into a
shapefile's attribute table row features without selected until the end
of table one by one.

I am trying to use this code but this one requires that a row is
selected.

Then select a row.

When you get an error message that tells you what is required, don't
argue with it, fix the problem that it tells you. If arcpy requires you
to select a row to work with, then you have to select a row to work with.

import arcpy
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
df.zoomToSelectedFeatures()

How do you expect to zoom to selected features if you have no selected
features? Before this line, you need to select the feature you want to
zoom to.
 
B

balparmak

I thought that with python you can specify first layer's attribute table in the table of contents and then go through the records in arcgis.
 
D

Dave Angel

Thank you for your reply Grant,

I am trying to attach mxd's but no chance. As you said that i dont have much experience in python. I used to work with VBA but its not an option anymore with new ArcGIS 10.

How can I add mxd's here?

MXD doesn't seem to be a text format. So don't try to attach it to a
text mailing list. Instead put it on a web site, and put a link to it
in your message. You also should attempt to make the sample file(s)
small, so people don't have to download something large.

Having said that, I personally won't be able to help, as I know nothing
about ArcGis.
 
B

balparmak

what I am thinking is that I can specify the first layer(mapindex shapefile) in the table of contents (using ArcGIS 10) and then specify the row of that attribute table(mapindex's). Create loop to go through the attribute table's record until the end of it.

Thanks again,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top