<?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 do I select features in a shapefile, zoom to extent and save a mxd to a directory? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286788#M7404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian - thank you for your response &amp;amp; suggestions regarding Search Cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds very close to what we are aiming to achieve. &amp;nbsp;Yes - please&amp;nbsp;share some starting code if you don't mind doing so. &amp;nbsp;You could post here or send an email to me at &lt;A href="mailto:bmcpherson@landactive.com"&gt;bmcpherson@landactive.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Mar 2017 19:04:57 GMT</pubDate>
    <dc:creator>BryanMcPherson1</dc:creator>
    <dc:date>2017-03-28T19:04:57Z</dc:date>
    <item>
      <title>How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286784#M7400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - It's been 10 years since programming something .. in desperate need of assistance from this community. &amp;nbsp;I have a project that seems like an easy assignment but I forget the names of objects, calls, procedures, functions, etc. However programming theory is still ingrained into my head through years of doing it. There are 4 questions related to a project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if ArcObjects or Python is the best way to approach it (advice here is also appreciated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Context &amp;amp; questions below.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;Context:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The project invlolves selecting a COMMUNITY name with multiple features located on a map. The data is stored in 3 separate shapefiles (points, lines &amp;amp; polys). For each COMMUNITY there are multiple IDs - we'll call them PINs. I want to create a series of maps (mxds) for all the PINs associated with that COMMUNITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say the PIN is 8199. Since a PIN can be the form of a point, line &amp;amp; poly then all these features will be selected &amp;amp; zoomed to and appear on a map titled 8199 &amp;amp; saved to a directory. Then it moves onto the next PIN - 8200 and does the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am aiming to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Have a button in the arcgis window that opens a msgbox (or combobox on the toolbar). The pulldown box will ask the user to select a COMMUNITY name. This will then set a COMMUNITY name for each of the 3 shapefiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question # 1 -&amp;gt;&lt;/STRONG&gt; How does one create a pulldown msgbox (or combobox on the toolbar) populated either from an existing feature table? &amp;nbsp;There are duplicate values for each COMMUNITY - is there a way to filter this to show only one instance (unique values) of each for the pulldown?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Select all the features for each point, line &amp;amp; poly layer (PIN = 8199). Maybe it is selected through a recordset,&lt;BR /&gt;or managed through a definition query .. I'm not sure - just looking for the easiest method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question # 2 -&amp;gt;&lt;/STRONG&gt; What function, command or procedure is needed to do this?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3) Once all features are selected (PIN - 8199) it zooms to the extent of all the features selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question # 3 -&amp;gt;&lt;/STRONG&gt; What function, command or procedure is needed to zoom to all selected features?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4) Save the mxd based on 4 digit PIN selected into a directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question # 4 -&amp;gt;&lt;/STRONG&gt; What function, command or procedure is needed to save the mxd?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point it will move on to the next record in the recordset and do the same thing until the last record (maybe 50&lt;BR /&gt;or more in total maps). Ideally I would have a message box that states # of mxd's saved to the pathname &lt;BR /&gt;(ex: "47 maps saved to c:\gis\communitymaps")&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I will be modifying this code and adding more bells &amp;amp; whistles as I go - but this is the start of it. Any help or support&lt;BR /&gt;from this forum is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;- Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 22:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286784#M7400</guid>
      <dc:creator>BryanMcPherson1</dc:creator>
      <dc:date>2017-03-22T22:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286785#M7401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and welcome back to programming. &amp;nbsp;In the last 10 years a lot has changed in customizing ArcMap. &amp;nbsp;Since you put this into the ArcObject SDK section, here are the answers if you decide to use ArcObjects: &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1&lt;/P&gt;&lt;P&gt;I suggest looking at ArcMap add-ins. &amp;nbsp;&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Building_add_ins_for_ArcGIS_for_Desktop/0001000000w2000000/" title="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Building_add_ins_for_ArcGIS_for_Desktop/0001000000w2000000/"&gt;ArcObjects Help for .NET developers&lt;/A&gt;&amp;nbsp; This should have more than enough information to get you going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#2&lt;/P&gt;&lt;P&gt;Really depends on how you want to proceed, you will probably create an IQueryFilter and then use that to select your features into an ISelectionSet with the FeatureClass.Select function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#3&amp;nbsp;&lt;/P&gt;&lt;P&gt;To zoom to your objects, you will want to find the greatest extent around the objects and use the Extent function in the IActiveView interface in Carto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#4&amp;nbsp;&lt;/P&gt;&lt;P&gt;A clarification, you don't save it to the MXD, you save it to some layer (Shapefile, etc.) and then load that layer into the MXD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will want to look at the IFeatureDataConverter2 interface in the Geodatabase section. &amp;nbsp;Specifically you will use the ConvertFeatureClass function with a SelectionSet option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add the layer to a map, just get the IMap interface and run the AddLayer function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure someone else will reply with information for Python scripting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:37:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286785#M7401</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2017-03-23T18:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286786#M7402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent - thank you kindly for all the suggestions. &amp;nbsp;I have taken a look and think that is plenty to get me started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a little confused on question #4. &amp;nbsp;For each PIN a map needs to be created that is zoomed to the full extent. &amp;nbsp;This map has symbology, surround text and other items associated with it in the map (mxd). &amp;nbsp;The project needs an mxd to be created for each PIN. &amp;nbsp;Is there not a simple method to either save or export the mxd by the PIN name &amp;amp; then move on to the next record?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 18:51:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286786#M7402</guid>
      <dc:creator>BryanMcPherson1</dc:creator>
      <dc:date>2017-03-24T18:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286787#M7403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually do this fairly extensively, managing several thousand map documents that are automatically created based on ObjectIDs using python and the arcpy mapping module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a search cursor to loop through each record in a geodatabase feature class, collect all the attribute information I need into variables and use them to subset my layers already on a map template and update text elements and other layout elements on my map.&amp;nbsp; It then saves a copy of the map using the ID number and other attributes and saves them to specified output folders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search Cursor&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/searchcursor-class.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/searchcursor-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help with Arcpy mapping module&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1778"&gt;https://community.esri.com/docs/DOC-1778&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are going to use a map template as a base, I would recommend naming all the text and layout elements in the map you are wishing to change in order to make them easier to access via arcpy.mapping.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are interested in this let me know and I can post some good starter code for you with examples for setting up a cursor, accessing map documents in memory, changing layout elements and querying layers in the TOC, changing the dataframe extent and scale, saving and exporting maps, etc.&amp;nbsp; However, I do not use a combo box as I designed my script to run standalone but I'm sure you could adapt it to a combo box if needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 19:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286787#M7403</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-24T19:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286788#M7404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian - thank you for your response &amp;amp; suggestions regarding Search Cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds very close to what we are aiming to achieve. &amp;nbsp;Yes - please&amp;nbsp;share some starting code if you don't mind doing so. &amp;nbsp;You could post here or send an email to me at &lt;A href="mailto:bmcpherson@landactive.com"&gt;bmcpherson@landactive.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286788#M7404</guid>
      <dc:creator>BryanMcPherson1</dc:creator>
      <dc:date>2017-03-28T19:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286789#M7405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a fairly busy workday today so can't really flesh out some starter code at the moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did dig up an old post I had where I posted a good portion of code I used for this function(Down towards the bottom).&amp;nbsp; Its fairly idiosyncratic to my set-up but should give plenty of examples for doing many of the things you would need to do for your map automation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/160192"&gt;https://community.esri.com/thread/160192&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 16:25:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286789#M7405</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-29T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286790#M7406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thank you Ian - this is enough to get me started. &amp;nbsp;If you&amp;nbsp;think there is anything that would build on this then share when you have a chance. &amp;nbsp;I really appreciate your code from the previous thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 18:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286790#M7406</guid>
      <dc:creator>BryanMcPherson1</dc:creator>
      <dc:date>2017-03-29T18:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286791#M7407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose really on what exactly you are wanting to do with it and how your data is arranged.&amp;nbsp; I will say though that I have improved on that code&amp;nbsp;pretty significantly and plan to do so again.&amp;nbsp; The biggest inefficiency&amp;nbsp;in that script is everything takes place within the cursor which slows stuff down ALOT(It took 4 days to create about 4500 map documents and PDFs).&amp;nbsp; &amp;nbsp; I'm planning to read everything to a dictionary in the future and then looping through the dictionary(See &lt;A href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries?sr=search&amp;amp;searchId=117ed577-1c9e-4907-9dd8-4c385595cdbb&amp;amp;searchIndex=3"&gt;/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries?sr=search&amp;amp;searchId=117ed577-1c9e-4907-9dd8-4c385595cdbb&amp;amp;searchIndex=3&lt;/A&gt; for help with that if you want to implement) and create the maps.&amp;nbsp; The other thing I changed significantly is I use definition queries to subset my layers now instead of selecting them and making a new layer each time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a few other tricks I've developed since then as well, such as turning layers on and off if they intersect with other layers, moving&amp;nbsp;text elements to a location on a map with a fixed extent.&amp;nbsp; Scale bars can be tricky when working with multiple scales(I do everything in multiples of 1:1200, since most of my maps are of fairly small&amp;nbsp;areas and my engineer likes everything nice and even on an engineering scale.), as are legends when all the&amp;nbsp;classes may or may not be in the map extent.&amp;nbsp; I recommend planning out exactly how you want things to look for each map and&amp;nbsp;test your script as you go&amp;nbsp;on small subsets of your data to make sure it works as you think it should.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also cannot reiterate how important it is to go and name all the elements of whatever map templates you develop to make all the features easy to access with python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have questions about anything feel free to ask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 19:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286791#M7407</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-29T19:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286792#M7408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff;"&gt;"The other thing I changed significantly is I use definition queries to subset my layers now instead of selecting them and making a new layer each time."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Do you have a sample of how you approached this? &amp;nbsp;It sounds like a perfect solution for my project. &amp;nbsp;As far as switching from a cursor approach to a dictionary approach - this is a good idea. &amp;nbsp;&amp;nbsp;For now though we only need to run 100 maps at a time so cursors might be a better alternative for our project. &amp;nbsp;I will check into both solutions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 23:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286792#M7408</guid>
      <dc:creator>BryanMcPherson1</dc:creator>
      <dc:date>2017-03-30T23:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select features in a shapefile, zoom to extent and save a mxd to a directory?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286793#M7409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ex.&amp;nbsp; Layer.definitionQuery = ' ID = ' + str(ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Layer Class help: &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you create a layer object for the layer in the map, you can change its definition query property.&amp;nbsp; This example is using the ID field and the ID value pulled from the cursor.&amp;nbsp; Obviously you would need to change to your PIN value and field and you may or may not need a more complex expression if you are planning to use your Community values in your query as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Joshua Bixby's post in the below thread about suggestions for python string formatting when writing SQL queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/121098"&gt;https://community.esri.com/thread/121098&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 13:49:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-select-features-in-a-shapefile-zoom-to/m-p/286793#M7409</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-31T13:49:38Z</dc:date>
    </item>
  </channel>
</rss>

