Вы находитесь на странице: 1из 10

The New Enhancements in ModelBuilder in ArcGIS 10

Article ID : Software : Platform Date : : TT100036 ArcGIS Desktop 10 Windows XP, Windows Vista, Windows 7 1 May, 2011
st

Introduction ModelBuilder is a built-in function in ArcGIS Desktop to string sequences of Geoprocessing tools together. The model that streamline your workflow can be reused and make work more efficient. For example, we can create a model that tie up couples of Geoprocessing tools to convert e00 files to Geodatabase format. This article demonstrates how to create a model that converts e00 files to Geodatabase format; and introducing the new enhancements in ModelBuilder in ArcGIS10.

The general enhancements in ModelBuilder Modelbuilders toolbar has been updated to make ModelBuilder more user-friendly. Couples of new buttons have been added such as delete, undo, redo and validate entire model. When you mouse over any model elements in Modelbuilder, tooltips are available to show parameters.

Delete: Delete all selected model-processes. Undo: Undo changes that made from last saved. Redo: Redo all undo changes that made from last saved. Validate Entire Model: Validate all parameters in each model-process.

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 1 of 10

The New tools specifically designed for ModelBuilder There are new tools specifically designed for ModelBuilder; they are Iterators tools and Model Only tools. The following steps demonstrate the flow of creating a model that loop building e00 files by using one of the Iterators tools and convert them into Coverage. Then, all relevant coverage feature classes will be collected by one of the Model Only tools; and append into existing Geodatabase Feature Class.

1.

Preparation for creating a model:

Firstly, we need to find an existing custom toolbox or create a new toolbox to shelter the new models. A Toolbox can be created under a folder or Geodatabase. Secondly, we need to create a Geodatabase feature class that will be used to append coverage features in later steps.

In this example, we are going to create a new toolbox under a New Geodatabase. Open ArcCatalog > right click a folder from folder connections > File Geodatabase Right click the Geodatabase > New > Feature Dataset; and enter all necessary information for the feature dataset such as name, coordinate system Right Click the feature dataset that you have created in above > New > Feature class; and enter all the necessary information for the feature class such as Name, feature type, attributes etc. Right click the Geodatabase > New > Toolbox Right click the Toolbox > New Model

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 2 of 10

2.

Find all the relevant e00 files from a list of folders

You can now start adding model elements into the new model that you have created in previous step: Update Model properties from Model menu if necessary Add the Iterate Files tool by right click anywhere in the model to open the context menu > Iterators > files as below:

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 3 of 10

Double-click the Iterate Files model-process and fill in all the parameters accordingly, the following is an example for this article:

File output element: store all the e00 files that satisfy the parameters set in Iterate files dialog. Name output element: store the e00 files name that returned by the Iterate files model-process.

Add Import from E00 tool from ArcToolbox to the model and double-click it for configuration as following:

Output name in the Import From E00 dialog: %Name%%n% is an inline variable. This uses the

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 4 of 10

Name output element returned by Iterate Files tools; and concatenates with iterate sequences number. Click run running: from the toolbar, and your model should look similar to the following after finished

When looking at the coverage folder, all the building e00 files have been converted to coverages named bldg0, bldg1, bldg 2 and so on.

Save and close your model.

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 5 of 10

3.

Find relevant Coverage feature classes using Iterators and Model Only tools

You will now create a model that serves as a sub-model for next step. You will use the iterate feature class tools to find all the relevant coverage arc feature classes and use collect value tool to collect all the possible feature classes returned by Iterate feature classes tools. Create a new model and update the model properties if necessary Add the Iterate feature class tools as you have done in last step with the following configuration:

Add the Collect Values tool by right click anywhere in the model to open the context menu > Model Only Tools > Collect Values as below:

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 6 of 10

Configure the Collect Values tool as below:

Right-click Output Values > Model Parameter

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 7 of 10

Save and close your model.

4.

Append all the coverage features to Geodatabase feature class

You will now create a model to append all the building arc from coverage to Geodatabase feature class. You will integrate the model that created in last step with the append tools from ArcToolbox Data Management Toolbox:

Create a new model as you have done before and update the model properties if necessary Drag and drop the 2) Loop Coverage Feature Class model into the model Add the Append tool into the model as below:

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 8 of 10

Use the connect button Input Datasets as below:

on the toolbar to connect Output Values with Append tools and choose

Double-click Append tool and configure the dialog as below:

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 9 of 10

Click run to run the model and your model should look similar to the following:

Save and close your model after you have finished Preview the Geodatabase feature class as BldgFinal above to double check features have been appended.

Further reference: ModelBuilder Basic: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_ModelBuilder/002w00000028000 000/ Create a Sub-model: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Integrating_a_model_within_a_model/002w000000 7p000000/ Inline Variable (e.g. %name%%n%): http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_using_inline_variable_substitution /002w0000001t000000/

The End

Copyright 2011 Esri China (Hong Kong) Limited All rights reserved.

Tips & Tricks prepared by Esri China (HK) Technical Support P. 10 of 10

Вам также может понравиться