<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344591#M2224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;0-Dear sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hopeful that you will be fine. Please look at the problem I am pointing at:&lt;/P&gt;&lt;P&gt;I am working on mapbook and data driven is applied on a layer named "IndexLayer" against "Divsion" field. This layer contains the boundaries of Divisions (Division is an administrative distribution, which contains more than one city in my country). I have some point which are placed in a layer named, "tlsf". At the data driven pages, on the each division page, I want to select the point which lie into the corresponding boundary and then want them to display on the map. I have worked on the table. The problem I am getting is a the selection end. The received error is attached in the screen shot. I am also pasting the code here. I require your kindness. Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="The error I am receiving while executing." class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/358509_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = os.path.dirname(sys.argv[0])&lt;/P&gt;&lt;P&gt;division = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;#Reference MXD and layers&lt;BR /&gt;mxd = arcpy.mapping.MapDocument(relpath + r"\map.mxd")&lt;BR /&gt;transferStation = arcpy.mapping.ListLayers(mxd, "tlsf")[0]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Reference page layout elements&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd):&lt;BR /&gt; if elm.name == "bar1": bar1 = elm&lt;BR /&gt; if elm.name == "bar2": bar2 = elm&lt;BR /&gt; if elm.name == "bar3": bar3 = elm&lt;BR /&gt; if elm.name == "bar1txt": bar1txt = elm&lt;BR /&gt; if elm.name == "bar2txt": bar2txt = elm&lt;BR /&gt; if elm.name == "bar3txt": bar3txt = elm&lt;BR /&gt; if elm.name == "NoGrowth": noGrowth = elm&lt;BR /&gt; if elm.name == "horzLine": horzLine = elm&lt;BR /&gt; if elm.name == "vertLine": vertLine = elm&lt;BR /&gt; if elm.name == "cellTxt": cellTxt = elm&lt;BR /&gt; if elm.name == "headerTxt": headerTxt = elm&lt;BR /&gt;#Clean-up before next page&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt; &lt;BR /&gt;noGrowth.elementPositionX = -3&lt;BR /&gt;cellTxt.elementPositionX = -3&lt;BR /&gt;headerTxt.elementPositionX = -3&lt;BR /&gt;horzLine.elementPositionX = -3&lt;BR /&gt;vertLine.elementPositionX = -3&lt;/P&gt;&lt;P&gt;#Reference DDP object and set appropriate page&lt;BR /&gt;ddp = mxd.dataDrivenPages&lt;BR /&gt;ddp.currentPageID = ddp.getPageIDFromName(division)&lt;/P&gt;&lt;P&gt;#Graphic table variable values&lt;BR /&gt;tableHeight = 3.0&lt;BR /&gt;tableWidth = 2.5&lt;BR /&gt;headerHeight = 0.2&lt;BR /&gt;rowHeight = 0.15&lt;BR /&gt;upperX = 2.8&lt;BR /&gt;upperY = 3.2&lt;/P&gt;&lt;P&gt;#Build selection set&lt;BR /&gt;divisionName = ddp.pageRow.Division&lt;BR /&gt;arcpy.AddMessage("Processing: " + division)&lt;BR /&gt;with arcpy.da.SearchCursor("IndexLayer", ("Division")) as cursor:&lt;BR /&gt; for row in cursor:&lt;BR /&gt; exp = 'Division = division'.format(row[0])&lt;BR /&gt; arcpy.SelectLayerByAttribute_management("IndexLayer", "NEW_SELECTION", exp)&lt;BR /&gt; # selection&lt;BR /&gt; arcpy.SelectLayerByLocation_management("transferStation", "WITHIN", "NEW_SELECTION", "IndexLayer")&lt;BR /&gt;arcpy.Select_analysis(transferStation, "in_memory\select1", '')&lt;BR /&gt;numRecords = int(arcpy.GetCount_management("in_memory\select1").getOutput(0))&lt;/P&gt;&lt;P&gt;#Sort selection&lt;/P&gt;&lt;P&gt;#Show selected features&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Add note if there are no counties &amp;gt; 100%&lt;BR /&gt;if numRecords == 0:&lt;BR /&gt; noGrowth.elementPositionX = 3&lt;BR /&gt; noGrowth.elementPositionY = 2&lt;BR /&gt;else:&lt;BR /&gt; #if number of rows exceeds page space, resize row height&lt;BR /&gt; if ((tableHeight - headerHeight) / numRecords) &amp;lt; rowHeight:&lt;BR /&gt; headerHeight = headerHeight * ((tableHeight - headerHeight) / numRecords) / rowHeight&lt;BR /&gt; rowHeight = (tableHeight - headerHeight) / numRecords&lt;BR /&gt; &lt;BR /&gt;#Set and clone vertical line work&lt;BR /&gt;vertLine.elementHeight = (headerHeight) + (rowHeight * numRecords)&lt;BR /&gt;vertLine.elementPositionX = upperX&lt;BR /&gt;vertLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 1.5&lt;BR /&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 2.5&lt;BR /&gt; &lt;BR /&gt;#Set and clone horizontal line work&lt;BR /&gt;horzLine.elementWidth = tableWidth&lt;BR /&gt;horzLine.elementPositionX = upperX&lt;BR /&gt;horzLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;horzLine.clone("_clone")&lt;BR /&gt;horzLine.elementPositionY = upperY - headerHeight&lt;/P&gt;&lt;P&gt;print numRecords&lt;BR /&gt;y=upperY - headerHeight&lt;BR /&gt;for horz in range(1, numRecords+1):&lt;BR /&gt; y = y - rowHeight&lt;BR /&gt; temp_horz = horzLine.clone("_clone")&lt;BR /&gt; temp_horz.elementPositionY = y&lt;/P&gt;&lt;P&gt;#Set header text elements&lt;BR /&gt;headerTxt.fontSize = headerHeight / 0.0155&lt;BR /&gt;headerTxt.text = "Name"&lt;BR /&gt;headerTxt.elementPositionX = upperX + 0.75&lt;BR /&gt;headerTxt.elementPositionY = upperY - (headerHeight / 2)&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Type"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Longitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Latitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;#Set and clone cell text elements&lt;BR /&gt;cellTxt.fontSize = rowHeight / 0.0155&lt;/P&gt;&lt;P&gt;y = upperY - headerHeight&lt;BR /&gt;rows = arcpy.SearchCursor("in_memory\select1")&lt;BR /&gt;for row in rows:&lt;BR /&gt; x = upperX + 0.05&lt;BR /&gt; col1CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col1CellTxt.text = row.getValue("Name")&lt;BR /&gt; col1CellTxt.elementPositionX = x&lt;BR /&gt; col1CellTxt.elementPositionY = y&lt;BR /&gt; col2CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col2CellTxt.text = row.getValue("Type")&lt;BR /&gt; col2CellTxt.elementPositionX = x + 1.75&lt;BR /&gt; col2CellTxt.elementPositionY = y&lt;BR /&gt; col3CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col3CellTxt.elementPositionX = x + 3&lt;BR /&gt; col3CellTxt.elementPositionY = y&lt;BR /&gt; col4CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col4CellTxt.elementPositionX = x +4.75&lt;BR /&gt; col4CellTxt.elementPositionY = y&lt;BR /&gt; y = y - rowHeight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ExportToPDF(mxd, relpath + "\\" + division + ".pdf")&lt;BR /&gt;os.startfile(relpath + "\\" + division + ".pdf")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Jun 2017 12:33:47 GMT</pubDate>
    <dc:creator>FarhanMustafa</dc:creator>
    <dc:date>2017-06-24T12:33:47Z</dc:date>
    <item>
      <title>How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344587#M2220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Dear sir,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;A href="https://community.esri.com/migrated-users/3100" target="_blank"&gt;Xander Bakker&lt;/A&gt;‌&amp;nbsp;&lt;A href="https://community.esri.com/people/Dan_Patterson" target="_blank"&gt;Dan_Patterson&lt;/A&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;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&amp;nbsp;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:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sys
