Dear sir,
Xander Bakker Dan_Patterson
hope you are fine. I require your little favor. Please don't mind, I'm fairly new to development. Can you please rectify my code. I just tell you the detail about.
I am working on MapBook via DDP. I have to select points which are within the boundary layer of current page and then want to display the table in maps. I am done with other work just facing problem with selection.
I have a layer named "IndexLayer" which contains the boundaries of cities under the attribute "Division". There is another layer which contains points, that is named "tlsf". I want to select the points which are within the opened page boundary but as per my script, all the points are selected and displayed in the table. I am posting python code here. Please don't mind. Is it possible if I can get your email address? The code is given by:
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os<SPAN class="punctuation token">,</SPAN> sys
relpath <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>dirname<SPAN class="punctuation token">(</SPAN>sys<SPAN class="punctuation token">.</SPAN>argv<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
division <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Reference MXD and layers</SPAN>
mxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN>relpath <SPAN class="operator token">+</SPAN> r<SPAN class="string token">"\map.mxd"</SPAN><SPAN class="punctuation token">)</SPAN>
transferStation <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayers<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"tlsf"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token">#Reference page layout elements</SPAN>
<SPAN class="keyword token">for</SPAN> elm <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayoutElements<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar1"</SPAN><SPAN class="punctuation token">:</SPAN> bar1 <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar2"</SPAN><SPAN class="punctuation token">:</SPAN> bar2 <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar3"</SPAN><SPAN class="punctuation token">:</SPAN> bar3 <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar1txt"</SPAN><SPAN class="punctuation token">:</SPAN> bar1txt <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar2txt"</SPAN><SPAN class="punctuation token">:</SPAN> bar2txt <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"bar3txt"</SPAN><SPAN class="punctuation token">:</SPAN> bar3txt <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"NoGrowth"</SPAN><SPAN class="punctuation token">:</SPAN> noGrowth <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"horzLine"</SPAN><SPAN class="punctuation token">:</SPAN> horzLine <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"vertLine"</SPAN><SPAN class="punctuation token">:</SPAN> vertLine <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"cellTxt"</SPAN><SPAN class="punctuation token">:</SPAN> cellTxt <SPAN class="operator token">=</SPAN> elm
<SPAN class="keyword token">if</SPAN> elm<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">==</SPAN> <SPAN class="string token">"headerTxt"</SPAN><SPAN class="punctuation token">:</SPAN> headerTxt <SPAN class="operator token">=</SPAN> elm
<SPAN class="comment token">#Clean-up before next page</SPAN>
<SPAN class="keyword token">for</SPAN> elm <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayoutElements<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"GRAPHIC_ELEMENT"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"*clone*"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
elm<SPAN class="punctuation token">.</SPAN>delete<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> elm <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayoutElements<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"TEXT_ELEMENT"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"*clone*"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
elm<SPAN class="punctuation token">.</SPAN>delete<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
noGrowth<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">3</SPAN>
cellTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">3</SPAN>
headerTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">3</SPAN>
horzLine<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">3</SPAN>
vertLine<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">3</SPAN>
<SPAN class="comment token">#Reference DDP object and set appropriate page</SPAN>
ddp <SPAN class="operator token">=</SPAN> mxd<SPAN class="punctuation token">.</SPAN>dataDrivenPages
ddp<SPAN class="punctuation token">.</SPAN>currentPageID <SPAN class="operator token">=</SPAN> ddp<SPAN class="punctuation token">.</SPAN>getPageIDFromName<SPAN class="punctuation token">(</SPAN>division<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Graphic table variable values</SPAN>
tableHeight <SPAN class="operator token">=</SPAN> <SPAN class="number token">3.0</SPAN>
tableWidth <SPAN class="operator token">=</SPAN> <SPAN class="number token">4.5</SPAN>
headerHeight <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.2</SPAN>
rowHeight <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.15</SPAN>
upperX <SPAN class="operator token">=</SPAN> <SPAN class="number token">11</SPAN>
upperY <SPAN class="operator token">=</SPAN> <SPAN class="number token">3.2</SPAN>
<SPAN class="comment token">#Build selection set</SPAN>
divisionName <SPAN class="operator token">=</SPAN> ddp<SPAN class="punctuation token">.</SPAN>pageRow<SPAN class="punctuation token">.</SPAN>Division
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Processing: "</SPAN> <SPAN class="operator token">+</SPAN> division<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"IndexLayer"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Division"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
exp <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Division = divisionName'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>SelectLayerByAttribute_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"IndexLayer"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NEW_SELECTION"</SPAN><SPAN class="punctuation token">,</SPAN> exp<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># selection</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>SelectLayerByLocation_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"transferStation"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"INTERSECT"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"NEW_SELECTION"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"IndexLayer4"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Select_analysis<SPAN class="punctuation token">(</SPAN>transferStation<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"in_memory\IndexLayer4"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">)</SPAN>
numRecords <SPAN class="operator token">=</SPAN> int<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>GetCount_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"in_memory\IndexLayer4"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>getOutput<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Sort selection</SPAN>
<SPAN class="comment token">#Show selected features</SPAN>
<SPAN class="comment token">#Add note if there are no counties > 100%</SPAN>
<SPAN class="keyword token">if</SPAN> numRecords <SPAN class="operator token">==</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
noGrowth<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> <SPAN class="number token">3</SPAN>
noGrowth<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> <SPAN class="number token">2</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token">#if number of rows exceeds page space, resize row height</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>tableHeight <SPAN class="operator token">-</SPAN> headerHeight<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">/</SPAN> numRecords<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token"><</SPAN> rowHeight<SPAN class="punctuation token">:</SPAN>
headerHeight <SPAN class="operator token">=</SPAN> headerHeight <SPAN class="operator token">*</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>tableHeight <SPAN class="operator token">-</SPAN> headerHeight<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">/</SPAN> numRecords<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">/</SPAN> rowHeight
rowHeight <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>tableHeight <SPAN class="operator token">-</SPAN> headerHeight<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">/</SPAN> numRecords
<SPAN class="comment token">#Set and clone vertical line work</SPAN>
vertLine<SPAN class="punctuation token">.</SPAN>elementHeight <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>headerHeight<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="punctuation token">(</SPAN>rowHeight <SPAN class="operator token">*</SPAN> numRecords<SPAN class="punctuation token">)</SPAN>
vertLine<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX
vertLine<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> upperY
temp_vert <SPAN class="operator token">=</SPAN> vertLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
temp_vert<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">1.5</SPAN>
temp_vert <SPAN class="operator token">=</SPAN> vertLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
temp_vert<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">2.5</SPAN>
temp_vert <SPAN class="operator token">=</SPAN> vertLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
temp_vert<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">3.5</SPAN>
temp_vert <SPAN class="operator token">=</SPAN> vertLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
temp_vert<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">4.5</SPAN>
<SPAN class="comment token">#Set and clone horizontal line work</SPAN>
horzLine<SPAN class="punctuation token">.</SPAN>elementWidth <SPAN class="operator token">=</SPAN> tableWidth
horzLine<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX
horzLine<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> upperY
horzLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
horzLine<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> upperY <SPAN class="operator token">-</SPAN> headerHeight
<SPAN class="keyword token">print</SPAN> numRecords
y<SPAN class="operator token">=</SPAN>upperY <SPAN class="operator token">-</SPAN> headerHeight
<SPAN class="keyword token">for</SPAN> horz <SPAN class="keyword token">in</SPAN> range<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> numRecords<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
y <SPAN class="operator token">=</SPAN> y <SPAN class="operator token">-</SPAN> rowHeight
temp_horz <SPAN class="operator token">=</SPAN> horzLine<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
temp_horz<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> y
<SPAN class="comment token">#Set header text elements</SPAN>
headerTxt<SPAN class="punctuation token">.</SPAN>fontSize <SPAN class="operator token">=</SPAN> headerHeight <SPAN class="operator token">/</SPAN> <SPAN class="number token">0.0155</SPAN>
headerTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Name"</SPAN>
headerTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">0.75</SPAN>
headerTxt<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> upperY <SPAN class="operator token">-</SPAN> <SPAN class="punctuation token">(</SPAN>headerHeight <SPAN class="operator token">/</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
newFieldTxt <SPAN class="operator token">=</SPAN> headerTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Type"</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">2</SPAN>
newFieldTxt <SPAN class="operator token">=</SPAN> headerTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Longitude"</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">2.75</SPAN>
newFieldTxt <SPAN class="operator token">=</SPAN> headerTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Latitude"</SPAN>
newFieldTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">3.25</SPAN>
<SPAN class="comment token">#Set and clone cell text elements</SPAN>
cellTxt<SPAN class="punctuation token">.</SPAN>fontSize <SPAN class="operator token">=</SPAN> rowHeight <SPAN class="operator token">/</SPAN> <SPAN class="number token">0.0155</SPAN>
y <SPAN class="operator token">=</SPAN> upperY <SPAN class="operator token">-</SPAN> headerHeight
rows <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"in_memory\IndexLayer4"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> rows<SPAN class="punctuation token">:</SPAN>
x <SPAN class="operator token">=</SPAN> upperX <SPAN class="operator token">+</SPAN> <SPAN class="number token">0.05</SPAN>
col1CellTxt <SPAN class="operator token">=</SPAN> cellTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
col1CellTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">.</SPAN>getValue<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">)</SPAN>
col1CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> x
col1CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> y
col2CellTxt <SPAN class="operator token">=</SPAN> cellTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
col2CellTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">.</SPAN>getValue<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Type"</SPAN><SPAN class="punctuation token">)</SPAN>
col2CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> x <SPAN class="operator token">+</SPAN> <SPAN class="number token">1.75</SPAN>
col2CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> y
col3CellTxt <SPAN class="operator token">=</SPAN> cellTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
col3CellTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> str<SPAN class="punctuation token">(</SPAN>round<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">.</SPAN>getValue<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Longitude"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
col3CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> x <SPAN class="operator token">+</SPAN> <SPAN class="number token">3</SPAN>
col3CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> y
col4CellTxt <SPAN class="operator token">=</SPAN> cellTxt<SPAN class="punctuation token">.</SPAN>clone<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"_clone"</SPAN><SPAN class="punctuation token">)</SPAN>
col4CellTxt<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> str<SPAN class="punctuation token">(</SPAN>round<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">.</SPAN>getValue<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Longitude"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
col4CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionX <SPAN class="operator token">=</SPAN> x <SPAN class="operator token">+</SPAN><SPAN class="number token">4.75</SPAN>
col4CellTxt<SPAN class="punctuation token">.</SPAN>elementPositionY <SPAN class="operator token">=</SPAN> y
y <SPAN class="operator token">=</SPAN> y <SPAN class="operator token">-</SPAN> rowHeight
arcpy<SPAN class="punctuation token">.</SPAN>Delete_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"in_memory\IndexLayer4"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Delete_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"in_memory\IndexLayer4"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ExportToPDF<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">,</SPAN> relpath <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\\"</SPAN> <SPAN class="operator token">+</SPAN> division <SPAN class="operator token">+</SPAN> <SPAN class="string token">".pdf"</SPAN><SPAN class="punctuation token">)</SPAN>
os<SPAN class="punctuation token">.</SPAN>startfile<SPAN class="punctuation token">(</SPAN>relpath <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\\"</SPAN> <SPAN class="operator token">+</SPAN> division <SPAN class="operator token">+</SPAN> <SPAN class="string token">".pdf"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>