STK UI CoreSend comments on this topic.
MapID Property (IAgUiWindowMapObject)
See Also
Windows





Windows & Linux

Description

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

Property type

Read-only property

Syntax

[Visual Basic .NET]
Public Property MapID() As Integer
[C#]
public int MapID {get;}
[Managed C++]
public: __property int get_MapID();
[Unmanaged C++]
public: HRESULT get_MapID(
    long * pRetVal
);
[Java]
public int getMapID();
[Python - STK API ]
@property
def MapID(self) -> int:

See Also

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.