<?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 Add layers with Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713042#M55321</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for your prompt reply Graeme, blocking is that I can not add more featureclass again, either by script or by ArcCatalog, the erro is, existing entity ("featureclass alias name")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; There is another way to add without my block to add the same again?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Angel Cardenas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2012 23:06:15 GMT</pubDate>
    <dc:creator>Angel_ReynaldoCardenas_Huerta</dc:creator>
    <dc:date>2012-08-21T23:06:15Z</dc:date>
    <item>
      <title>How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713037#M55316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;how I do this in python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is in VBA&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub AddLayer() 'adiciona el layer al map&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GetT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Open Feature Class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pWorkFact = New AccessWorkspaceFactory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If sPathBase = "" Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFWorkspace = pWorkFact.OpenFromFile(sPathBase, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureClass = pFWorkspace.OpenFeatureClass(sql)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Create new layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureLayer = New FeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureLayer.FeatureClass = pFeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; pFeatureLayer.Name = FRBROW.ComboBox1.Value &amp;amp; " - " &amp;amp; FRBROW.ComboBox2.Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Add layer to map&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMap.AddLayer pFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pActiveView.Refresh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 16:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713037#M55316</guid>
      <dc:creator>Angel_ReynaldoCardenas_Huerta</dc:creator>
      <dc:date>2012-08-19T16:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713038#M55317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A good starting point for this is the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000025000000"&gt;AddLayer&lt;/A&gt;&lt;SPAN&gt; documentation along with the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v0000006s000000"&gt;RefreshActiveView&lt;/A&gt;&lt;SPAN&gt; documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you start with those examples, and don't get all the way to a solution, then post your "code so far" to elicit help to finish it off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Graeme&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 20:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713038#M55317</guid>
      <dc:creator>GraemeBrowning</dc:creator>
      <dc:date>2012-08-19T20:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713039#M55318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an example how to add Feature Class to MXD in Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/60368-Add-Feature-Class-to-MXD?p=208463&amp;amp;viewfull=1#post208463"&gt;http://forums.arcgis.com/threads/60368-Add-Feature-Class-to-MXD?p=208463&amp;amp;viewfull=1#post208463&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 08:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713039#M55318</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-08-20T08:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713040#M55319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you very much for your answers Graeme and Marcin , achieve load the feature class to ArcMap, but I had a problem, and it will not let me upload it again because I created entities, which can not be repeated, the code I use is&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.makefeaturelayer_management ("path or featureclass", "alias")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;there is another way to do this without my block to add again the same featureclass?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the other inconsistency I had is that I arcgis10 hangs, and the program runs only a short time within ArcMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a query, how I would spend my VBA code to. NET and then load it as dll or tlb?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angel Cardenas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 22:39:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713040#M55319</guid>
      <dc:creator>Angel_ReynaldoCardenas_Huerta</dc:creator>
      <dc:date>2012-08-21T22:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713041#M55320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't be afraid to thank us by upvoting our contributions &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without seeing your code and any errors it generates it is hard to be sure what your block may be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I would think that you only need to do MakeFeatureLayer on a particular Feature Class once and then to use SelectLayerByAttributes and SelectLayerByLocation with the selection type set to "CLEAR_SELECTION" in between each issuance to do repeated selections on the same Feature Class via its Feature Layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Graeme&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 22:54:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713041#M55320</guid>
      <dc:creator>GraemeBrowning</dc:creator>
      <dc:date>2012-08-21T22:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add layers with Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713042#M55321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for your prompt reply Graeme, blocking is that I can not add more featureclass again, either by script or by ArcCatalog, the erro is, existing entity ("featureclass alias name")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; There is another way to add without my block to add the same again?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Angel Cardenas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 23:06:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-layers-with-python/m-p/713042#M55321</guid>
      <dc:creator>Angel_ReynaldoCardenas_Huerta</dc:creator>
      <dc:date>2012-08-21T23:06:15Z</dc:date>
    </item>
  </channel>
</rss>