relpath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;argv&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

division &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Reference MXD and layers&lt;/SPAN&gt;
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relpath &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"\map.mxd"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
transferStation &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"tlsf"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Reference page layout elements&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; elm &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayoutElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar1txt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar1txt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar2txt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar2txt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bar3txt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; bar3txt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NoGrowth"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; noGrowth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"horzLine"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; horzLine &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"vertLine"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; vertLine &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"cellTxt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; cellTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"headerTxt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; headerTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; elm
&lt;SPAN class="comment token"&gt;#Clean-up before next page&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; elm &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayoutElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GRAPHIC_ELEMENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*clone*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;delete&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; elm &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayoutElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT_ELEMENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*clone*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; elm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;delete&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; 
noGrowth&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Reference DDP object and set appropriate page&lt;/SPAN&gt;
ddp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataDrivenPages
ddp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;currentPageID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ddp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPageIDFromName&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;division&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Graphic table variable values&lt;/SPAN&gt;
tableHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3.0&lt;/SPAN&gt;
tableWidth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4.5&lt;/SPAN&gt;
headerHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.2&lt;/SPAN&gt;
rowHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.15&lt;/SPAN&gt;
upperX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;
upperY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3.2&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Build selection set&lt;/SPAN&gt;
divisionName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ddp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pageRow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Division
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Processing: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; division&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"IndexLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Division"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Division = divisionName'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"IndexLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; exp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# selection&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"transferStation"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Select_analysis&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;transferStation&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"in_memory\IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
numRecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"in_memory\IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Sort selection&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Show selected features&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#Add note if there are no counties &amp;gt; 100%&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; numRecords &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; noGrowth&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
&amp;nbsp; noGrowth&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="comment token"&gt;#if number of rows exceeds page space, resize row height&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tableHeight &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; numRecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; rowHeight&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; headerHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; headerHeight &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tableHeight &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; numRecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; rowHeight
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tableHeight &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; numRecords
&amp;nbsp; 
&lt;SPAN class="comment token"&gt;#Set and clone vertical line work&lt;/SPAN&gt;
vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;headerHeight&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rowHeight &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; numRecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX
vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperY

