Hi,
I am trying to trace a Utility Network with ArcGIS Pro 2.6 using a custom C# trace task (need to do some neat stuff).
Any one know how to pass in a trace argument for a condition barrier?
Subnetworks—ArcGIS Pro | Documentation
I'd like to be able to set the condition barrier programmatically for a network category
Thanks,
Kieren
Hi Kieren,
You do this by creating a CategoryComparison object, and setting it in the TraceConfiguration, like this:
CategoryComparison categoryComparison = new CategoryComparison(CategoryOperator.IsEqual, “Protective Device”);
traceConfiguration.Traversability.Barriers = categoryComparison;
If you haven't read it already, this doc walks through all of the different trace classes and how they are used. Also, we have a Load Report sample that demonstrates the use of a CategoryComparison.
I hope this helps. Please let us know if you have further questions.
--Rich
Rich,
Thank you, that was relatively painless - ended up adding it to the Filters in order to stop the trace, but it's working well now.
Rich Ruh, quick question. Looking through the trace arguments and everything, it all works very well. Is it easily doable to use attributes on the underlying features to constrain the trace? I.e. set up a condition where I can query and constrain based on Attribute Value "A", something like trace a water line, but only where pressure is 50? or material is "steel"
Absolutely! Just use a NetworkAttributeComparison object instead. You can use the And and Or classes to combine multiple tests together. Depending on what you are trying to do, you'd add it to the Traversability, Filter, or OutputCondition properties of TraceConfiguration.
--Rich