AnsweredAssumed Answered

Data Driven pages related help

Question asked by Sycosys on Mar 16, 2012
Latest reply on Mar 19, 2012 by Sycosys
EDIT:  Title is a little misleading, there is no reason to use data driven pages.. I just need to select a zoom feature from within a Group layer.


I found a nice bit of python which filters through layers, turning them on, exporting and turning them off

what i have are Group layers with feature layers inside.

I would like the script to do almost the same operation except I need it to look into the features for the group, zoom to the one called flow, export, move on..

Is there a way i can go about having it look inside each group layer? that is my real trouble at this point, I have the ways to define the name I'm looking for, select the layer, zoom to the layer, etc. just havent found a way to say hey look in here.

I'm wondering if I can add a bit of script that says Is this a group layer? if yes, create list of the features inside, select the one called flow, zoom, deselect, then preform the data export as usual.

here is the relevant For loop in the example code.

sorry if this question is silly, I am in fact still very much learning

#Cycle through each layer for lyr in layerlist:                                                   #If the layer is NOT visible...  if lyr.visible == False:                                           #...Turn the layer on   lyr.visible = True                                             #Change the Subtitle text element to match the layer's name   subtitle.text =                                       #Create a string showing the path of the pdf that will be written out   pdfpath = "C://Users//xx//Desktop//DDP_TEMP//" + + r" mapbook.pdf"    #Print that we are exporting a mapbook   print "Exporting " + pdfpath + "....."                         #Export the mapbook to pdf   mxd.dataDrivenPages.exportToPDF(pdfpath,"ALL")                 #Turn the layer off again   lyr.visible = False