The following example uses the If Feature Type Is tool to check if a specific dataset is a point feature class. If the value of the Mask parameter is set to any other value, the False output variable and precondition are set to false, and the connected Select Layer By Attribute tool is set to select business entities with no mask policy. If the Mask parameter is set to "Yes", the True output variable and the precondition are set to true, allowing the connected Select Layer By Attribute tool to select only those business entities that have mandated masks. The Expression parameter uses inline variable substitution and checks the value of Mask. The If Expression Is tool has two Boolean outputs: True and False. This model has an input parameter named Mask and based on its value, the model selects specific data for analysis. The following example uses the If Expression Is tool to find business entities with or without mandated mask policy. Many business entities have mandated wearing masks to protect against COVID-19. If the False output variable is true (meaning the input data is not a shapefile), the model runs the top branch. If the input data is a shapefile, the True output variable and the precondition are set to true, allowing the bottom branch of multiple Add Field and Calculate Field tools to run. This model checks if the input data model parameter is a shapefile or feature class and processes the data accordingly. The If Data Type Is tool has two Boolean outputs: True and False. The following example uses the If Data Type Is tool to check the data type of the input dataset. If the True output variable is true (meaning the input dataset has the specified coordinate system), the model ends because no tools are connected to the True branch. If each feature class does not have a specified coordinate system, the False output variable and the precondition are set to true, allowing the Project tool to run. This model iterates over feature classes in a geodatabase and checks if each feature class has a particular projected coordinate system. The If Coordinate System Is tool has two Boolean outputs: True and False. The following example uses the If Coordinate System Is tool in ModelBuilder to check if a dataset has a certain coordinate system. If the False output variable is true (meaning no features are selected), the model ends as no tools are connected to the False branch. If the input has any selected features, the True output variable and the precondition are set to true, allowing the Summary Statistic tool to run. The If Selection Exists tool has two Boolean outputs: True and False. If Selection Exists is used after first running Selection Layer By Attribute. The following example uses the If Selection Exists tool to check if the input has any selected features and if so, the number of selected features. If the True output variable is true (meaning the field does exist), the model ends as no tools are connected to the True branch. If the field does not exist in the input dataset, the False output variable and precondition are set to true, allowing the Add Field tool to run. The If Field Exists tool has two Boolean outputs: True and False. The following example uses the If Field Exists tool to check if fields of a given name already exist in a dataset. If the False output variable is true (meaning the data does not exist), the model makes a copy of another dataset and runs the Calculate Field tool using this alternate dataset as input. If the input exists, the True output variable and the precondition are set to true, allowing the Calculate Field tool to run. The If Data Exists tool has two Boolean outputs: True and False. The following example uses the If Data Exists tool to check if the input features from a model parameter exist.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |