Public Function GetDiagramTemplates() As IReadOnlyList(Of DiagramTemplate)
public IReadOnlyList<DiagramTemplate> GetDiagramTemplates()
Return Value
A list of DiagramTemplates.
Public Function GetDiagramTemplates() As IReadOnlyList(Of DiagramTemplate)
public IReadOnlyList<DiagramTemplate> GetDiagramTemplates()
| Exception | Description |
|---|---|
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. For example, the diagram manager is invalid. |
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run |
{
// Get all the diagram templates or a template by name
static void RetrieveDiagramTemplates(UtilityNetwork utilityNetwork)
{
string templateName = "ElectricNetworkTemplate";
using DiagramManager diagramManager = utilityNetwork.GetDiagramManager();
// Get all templates
IReadOnlyList<DiagramTemplate> templates = diagramManager.GetDiagramTemplates();
// Get a template by name
DiagramTemplate template = diagramManager.GetDiagramTemplate(templateName);
}
}
{
// Get all the network diagrams from a template or a diagram by name
static void GetNetworkDiagramFromDiagramTemplates(UtilityNetwork utilityNetwork)
{
using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager())
{
// Get the first templates
DiagramTemplate template = diagramManager.GetDiagramTemplates().FirstOrDefault();
// Get the network diagrams fromt he template
IEnumerable<NetworkDiagram> diagrams = template.GetNetworkDiagrams();
// Get a network diagram by name
NetworkDiagram diagram = template.GetNetworkDiagram(_diagramName);
}
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)