<?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: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172831#M55035</link>
    <description>&lt;P&gt;That's very helpful thank you! I've revalidated** Model4 (for ref:)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OscarFitzpatrick_0-1652279657890.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41086iEF7F21FE807074F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OscarFitzpatrick_0-1652279657890.png" alt="OscarFitzpatrick_0-1652279657890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and re-added the new validated model to Model3 which is now adding it to the body of Model3's main function (for ref:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-05-11 15:35:05
"""
import arcpy
import os

from Default.Model4 import Model4
def FeatureClassGenerator(workspace, wild_card, feature_type, recursive) :
  with arcpy.EnvManager(workspace = workspace):

    dataset_list = [""]
    if recursive:
      datasets = arcpy.ListDatasets()
      dataset_list.extend(datasets)

    for dataset in dataset_list:
      featureclasses = arcpy.ListFeatureClasses(wild_card, feature_type, dataset)
      for fc in featureclasses:
        yield os.path.join(workspace, dataset, fc), fc


def Model3():  # Model 3

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    Model_Variables = "C:\\Users\\Scar\\Documents\\landCharges\\landCharges\\Model_Variables"
    test_poly = "test_poly"

    for AssetsCV_shp, Name in FeatureClassGenerator(Model_Variables, "", "", "NOT_RECURSIVE"):

        # Process: Add Field (Add Field) (management)
        AssetsCV_shp_2_ = arcpy.management.AddField(in_table=AssetsCV_shp, field_name="Reference", field_type="TEXT", field_precision=None, field_scale=None, field_length=100, field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]

        # Process: Model 4 (Model 4) (Default)
        Model4(test_poly=test_poly)

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(outputCoordinateSystem="PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]", scratchWorkspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb", workspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb"):
        Model3()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see that Model 4 is being run recursively in the main body of Model3, making the processes very lengthy. I'm unsure if there is a way to alter the code of the Model directly, but I would like Model4 to run before the for loop in the main body of the Model3 function.&lt;/P&gt;&lt;P&gt;After I run these processes, I would like to iterate through the created shapefiles and export their tables to a .csv file, and then colate these .csv's into a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**For ref on the validation in case anyone is having similar trouble: My model was running correctly despite not being validated if you ran it as a geoprocessing tool. I was able to fix the validation by creating a new variable in model builder and setting it as a feature layer, and selecting the 'test_poly' as the default feature layer for when the model is run in model builder as opposed to a geoprocessing tool. The problem here was that the geoprocessing tool prompted the user for a variable it would use for the process, whereas the model had no such prompt.&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2022 14:52:04 GMT</pubDate>
    <dc:creator>OscarFitzpatrick</dc:creator>
    <dc:date>2022-05-11T14:52:04Z</dc:date>
    <item>
      <title>Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172491#M54990</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have created a model which iterates through some feature layers, makes a select by location, and exports the selected features into a folder as shapefiles.&lt;/P&gt;&lt;P&gt;I have also created a second model which is in theory supposed to run the model above, and then iterate through the the shapefiles and add a new field to each featureclass.&lt;/P&gt;&lt;P&gt;At present, my model does not run the former model, and I do not understand how to edit the python code so that I can run both models sequentially.&lt;/P&gt;&lt;P&gt;I have attached screenshots of the former model (Model4) and latter model (Model3), and the python code exported from the latter model.&lt;/P&gt;&lt;P&gt;Model4:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OscarFitzpatrick_0-1652203391972.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41003i498AC6A6E2076DDC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OscarFitzpatrick_0-1652203391972.png" alt="OscarFitzpatrick_0-1652203391972.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Model3:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OscarFitzpatrick_1-1652203414658.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41005i5C2378FE377C587C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OscarFitzpatrick_1-1652203414658.png" alt="OscarFitzpatrick_1-1652203414658.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Python Export:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-05-10 18:24:07
"""
import arcpy
import os

from Default.Model4 import Model4
from sys import argv
def FeatureClassGenerator(workspace, wild_card, feature_type, recursive) :
with arcpy.EnvManager(workspace = workspace):

dataset_list = [""]
if recursive:
datasets = arcpy.ListDatasets()
dataset_list.extend(datasets)

for dataset in dataset_list:
featureclasses = arcpy.ListFeatureClasses(wild_card, feature_type, dataset)
for fc in featureclasses:
yield os.path.join(workspace, dataset, fc), fc


def Model3(test_poly="test_poly"): # Model 3

# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False

Model_Variables = "C:\\Users\\Scar\\Documents\\landCharges\\landCharges\\Model_Variables"

for AssetsCV_shp, Name in FeatureClassGenerator(Model_Variables, "", "", "NOT_RECURSIVE"):

# Process: Add Field (Add Field) (management)
AssetsCV_shp_2_ = arcpy.management.AddField(in_table=AssetsCV_shp, field_name="Reference", field_type="TEXT", field_precision=None, field_scale=None, field_length=100, field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]

# Process: Model 4 (Model 4) (Default)
Model4(test_poly=test_poly)

