ArcGIS Pro SDK for Tracing Utility network

645
0
03-12-2021 01:06 AM
Labels (2)
PitchYen
New Contributor

I've created an add-in button for trace without set parameters by user but by using parameter from JSON file (like trace configuration from UN version 5) but to apply with a lower version of UN.

The problem is I can't find some parameter for trace in ProSDK (eg. condition barriers) Is there a way to set it?

Here is an example of JSON (Convert JSON to JObject) and how I set parameters for tracing.

 

[
    {
        "creator": "admin",
        "name": "Downstream at least A",
        "description": "",
        "traceType": 5,
        "configuration": {
            "includeContainers": false,
            "includeContent": false,
            "includeStructures": false,
            "includeBarriers": false,
            "validateConsistency": false,
            "validateLocatability": false,
            "includeIsolated": false,
            "ignoreBarriersAtStartingPoints": false,
            "includeUpToFirstSpatialContainer": false,
            "allowIndeterminateFlow": false,
            "domainNetworkName": "Electric",
            "tierName": "Electric Distribution",
            "targetTierName": "",
            "subnetworkName": "",
            "diagramTemplateName": "",
            "shortestPathNetworkAttributeName": "",
            "filterBitsetNetworkAttributeName": "",
            "traversabilityScope": "junctionsAndEdges",
            "conditionBarriers": [
                {
                    "name": "E:Device Status",
                    "type": "networkAttribute",
                    "operator": "equal",
                    "value": 1,
                    "combineUsingOr": true,
                    "isSpecificValue": true
                },
                {
                    "name": "Lifecycle Status",
                    "type": "networkAttribute",
                    "operator": "doesNotIncludeAny",
                    "value": 24,
                    "combineUsingOr": true,
                    "isSpecificValue": true
                },
                {
                    "name": "Category",
                    "type": "category",
                    "operator": "equal",
                    "value": "E:Ground",
                    "combineUsingOr": false,
                    "isSpecificValue": true
                }
            ],
            "functionBarriers": [],
            "arcadeExpressionBarrier": "",
            "filterBarriers": [
                {
                    "name": "E:Phases Normal",
                    "type": "networkAttribute",
                    "operator": "doesNotIncludeTheValues",
                    "value": 4,
                    "combineUsingOr": false,
                    "isSpecificValue": true
                }
            ],
            "filterFunctionBarriers": [],
            "filterScope": "junctionsAndEdges",
            "functions": [],
            "nearestNeighbor": {
                "count": -1,
                "costNetworkAttributeName": "",
                "nearestCategories": [],
                "nearestAssets": []
            },
            "outputFilters": [],
            "outputConditions": [],
            "propagators": []
        },
        "resultTypes": [],
        "creationDate": 1613987882000,
        "tags": [
            "test"
        ]
    }
]
Traversability tierTraceTraversability = mediumVoltageTier.TraceConfiguration.Traversability;
traceConfiguration.IncludeContainers = traceConf["configuration"]["includeContainers"].ToObject<bool>();
traceConfiguration.IncludeContent = traceConf["configuration"]["includeContent"].ToObject<bool>();
traceConfiguration.IncludeStructures = traceConf["configuration"]["includeStructures"].ToObject<bool>();
traceConfiguration.IncludeBarriersWithResults = traceConf["configuration"]["includeBarriers"].ToObject<bool>();
traceConfiguration.ValidateConsistency = traceConf["configuration"]["validateConsistency"].ToObject<bool>();
traceConfiguration.IncludeIsolatedFeatures = traceConf["configuration"]["includeIsolated"].ToObject<bool>();
traceConfiguration.IgnoreBarriersAtStartingPoints = traceConf["configuration"]["ignoreBarriersAtStartingPoints"].ToObject<bool>();

 

 

 

 

 

 

0 Kudos
0 Replies