private NamedTraceConfiguration GetNamedTraceConfigurationsByName(UtilityNetwork utilityNetwork, string configurationName = "WaterNetwork") { // Query to find named trace configurations NamedTraceConfigurationQuery namedTraceConfigurationQuery = new NamedTraceConfigurationQuery { Names = new List<string> { configurationName } }; // Get the trace manager from the utility network using (TraceManager traceManager = utilityNetwork.GetTraceManager()) { // A set of named trace configurations specified by the named traced configuration query IReadOnlyList<NamedTraceConfiguration> namedTraceConfigurations = traceManager.GetNamedTraceConfigurations(namedTraceConfigurationQuery); NamedTraceConfiguration waterConfiguration = namedTraceConfigurations.First(f => f.Description.Equals(configurationName)); return waterConfiguration; } }
Target Platforms: Windows 11, Windows 10