<?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 use multiple layer while generating grid index feature in acpy ? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261951#M65976</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/630935"&gt;@NiharSahoo&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what values you are passing on those three variables, but this snippet works as expected creating grid index on those places where features intersect.&lt;/P&gt;&lt;P&gt;1) Create a filtered layer from a feature class&lt;/P&gt;&lt;P&gt;2) Create another filtered layer from another feature class&lt;/P&gt;&lt;P&gt;3) Create the index passing the temp layers as input parameter in the&amp;nbsp;GridIndexFeatures tool&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcpy.management.MakeFeatureLayer("D:\\ArcGIS_Pro\\MyProject\\MyProject.gdb\\featureclass", 'temp_layer', "OBJECTID = 1")
arcpy.management.MakeFeatureLayer("D:\\ArcGIS_Pro\\MyProject\\MyProject.gdb\\featureclass2", 'temp_2_layer', "OBJECTID = 3")
arcpy.cartography.GridIndexFeatures(r"D:\ArcGIS_Pro\MyProject\MyProject.gdb\grid2", "temp_layer;temp_2_layer", "INTERSECTFEATURE", "NO_USEPAGEUNIT", None, '', '', '', 3, 3, 1, "NO_LABELFROMORIGIN")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 12:08:25 GMT</pubDate>
    <dc:creator>Kepa</dc:creator>
    <dc:date>2023-02-27T12:08:25Z</dc:date>
    <item>
      <title>How to use multiple layer while generating grid index feature in acpy ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261945#M65973</link>
      <description>&lt;P&gt;I want to generate grid index feature using multiple layers as a common layer for the input parameter to the grid map. But the map will not use the filtered data in the definition query as input and it will take all data as input so my problem will not getting resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code for which the issue is exist please let me know where is the issue with my code ?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;my_cable_str &lt;/SPAN&gt;= &lt;SPAN&gt;str&lt;/SPAN&gt;(my_cable)&lt;BR /&gt;&lt;SPAN&gt;my_tail_str &lt;/SPAN&gt;= &lt;SPAN&gt;str&lt;/SPAN&gt;(my_tail)&lt;BR /&gt;&lt;SPAN&gt;my_closure_str &lt;/SPAN&gt;= &lt;SPAN&gt;str&lt;/SPAN&gt;(my_closure)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.cartography.GridIndexFeatures(grid_new_name, my_closure_str + ";" +my_cable_str +";"+ my_tail_str, "INTERSECTFEATURE",&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                                     "NO_USEPAGEUNIT")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NiharSahoo_0-1677497140611.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63755i9BC552545BE31E49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NiharSahoo_0-1677497140611.png" alt="NiharSahoo_0-1677497140611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 11:25:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261945#M65973</guid>
      <dc:creator>NiharSahoo</dc:creator>
      <dc:date>2023-02-27T11:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple layer while generating grid index feature in acpy ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261951#M65976</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/630935"&gt;@NiharSahoo&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what values you are passing on those three variables, but this snippet works as expected creating grid index on those places where features intersect.&lt;/P&gt;&lt;P&gt;1) Create a filtered layer from a feature class&lt;/P&gt;&lt;P&gt;2) Create another filtered layer from another feature class&lt;/P&gt;&lt;P&gt;3) Create the index passing the temp layers as input parameter in the&amp;nbsp;GridIndexFeatures tool&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcpy.management.MakeFeatureLayer("D:\\ArcGIS_Pro\\MyProject\\MyProject.gdb\\featureclass", 'temp_layer', "OBJECTID = 1")
arcpy.management.MakeFeatureLayer("D:\\ArcGIS_Pro\\MyProject\\MyProject.gdb\\featureclass2", 'temp_2_layer', "OBJECTID = 3")
arcpy.cartography.GridIndexFeatures(r"D:\ArcGIS_Pro\MyProject\MyProject.gdb\grid2", "temp_layer;temp_2_layer", "INTERSECTFEATURE", "NO_USEPAGEUNIT", None, '', '', '', 3, 3, 1, "NO_LABELFROMORIGIN")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 12:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261951#M65976</guid>
      <dc:creator>Kepa</dc:creator>
      <dc:date>2023-02-27T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple layer while generating grid index feature in acpy ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261967#M65982</link>
      <description>&lt;P&gt;currently i am doing like this&lt;/P&gt;&lt;PRE&gt;LayerObj1 = map_object.listLayers(&lt;SPAN class=""&gt;"cable"&lt;/SPAN&gt;)[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;]
LayerObj2 = map_object.listLayers(&lt;SPAN class=""&gt;"closure"&lt;/SPAN&gt;)[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;]&lt;/PRE&gt;&lt;PRE&gt;arcpy.cartography.GridIndexFeatures(
out_feature_class=&lt;SPAN class=""&gt;"grid"&lt;/SPAN&gt;,
in_features=&lt;SPAN class=""&gt;"LayerObj1;LayerObj2"&lt;/SPAN&gt;,
intersect_feature=&lt;SPAN class=""&gt;"INTERSECTFEATURE"&lt;/SPAN&gt;,
use_page_unit=&lt;SPAN class=""&gt;"NO_USEPAGEUNIT"&lt;/SPAN&gt;,
scale=&lt;SPAN class=""&gt;None&lt;/SPAN&gt;,
polygon_width=&lt;SPAN class=""&gt;"405 Meters"&lt;/SPAN&gt;,
polygon_height=&lt;SPAN class=""&gt;"325 Meters"&lt;/SPAN&gt;,
starting_page_number=&lt;SPAN class=""&gt;1&lt;/SPAN&gt;,
label_from_origin=&lt;SPAN class=""&gt;"NO_LABELFROMORIGIN"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;still it is not working&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 13:20:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1261967#M65982</guid>
      <dc:creator>NiharSahoo</dc:creator>
      <dc:date>2023-02-27T13:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple layer while generating grid index feature in acpy ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1262334#M66009</link>
      <description>&lt;P&gt;Looking at your code we can assume that layers on the map are already filtered with a definition query, right? Instead of using layers from the map object try to create them with MakeFeatureLayer directly from the feature class. Depending on ArcGIS PRO version I found that definition queries don't work as expected as input parameters of other tools.&lt;/P&gt;&lt;P&gt;If your workflow implies the use of map object you can use&amp;nbsp;&lt;EM&gt;definitionQuery&lt;/EM&gt; property of each layer to create this temp layers.&lt;/P&gt;&lt;PRE&gt;LayerObj1 = map_object.listLayers(&lt;SPAN class=""&gt;"cable"&lt;/SPAN&gt;)[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;]&lt;BR /&gt;tempLayer1 = arcpy.management.MakeFeatureLayer(LayerObj1, 'temp1', LayerObj1.definitionQuery)
LayerObj2 = map_object.listLayers(&lt;SPAN class=""&gt;"closure"&lt;/SPAN&gt;)[&lt;SPAN class=""&gt;0&lt;/SPAN&gt;]&lt;BR /&gt;tempLayer2 = arcpy.management.MakeFeatureLayer(LayerObj2, 'temp2', LayerObj2.definitionQuery)&lt;/PRE&gt;&lt;PRE&gt;arcpy.cartography.GridIndexFeatures(out_feature_class=&lt;SPAN class=""&gt;"grid"&lt;/SPAN&gt;,in_features=&lt;SPAN class=""&gt;"temp1;temp2" ...)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 07:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-use-multiple-layer-while-generating-grid/m-p/1262334#M66009</guid>
      <dc:creator>Kepa</dc:creator>
      <dc:date>2023-02-28T07:18:04Z</dc:date>
    </item>
  </channel>
</rss>