if __name__ == '__main__':
# Global Environment settings
with arcpy.EnvManager(outputCoordinateSystem="PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]", scratchWorkspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb", workspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb"):
Model3(*argv[1:])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I understand from the python code, Model4 is being imported, but is not being called.I've had a look at the documentation for arcpy.EnvManager, but I haven't found any info on how an imported model is called as an argument within another.&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 11:38:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172491#M54990</guid>
      <dc:creator>OscarFitzpatrick</dc:creator>
      <dc:date>2022-05-11T11:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172564#M55005</link>
      <description>&lt;P&gt;Can just select stuff in one model, copy, paste into the other and connect them.&lt;/P&gt;&lt;P&gt;Is there specific reason you need two different models.&lt;/P&gt;&lt;P&gt;Also, more likely to get responses with code question if you use the &lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;code editor to insert code i&lt;/A&gt;nto the post.&amp;nbsp; Otherwise, it loses all indents and structure, and becomes hard to follow.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 21:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172564#M55005</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-05-10T21:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172733#M55023</link>
      <description>&lt;P&gt;&lt;EM&gt;Also, more likely to get responses with code question if you use the &lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;code editor to insert code i&lt;/A&gt;nto the post.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- I couldn't see the code editor first time around but that looks much more accessible now, thanks!&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Can just select stuff in one model, copy, paste into the other and connect them.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;- &lt;/EM&gt;When I'm in the model builder and I can't directly connect Model4 to any process as it isn't a variable. For reference, it doesn't seem to me that the function from Model4 is being used in the code for Model3. I'm not sure how I can signal to Model Builder that in essence I would like the function from Model4 to run prior to the function created for Model3.&lt;BR /&gt;&lt;BR /&gt;This is perhaps due to my lack of knowledge of how the arcpy.EnvManger parameters work - if anyone has any tips on that it would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Model3:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-05-11 12:46:03
"""
import arcpy
import os

from Default.Model4 import Model4
from sys import argv
def FeatureClassGenerator(workspace, wild_card, feature_type, recursive) :
  with arcpy.EnvManager(workspace = workspace):

    dataset_list = [""]
    if recursive:
      datasets = arcpy.ListDatasets()
      dataset_list.extend(datasets)

    for dataset in dataset_list:
      featureclasses = arcpy.ListFeatureClasses(wild_card, feature_type, dataset)
      for fc in featureclasses:
        yield os.path.join(workspace, dataset, fc), fc


def Model3(test_poly="test_poly"):  # Model 3

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    Model_Variables = "C:\\Users\\Scar\\Documents\\landCharges\\landCharges\\Model_Variables"

    for AssetsCV_shp, Name in FeatureClassGenerator(Model_Variables, "", "", "NOT_RECURSIVE"):

        # Process: Add Field (Add Field) (management)
        AssetsCV_shp_2_ = arcpy.management.AddField(in_table=AssetsCV_shp, field_name="Reference", field_type="TEXT", field_precision=None, field_scale=None, field_length=100, field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]

        # Process: Model 4 (Model 4) (Default)
        Model4(test_poly=test_poly)

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(outputCoordinateSystem="PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]", scratchWorkspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb", workspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb"):
        Model3(*argv[1:])&lt;/LI-CODE&gt;&lt;P&gt;Model4:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-05-11 12:46:26
"""
import arcpy
from sys import argv
def #  NOT  IMPLEMENTED# Function Body not implemented

def Model4(test_poly):  # Model 4

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Conversion Tools.tbx.tbx")
    Input_Map = "Layers"
    Model_Variables_2_ = "C:\\Users\\Scar\\Documents\\landCharges\\landCharges\\Model_Variables"

    for OUTPUT_LAYER, Name, Output_Layer_Type, Workspace_or_Format_Type in #  NOT  IMPLEMENTED(Input_Map, "", ["FeatureLayer"], [], [], [], "ALL", "ALL", "RECURSIVE"):

        # Process: Select Layer By Location (Select Layer By Location) (management)
        AssetsCV, Output_Layer_Names, Count = arcpy.management.SelectLayerByLocation(in_layer=[OUTPUT_LAYER], overlap_type="INTERSECT", select_features=test_poly, search_distance="", selection_type="NEW_SELECTION", invert_spatial_relationship="NOT_INVERT")

        # Process: Feature Class To Shapefile (Feature Class To Shapefile) (conversion)
        Model_Variables = arcpy.conversion.FeatureClassToShapefile(Input_Features=[OUTPUT_LAYER], Output_Folder=Model_Variables_2_)[0]

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(outputCoordinateSystem="PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]", scratchWorkspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb", workspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb"):
        Model4(*argv[1:])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks for taking a look!&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 11:49:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172733#M55023</guid>
      <dc:creator>OscarFitzpatrick</dc:creator>
      <dc:date>2022-05-11T11:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172799#M55029</link>
      <description>&lt;P&gt;Looks like Model 4 did not validate.&amp;nbsp; That probably indicates an error in Model 4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm guessing the OUTPUT LAYER parameter from Iterate Layers in Model 4 should not be used as input into the Feature Class To Shapefile tool.&amp;nbsp; Rather the output of the Select Layer By Location tool should feed the Feature Class to Shapefile tool in Model 4.&amp;nbsp; Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KimGarbade_0-1652277387874.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41077i1187B1A7FE0D99C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KimGarbade_0-1652277387874.png" alt="KimGarbade_0-1652277387874.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, I agree with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530"&gt;@RhettZufelt&lt;/a&gt;.&amp;nbsp; I don't see why two models are necessary.&amp;nbsp; You can add the attributes to the shapefiles as they are created, but if you do want to create the shapefiles first and add the fields later you will need 2 models (since their is a limit of one iterator per model as you know).... To use two model try making Model 4 a precondition of Model 3.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 14:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172799#M55029</guid>
      <dc:creator>KimberlyGarbade</dc:creator>
      <dc:date>2022-05-11T14:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172831#M55035</link>
      <description>&lt;P&gt;That's very helpful thank you! I've revalidated** Model4 (for ref:)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OscarFitzpatrick_0-1652279657890.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41086iEF7F21FE807074F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OscarFitzpatrick_0-1652279657890.png" alt="OscarFitzpatrick_0-1652279657890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and re-added the new validated model to Model3 which is now adding it to the body of Model3's main function (for ref:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-05-11 15:35:05
