STK UI CoreSend comments on this topic.
IAgUiWindowMapObject Interface

Description

Represents a 2D (Map) window. Provides methods and properties to access the 2D window properties.

Public Properties

Public Property MapIDA unique identifier associated with the window that can be used with Connect to control the 2D map.

Example

Enumerate all 2D (Map) windows and print their map identifiers.
[C#]
foreach (IAgUiWindow window in application.Windows)
{
    object oSvc = window.GetServiceByType(AgEWindowService.eWindowService2DWindow);
    IAgUiWindowMapObject mapObject = oSvc as IAgUiWindowMapObject;
    if (mapObject != null)
    {
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID);
    }
}
Enumerate all 2D (Map) windows by name and print their map identifiers.
[C#]
foreach (IAgUiWindow window in application.Windows)
{
    object oSvc = window.GetServiceByName("Map");
    IAgUiWindowMapObject mapObject = oSvc as IAgUiWindowMapObject;
    if (mapObject != null)
    {
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID);
    }
}
Enumerate all 2D (Map) windows and print their map identifiers.
[Visual Basic .NET]
For Each window As IAgUiWindow In application.Windows
	Dim oSvc As Object = window.GetServiceByType(AgEWindowService.eWindowService2DWindow)
	Dim mapObject As IAgUiWindowMapObject = TryCast(oSvc, IAgUiWindowMapObject)
	If mapObject IsNot Nothing Then
		Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID)
	End If
Next
Enumerate all 2D (Map) windows by name and print their map identifiers.
[Visual Basic .NET]
For Each window As IAgUiWindow In application.Windows
	Dim oSvc As Object = window.GetServiceByName("Map")
	Dim mapObject As IAgUiWindowMapObject = TryCast(oSvc, IAgUiWindowMapObject)
	If mapObject IsNot Nothing Then
		Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID)
	End If
Next
© 2024 Analytical Graphics, Inc. All Rights Reserved.