Description
Mutually isolates unit preference settings in the current instance from those in other instances of the root.
Syntax
[Visual Basic .NET] |
---|
Public Sub Isolate()
|
[C#] |
---|
public void Isolate();
|
[Managed C++] |
---|
public: void Isolate();
|
[Unmanaged C++] |
---|
public: HRESULT Isolate();
|
Example
Isolate Unit Preferences when using multiple IAgStkObjectRoot objects
[C#] | Copy Code |
---|
IAgStkObjectRoot root1 = new AgStkObjectRootClass();
root1.UnitPreferences.SetCurrentUnit("Distance", "km");
IAgStkObjectRoot root2 = new AgStkObjectRootClass();
root2.Isolate();
root2.UnitPreferences.SetCurrentUnit("Distance", "mi");
if (root1.CurrentScenario != null)
{
root1.CloseScenario();
}
root1.NewScenario("Test");
root1.CurrentScenario.Children.New(AgESTKObjectType.eShip, "Ship1");
IAgShip shipFromRoot1 = root1.GetObjectFromPath("Ship/Ship1") as IAgShip;
IAgShip shipFromRoot2 = root2.GetObjectFromPath("Ship/Ship1") as IAgShip;
shipFromRoot1.SetRouteType(AgEVePropagatorType.ePropagatorGreatArc);
IAgVePropagatorGreatArc greatArcFromRoot1 = shipFromRoot1.Route as IAgVePropagatorGreatArc;
IAgVePropagatorGreatArc greatArcFromRoot2 = shipFromRoot2.Route as IAgVePropagatorGreatArc;
IAgVeWaypointsElement waypointsFromRoot1 = greatArcFromRoot1.Waypoints.Add();
waypointsFromRoot1.Altitude = 1;
IAgVeWaypointsElement waypointsFromRoot2 = greatArcFromRoot2.Waypoints.Add();
waypointsFromRoot2.Altitude = 1;
greatArcFromRoot1.Propagate();
int i = 1;
foreach (IAgVeWaypointsElement wpt in greatArcFromRoot1.Waypoints)
{
Console.WriteLine("Point #{0} Altitude {1} {2}", i, wpt.Altitude, root1.UnitPreferences.GetCurrentUnitAbbrv("Distance"));
++i;
}
Console.WriteLine();
i = 1;
foreach (IAgVeWaypointsElement wpt in greatArcFromRoot2.Waypoints)
{
Console.WriteLine("Point #{0} Altitude {1} {2}", i, wpt.Altitude, root2.UnitPreferences.GetCurrentUnitAbbrv("Distance"));
++i;
}
root1.CloseScenario();
|
|
Isolate Unit Preferences when using multiple IAgStkObjectRoot objects
[Visual Basic .NET] | Copy Code |
---|
|
See Also