public static void SetOrbitGraphics(string satName, bool showInertial, bool showFixed) { AgStkObjectRoot root; AgUiApplication app; // initialize variables app = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11.Application") as AGI.Ui.Application.AgUiApplication; root = (AgStkObjectRoot)app.Personality2; // get the satellite object interfce string objectPath = " */Satellite/" + satName; IAgSatellite sat = root.GetObjectFromPath(objectPath) as IAgSatellite; // Configure the pass graphics IAgVeVOPass pass = sat.VO.Pass as IAgVeVOPass; pass.TrackData.PassData.Orbit.SetLeadDataType(AgELeadTrailData.eDataAll); pass.TrackData.PassData.Orbit.SetTrailDataType(AgELeadTrailData.eDataAll); // Change the orbit system IAgVeVOSystemsCollection orbitSystemsCollection = sat.VO.OrbitSystems as IAgVeVOSystemsCollection; if (showInertial) { orbitSystemsCollection.InertialByWindow.IsVisible = true; } else { orbitSystemsCollection.InertialByWindow.IsVisible = false; } if (showFixed) { orbitSystemsCollection.FixedByWindow.IsVisible = true; } else { orbitSystemsCollection.FixedByWindow.IsVisible = false; } }
public static string GetOrbitSystemData(string objectPath) { //Satellites only string systemName = null; IAgSatellite sat = CommonData.StkRoot.GetObjectFromPath(objectPath) as IAgSatellite; IAgVeVOSystemsCollection orbitSystems = sat.VO.OrbitSystems; int numberSys = orbitSystems.Count; for (int i = 0; i < numberSys; i++) { if (orbitSystems[i].IsVisible) { systemName = orbitSystems[i].Name; } } return(systemName); }
public static void SetOrbitSystem(ObjectData data) { IAgSatellite sat = CommonData.StkRoot.GetObjectFromPath(data.SimplePath) as IAgSatellite; IAgVeVOSystemsCollection orbitSystems = sat.VO.OrbitSystems; int numberSys = orbitSystems.Count; for (int i = 0; i < numberSys; i++) { if (orbitSystems[i].Name == data.CoordSys) { orbitSystems[i].IsVisible = true; } else { orbitSystems[i].IsVisible = false; } } }