"""
import arcpy
import os

from Default.Model4 import Model4
def FeatureClassGenerator(workspace, wild_card, feature_type, recursive) :
  with arcpy.EnvManager(workspace = workspace):

    dataset_list = [""]
    if recursive:
      datasets = arcpy.ListDatasets()
      dataset_list.extend(datasets)

    for dataset in dataset_list:
      featureclasses = arcpy.ListFeatureClasses(wild_card, feature_type, dataset)
      for fc in featureclasses:
        yield os.path.join(workspace, dataset, fc), fc


def Model3():  # Model 3

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    Model_Variables = "C:\\Users\\Scar\\Documents\\landCharges\\landCharges\\Model_Variables"
    test_poly = "test_poly"

    for AssetsCV_shp, Name in FeatureClassGenerator(Model_Variables, "", "", "NOT_RECURSIVE"):

        # Process: Add Field (Add Field) (management)
        AssetsCV_shp_2_ = arcpy.management.AddField(in_table=AssetsCV_shp, field_name="Reference", field_type="TEXT", field_precision=None, field_scale=None, field_length=100, field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]

        # Process: Model 4 (Model 4) (Default)
        Model4(test_poly=test_poly)

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(outputCoordinateSystem="PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]", scratchWorkspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb", workspace=r"C:\Users\Scar\Documents\landCharges\landCharges\Default.gdb"):
        Model3()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see that Model 4 is being run recursively in the main body of Model3, making the processes very lengthy. I'm unsure if there is a way to alter the code of the Model directly, but I would like Model4 to run before the for loop in the main body of the Model3 function.&lt;/P&gt;&lt;P&gt;After I run these processes, I would like to iterate through the created shapefiles and export their tables to a .csv file, and then colate these .csv's into a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**For ref on the validation in case anyone is having similar trouble: My model was running correctly despite not being validated if you ran it as a geoprocessing tool. I was able to fix the validation by creating a new variable in model builder and setting it as a feature layer, and selecting the 'test_poly' as the default feature layer for when the model is run in model builder as opposed to a geoprocessing tool. The problem here was that the geoprocessing tool prompted the user for a variable it would use for the process, whereas the model had no such prompt.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 14:52:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172831#M55035</guid>
      <dc:creator>OscarFitzpatrick</dc:creator>
      <dc:date>2022-05-11T14:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172856#M55046</link>
      <description>&lt;P&gt;Here's the thing about iterators in Model Builder.&amp;nbsp; They run everything in the model, regardless of where that tool or sub model is in relations to the Iterator.&amp;nbsp; &amp;nbsp;For example, my brain would tell me that since model 4 is running before the iterator is fired in Model 3, Model 4 would run once and then Model 3's iterator would loop as many times as necessary, but that is not the case.&amp;nbsp; In your model 3, each time that iterator loops Model 4's iterator will loop.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to deal with this is don't use a sub model containing an iterator as an input into another model that contains an iterator.&amp;nbsp; For example; have a third "Main" model that calls Model 4 and then calls Model 3 rather than calling Model 4 directly from model 3.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 15:15:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172856#M55046</guid>
      <dc:creator>KimberlyGarbade</dc:creator>
      <dc:date>2022-05-11T15:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting Models In Model Builder / Running Two Sequential Geoprocessing Tasks</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172875#M55048</link>
      <description>&lt;P&gt;That's done the trick! I've taken Model4 out of Model3 and run both Models in a main Model instead.&lt;/P&gt;&lt;P&gt;That's excellent info, I couldn't find anything similar on the Esri documentation. Now I can move on to trying to collate all of the tables into one export - thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 15:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/nesting-models-in-model-builder-running-two/m-p/1172875#M55048</guid>
      <dc:creator>OscarFitzpatrick</dc:creator>
      <dc:date>2022-05-11T15:38:38Z</dc:date>
    </item>
  </channel>
</rss>

