Import Territory Solution (Territory Design)
Summary
Tool allows creating new Territory Solution based on an existing Solution and a new Alignment Layer. The new Solution must contain territories hierarchy, variables, constraints and all others from the base Territory Solution. In other words, the tool must copy the base Territory Solution and change its Alignment Layer.
Usage
-
Polygon and Point layers can be used as Alignment Layer for new Territory Solution
One of String, Integer, SmallInteger, Double, Single, Date, OID, GlobalID, GUID field of Alignment Layer can be used as Display Field. Default value is Alignment Layer’s display field. If Alignment Layer’s display field is not defined first suitable field will be applied.
Territory Solution Location is a path to "Territories" folder in a current project of BA by default.
Default Territory Solution Name is generated if not specified.
Syntax
Parameter | Explanation | Data Type |
in_territory_solution_layer |
Territory Solution layer from which to import | GP TD Layer |
in_alignment_layer |
Alignment Layer for new Territory Solution | Feature Layer |
in_display_field (Optional) |
Display Field for Territory Solution | Field |
in_territory_solution_location (Optional) |
Location of Territory Solution | String |
in_territory_solution_name (Optional) |
Name of Territory Solution | String |
Code Sample
The following Python window script demonstrates how to use the tool in immediate mode.
import arcgisscripting
gp = arcgisscripting.create()
gp.ImportTerritorySolution_TD("new layer", "esri_zip5", "NAME", "C:/BA Output/Project/Default Project/Territories/", "new layer2")
The following stand-alone script demonstrates how to use the tool.
# Import system modules
import arcgisscripting
gp = arcgisscripting.create()
# Set local variables
solution = "new layer"
alignmentLayer = "esri_zip5"
displayField = "NAME"
solutionLocation = "C:/BA Output/Project/Default Project/Territories/"
solutionName = "new layer2"
# Execute tool
gp.ImportTerritorySolution_TD(solution, alignmentLayer, displayField, solutionLocation, solutionName)