temp_vert &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
temp_vert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1.5&lt;/SPAN&gt;
temp_vert &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
temp_vert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2.5&lt;/SPAN&gt;
temp_vert &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
temp_vert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3.5&lt;/SPAN&gt;
temp_vert &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; vertLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
temp_vert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4.5&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;#Set and clone horizontal line work&lt;/SPAN&gt;
horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementWidth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tableWidth
horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX
horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperY

horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperY &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; numRecords
y&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;upperY &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; horz &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; numRecords&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; rowHeight
&amp;nbsp; temp_horz &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; horzLine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; temp_horz&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y

&lt;SPAN class="comment token"&gt;#Set header text elements&lt;/SPAN&gt;
headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fontSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; headerHeight &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.0155&lt;/SPAN&gt;
headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Name"&lt;/SPAN&gt;
headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.75&lt;/SPAN&gt;
headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperY &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;headerHeight &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

newFieldTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Type"&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt; 

newFieldTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2.75&lt;/SPAN&gt; 

newFieldTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; headerTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;
newFieldTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3.25&lt;/SPAN&gt; 

&lt;SPAN class="comment token"&gt;#Set and clone cell text elements&lt;/SPAN&gt;
cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fontSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rowHeight &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.0155&lt;/SPAN&gt;

y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperY &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; headerHeight
rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"in_memory\IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; upperX &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.05&lt;/SPAN&gt;
&amp;nbsp; col1CellTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col1CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col1CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; x
&amp;nbsp; col1CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y
&amp;nbsp; col2CellTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col2CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Type"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col2CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1.75&lt;/SPAN&gt;
&amp;nbsp; col2CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y
&amp;nbsp; col3CellTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col3CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;round&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col3CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;
&amp;nbsp; col3CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y
&amp;nbsp; col4CellTxt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_clone"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col4CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;round&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; col4CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4.75&lt;/SPAN&gt;
&amp;nbsp; col4CellTxt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;elementPositionY &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y
&amp;nbsp; y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; y &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; rowHeight
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"in_memory\IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"in_memory\IndexLayer4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;



arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExportToPDF&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; relpath &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; division &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".pdf"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startfile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relpath &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; division &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".pdf"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344587#M2220</guid>
      <dc:creator>FarhanMustafa</dc:creator>
      <dc:date>2021-12-11T16:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344588#M2221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the &lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/functions/searchcursor.htm"&gt;Search Cursor&lt;/A&gt; in the python module named arcpy&amp;nbsp;to query the feature layer.&lt;/P&gt;&lt;P&gt;You can also use the result from the Search Cursor with &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-feature-layer.htm"&gt;Make Feature Layer tool&lt;/A&gt;&amp;nbsp;to create a new Feature Layer.&lt;/P&gt;&lt;P&gt;For zooming up to certain extent here is the &lt;A href="https://gis.stackexchange.com/questions/227666/zoom-to-extent-using-arcpy"&gt;StackOverflow Article &lt;/A&gt;where you can set the extent of the data frame.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344588#M2221</guid>
      <dc:creator>GurminderBharani</dc:creator>
      <dc:date>2017-06-23T19:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344589#M2222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Farhan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think Gurminder's advice is quite good.&amp;nbsp;If you have access to the Esri Production Mapping extension, it looks like you can use the dynamic table layout element to configure and produce the table according to &lt;A href="https://blogs.esri.com/esri/arcgis/2012/09/13/create-a-dynamic-table-in-your-map-layout/" rel="nofollow noopener noreferrer" target="_blank"&gt;these guidelines&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you get the dynamic table set up in your layout, here is some code that may help you get started with producing your maps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# create mxd and data frame objects&lt;/SPAN&gt;
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;activeDataFrame

&lt;SPAN class="comment token"&gt;# create a counter that you can use to name your output PDFs&lt;/SPAN&gt;
counter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# loop through the cities layer with a search cursor&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"cities_layer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"OBJECTID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# select the city&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'OBJECTID = {}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"cities_layer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; exp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# zoom to the city&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zoomToSelectedFeatures&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshActiveView&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# select the population points within the current city&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"population_points"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"cities_layer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# export the map to PDF and increment the counter&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExportToPDF&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CityPDF_{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;counter&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps! Good luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Micah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344589#M2222</guid>
      <dc:creator>MicahBabinski</dc:creator>
      <dc:date>2021-12-11T16:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344590#M2223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sir for your kindness, I found it really helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2017 07:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344590#M2223</guid>
      <dc:creator>FarhanMustafa</dc:creator>
      <dc:date>2017-06-24T07:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344591#M2224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;0-Dear sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hopeful that you will be fine. Please look at the problem I am pointing at:&lt;/P&gt;&lt;P&gt;I am working on mapbook and data driven is applied on a layer named "IndexLayer" against "Divsion" field. This layer contains the boundaries of Divisions (Division is an administrative distribution, which contains more than one city in my country). I have some point which are placed in a layer named, "tlsf". At the data driven pages, on the each division page, I want to select the point which lie into the corresponding boundary and then want them to display on the map. I have worked on the table. The problem I am getting is a the selection end. The received error is attached in the screen shot. I am also pasting the code here. I require your kindness. Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="The error I am receiving while executing." class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/358509_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = os.path.dirname(sys.argv[0])&lt;/P&gt;&lt;P&gt;division = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;#Reference MXD and layers&lt;BR /&gt;mxd = arcpy.mapping.MapDocument(relpath + r"\map.mxd")&lt;BR /&gt;transferStation = arcpy.mapping.ListLayers(mxd, "tlsf")[0]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Reference page layout elements&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd):&lt;BR /&gt; if elm.name == "bar1": bar1 = elm&lt;BR /&gt; if elm.name == "bar2": bar2 = elm&lt;BR /&gt; if elm.name == "bar3": bar3 = elm&lt;BR /&gt; if elm.name == "bar1txt": bar1txt = elm&lt;BR /&gt; if elm.name == "bar2txt": bar2txt = elm&lt;BR /&gt; if elm.name == "bar3txt": bar3txt = elm&lt;BR /&gt; if elm.name == "NoGrowth": noGrowth = elm&lt;BR /&gt; if elm.name == "horzLine": horzLine = elm&lt;BR /&gt; if elm.name == "vertLine": vertLine = elm&lt;BR /&gt; if elm.name == "cellTxt": cellTxt = elm&lt;BR /&gt; if elm.name == "headerTxt": headerTxt = elm&lt;BR /&gt;#Clean-up before next page&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt; &lt;BR /&gt;noGrowth.elementPositionX = -3&lt;BR /&gt;cellTxt.elementPositionX = -3&lt;BR /&gt;headerTxt.elementPositionX = -3&lt;BR /&gt;horzLine.elementPositionX = -3&lt;BR /&gt;vertLine.elementPositionX = -3&lt;/P&gt;&lt;P&gt;#Reference DDP object and set appropriate page&lt;BR /&gt;ddp = mxd.dataDrivenPages&lt;BR /&gt;ddp.currentPageID = ddp.getPageIDFromName(division)&lt;/P&gt;&lt;P&gt;#Graphic table variable values&lt;BR /&gt;tableHeight = 3.0&lt;BR /&gt;tableWidth = 2.5&lt;BR /&gt;headerHeight = 0.2&lt;BR /&gt;rowHeight = 0.15&lt;BR /&gt;upperX = 2.8&lt;BR /&gt;upperY = 3.2&lt;/P&gt;&lt;P&gt;#Build selection set&lt;BR /&gt;divisionName = ddp.pageRow.Division&lt;BR /&gt;arcpy.AddMessage("Processing: " + division)&lt;BR /&gt;with arcpy.da.SearchCursor("IndexLayer", ("Division")) as cursor:&lt;BR /&gt; for row in cursor:&lt;BR /&gt; exp = 'Division = division'.format(row[0])&lt;BR /&gt; arcpy.SelectLayerByAttribute_management("IndexLayer", "NEW_SELECTION", exp)&lt;BR /&gt; # selection&lt;BR /&gt; arcpy.SelectLayerByLocation_management("transferStation", "WITHIN", "NEW_SELECTION", "IndexLayer")&lt;BR /&gt;arcpy.Select_analysis(transferStation, "in_memory\select1", '')&lt;BR /&gt;numRecords = int(arcpy.GetCount_management("in_memory\select1").getOutput(0))&lt;/P&gt;&lt;P&gt;#Sort selection&lt;/P&gt;&lt;P&gt;#Show selected features&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Add note if there are no counties &amp;gt; 100%&lt;BR /&gt;if numRecords == 0:&lt;BR /&gt; noGrowth.elementPositionX = 3&lt;BR /&gt; noGrowth.elementPositionY = 2&lt;BR /&gt;else:&lt;BR /&gt; #if number of rows exceeds page space, resize row height&lt;BR /&gt; if ((tableHeight - headerHeight) / numRecords) &amp;lt; rowHeight:&lt;BR /&gt; headerHeight = headerHeight * ((tableHeight - headerHeight) / numRecords) / rowHeight&lt;BR /&gt; rowHeight = (tableHeight - headerHeight) / numRecords&lt;BR /&gt; &lt;BR /&gt;#Set and clone vertical line work&lt;BR /&gt;vertLine.elementHeight = (headerHeight) + (rowHeight * numRecords)&lt;BR /&gt;vertLine.elementPositionX = upperX&lt;BR /&gt;vertLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 1.5&lt;BR /&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 2.5&lt;BR /&gt; &lt;BR /&gt;#Set and clone horizontal line work&lt;BR /&gt;horzLine.elementWidth = tableWidth&lt;BR /&gt;horzLine.elementPositionX = upperX&lt;BR /&gt;horzLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;horzLine.clone("_clone")&lt;BR /&gt;horzLine.elementPositionY = upperY - headerHeight&lt;/P&gt;&lt;P&gt;print numRecords&lt;BR /&gt;y=upperY - headerHeight&lt;BR /&gt;for horz in range(1, numRecords+1):&lt;BR /&gt; y = y - rowHeight&lt;BR /&gt; temp_horz = horzLine.clone("_clone")&lt;BR /&gt; temp_horz.elementPositionY = y&lt;/P&gt;&lt;P&gt;#Set header text elements&lt;BR /&gt;headerTxt.fontSize = headerHeight / 0.0155&lt;BR /&gt;headerTxt.text = "Name"&lt;BR /&gt;headerTxt.elementPositionX = upperX + 0.75&lt;BR /&gt;headerTxt.elementPositionY = upperY - (headerHeight / 2)&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Type"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Longitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Latitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;#Set and clone cell text elements&lt;BR /&gt;cellTxt.fontSize = rowHeight / 0.0155&lt;/P&gt;&lt;P&gt;y = upperY - headerHeight&lt;BR /&gt;rows = arcpy.SearchCursor("in_memory\select1")&lt;BR /&gt;for row in rows:&lt;BR /&gt; x = upperX + 0.05&lt;BR /&gt; col1CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col1CellTxt.text = row.getValue("Name")&lt;BR /&gt; col1CellTxt.elementPositionX = x&lt;BR /&gt; col1CellTxt.elementPositionY = y&lt;BR /&gt; col2CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col2CellTxt.text = row.getValue("Type")&lt;BR /&gt; col2CellTxt.elementPositionX = x + 1.75&lt;BR /&gt; col2CellTxt.elementPositionY = y&lt;BR /&gt; col3CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col3CellTxt.elementPositionX = x + 3&lt;BR /&gt; col3CellTxt.elementPositionY = y&lt;BR /&gt; col4CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col4CellTxt.elementPositionX = x +4.75&lt;BR /&gt; col4CellTxt.elementPositionY = y&lt;BR /&gt; y = y - rowHeight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ExportToPDF(mxd, relpath + "\\" + division + ".pdf")&lt;BR /&gt;os.startfile(relpath + "\\" + division + ".pdf")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2017 12:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344591#M2224</guid>
      <dc:creator>FarhanMustafa</dc:creator>
      <dc:date>2017-06-24T12:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344592#M2225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should really repost the code using these instrucciones:&amp;nbsp;&lt;A href="https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet"&gt;https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet&lt;/A&gt;&amp;nbsp;. The way you posted the code makes it very hard to read since all the important indentations are removed and the code is no longer valid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2017 16:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344592#M2225</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-06-24T16:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344593#M2226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir, 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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on MapBook via DDP. I have to select points which are intersecting 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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 intersecting 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. I tried to write the code under suggested format but with very sorry I coudn't write in that way. Please don't mind. Is it possible if I can get your email address? The code is given by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = os.path.dirname(sys.argv[0])&lt;/P&gt;&lt;P&gt;division = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;#Reference MXD and layers&lt;BR /&gt;mxd = arcpy.mapping.MapDocument(relpath + r"\map.mxd")&lt;BR /&gt;transferStation = arcpy.mapping.ListLayers(mxd, "tlsf")[0]&lt;/P&gt;&lt;P&gt;#Reference page layout elements&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd):&lt;BR /&gt; if elm.name == "bar1": bar1 = elm&lt;BR /&gt; if elm.name == "bar2": bar2 = elm&lt;BR /&gt; if elm.name == "bar3": bar3 = elm&lt;BR /&gt; if elm.name == "bar1txt": bar1txt = elm&lt;BR /&gt; if elm.name == "bar2txt": bar2txt = elm&lt;BR /&gt; if elm.name == "bar3txt": bar3txt = elm&lt;BR /&gt; if elm.name == "NoGrowth": noGrowth = elm&lt;BR /&gt; if elm.name == "horzLine": horzLine = elm&lt;BR /&gt; if elm.name == "vertLine": vertLine = elm&lt;BR /&gt; if elm.name == "cellTxt": cellTxt = elm&lt;BR /&gt; if elm.name == "headerTxt": headerTxt = elm&lt;BR /&gt;#Clean-up before next page&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "*clone*"):&lt;BR /&gt; elm.delete()&lt;BR /&gt; &lt;BR /&gt;noGrowth.elementPositionX = -3&lt;BR /&gt;cellTxt.elementPositionX = -3&lt;BR /&gt;headerTxt.elementPositionX = -3&lt;BR /&gt;horzLine.elementPositionX = -3&lt;BR /&gt;vertLine.elementPositionX = -3&lt;/P&gt;&lt;P&gt;#Reference DDP object and set appropriate page&lt;BR /&gt;ddp = mxd.dataDrivenPages&lt;BR /&gt;ddp.currentPageID = ddp.getPageIDFromName(division)&lt;/P&gt;&lt;P&gt;#Graphic table variable values&lt;BR /&gt;tableHeight = 3.0&lt;BR /&gt;tableWidth = 4.5&lt;BR /&gt;headerHeight = 0.2&lt;BR /&gt;rowHeight = 0.15&lt;BR /&gt;upperX = 11&lt;BR /&gt;upperY = 3.2&lt;/P&gt;&lt;P&gt;#Build selection set&lt;BR /&gt;divisionName = ddp.pageRow.Division&lt;BR /&gt;arcpy.AddMessage("Processing: " + division)&lt;BR /&gt;with arcpy.da.SearchCursor("IndexLayer", ("Division")) as cursor:&lt;BR /&gt; for row in cursor:&lt;BR /&gt; exp = 'Division = divisionName'.format(row[0])&lt;BR /&gt; arcpy.SelectLayerByAttribute_management("IndexLayer", "NEW_SELECTION", exp)&lt;BR /&gt; # selection&lt;BR /&gt; arcpy.SelectLayerByLocation_management("transferStation", "INTERSECT", "NEW_SELECTION", "IndexLayer4")&lt;BR /&gt;arcpy.Select_analysis(transferStation, "in_memory\IndexLayer4", '')&lt;BR /&gt;numRecords = int(arcpy.GetCount_management("in_memory\IndexLayer4").getOutput(0))&lt;/P&gt;&lt;P&gt;#Sort selection&lt;/P&gt;&lt;P&gt;#Show selected features&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Add note if there are no counties &amp;gt; 100%&lt;BR /&gt;if numRecords == 0:&lt;BR /&gt; noGrowth.elementPositionX = 3&lt;BR /&gt; noGrowth.elementPositionY = 2&lt;BR /&gt;else:&lt;BR /&gt; #if number of rows exceeds page space, resize row height&lt;BR /&gt; if ((tableHeight - headerHeight) / numRecords) &amp;lt; rowHeight:&lt;BR /&gt; headerHeight = headerHeight * ((tableHeight - headerHeight) / numRecords) / rowHeight&lt;BR /&gt; rowHeight = (tableHeight - headerHeight) / numRecords&lt;BR /&gt; &lt;BR /&gt;#Set and clone vertical line work&lt;BR /&gt;vertLine.elementHeight = (headerHeight) + (rowHeight * numRecords)&lt;BR /&gt;vertLine.elementPositionX = upperX&lt;BR /&gt;vertLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 1.5&lt;BR /&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 2.5&lt;BR /&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 3.5&lt;BR /&gt;temp_vert = vertLine.clone("_clone")&lt;BR /&gt;temp_vert.elementPositionX = upperX + 4.5&lt;BR /&gt; &lt;BR /&gt;#Set and clone horizontal line work&lt;BR /&gt;horzLine.elementWidth = tableWidth&lt;BR /&gt;horzLine.elementPositionX = upperX&lt;BR /&gt;horzLine.elementPositionY = upperY&lt;/P&gt;&lt;P&gt;horzLine.clone("_clone")&lt;BR /&gt;horzLine.elementPositionY = upperY - headerHeight&lt;/P&gt;&lt;P&gt;print numRecords&lt;BR /&gt;y=upperY - headerHeight&lt;BR /&gt;for horz in range(1, numRecords+1):&lt;BR /&gt; y = y - rowHeight&lt;BR /&gt; temp_horz = horzLine.clone("_clone")&lt;BR /&gt; temp_horz.elementPositionY = y&lt;/P&gt;&lt;P&gt;#Set header text elements&lt;BR /&gt;headerTxt.fontSize = headerHeight / 0.0155&lt;BR /&gt;headerTxt.text = "Name"&lt;BR /&gt;headerTxt.elementPositionX = upperX + 0.75&lt;BR /&gt;headerTxt.elementPositionY = upperY - (headerHeight / 2)&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Type"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Longitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 2.75&lt;/P&gt;&lt;P&gt;newFieldTxt = headerTxt.clone("_clone")&lt;BR /&gt;newFieldTxt.text = "Latitude"&lt;BR /&gt;newFieldTxt.elementPositionX = upperX + 3.25&lt;/P&gt;&lt;P&gt;#Set and clone cell text elements&lt;BR /&gt;cellTxt.fontSize = rowHeight / 0.0155&lt;/P&gt;&lt;P&gt;y = upperY - headerHeight&lt;BR /&gt;rows = arcpy.SearchCursor("in_memory\IndexLayer4")&lt;BR /&gt;for row in rows:&lt;BR /&gt; x = upperX + 0.05&lt;BR /&gt; col1CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col1CellTxt.text = row.getValue("Name")&lt;BR /&gt; col1CellTxt.elementPositionX = x&lt;BR /&gt; col1CellTxt.elementPositionY = y&lt;BR /&gt; col2CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col2CellTxt.text = row.getValue("Type")&lt;BR /&gt; col2CellTxt.elementPositionX = x + 1.75&lt;BR /&gt; col2CellTxt.elementPositionY = y&lt;BR /&gt; col3CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col3CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col3CellTxt.elementPositionX = x + 3&lt;BR /&gt; col3CellTxt.elementPositionY = y&lt;BR /&gt; col4CellTxt = cellTxt.clone("_clone")&lt;BR /&gt; col4CellTxt.text = str(round(row.getValue("Longitude"), 2))&lt;BR /&gt; col4CellTxt.elementPositionX = x +4.75&lt;BR /&gt; col4CellTxt.elementPositionY = y&lt;BR /&gt; y = y - rowHeight&lt;BR /&gt;arcpy.Delete_management("in_memory\IndexLayer4")&lt;BR /&gt;arcpy.Delete_management("in_memory\IndexLayer4")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ExportToPDF(mxd, relpath + "\\" + division + ".pdf")&lt;BR /&gt;os.startfile(relpath + "\\" + division + ".pdf")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 22:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344593#M2226</guid>
      <dc:creator>FarhanMustafa</dc:creator>
      <dc:date>2017-06-30T22:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344594#M2227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Farhan... reposting the code won't help, you need to edit your post, cut the code from the post... then hit the 3 dots&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 30px;"&gt;&lt;STRONG&gt;...&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN style="font-size: 15px;"&gt;on the toolbar above... select Python, then past your code from the original script is best or from the lines you cut and pasted.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;see this for another example &lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;.... another code formatting link ...&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2017 03:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344594#M2227</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-07-01T03:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344595#M2228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sir, I have updated the post, your kindness is required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 17:43:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344595#M2228</guid>
      <dc:creator>FarhanMustafa</dc:creator>
      <dc:date>2017-07-02T17:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to select points within a boundary layer and displaying the table of selected points in Data Driven Pages using Python?</title>
      <link>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344596#M2229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Line 48... this line .... does nothing... is divisionName supposed to be replaced by the value in row[0]?, then you are needing a {} at least&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV style="display: block;"&gt;&lt;DIV&gt;&lt;DIV data-linkedid="communications_2_695974_14_2030"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV data-extendedauthors="false" data-extvisible="false" data-objectid="695974" data-objecttype="2"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE&gt;exp &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'Division = divisionName'&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;format&lt;SPAN&gt;(&lt;/SPAN&gt;row&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 19:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-to-select-points-within-a-boundary-layer-and/m-p/344596#M2229</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-07-02T19:15:04Z</dc:date>
    </item>
  </channel>
</rss>

