将一个传感器对象附加到设备上
root.ExecuteCommand('New / */Satellite/MySatellite/Sensor MySensor');
设置传感器属性
root.ExecuteCommand('Define */Satellite/MySatellite/Sensor/MySensor Rectangular 20 25');
root.ExecuteCommand('Point */Satellite/MySatellite/Sensor/MySensor Fixed AzEl 90 60 Rotate');
root.ExecuteCommand('Location */Satellite/MySatellite/Sensor/MySensor Fixed Cartesian -.0004 -.0004 -.0004'); %default units is meters
传感器主体掩蔽
root.ExecuteCommand('SetAzElMask */Satellite/MySatellite/Sensor/MySensor MaskFile "C:/Program Files/AGI/STK 11/Data/Resources/stktraining/text/BodyMask_hga.bmsk"');
传感器的持久性
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor Persist Time 7200 Forward On Fill On');
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor Fill On');
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor FillTranslucency 50');
应用
uiap = actxserver('STK11.application');
root = uiap.Personality2;
root.NewScenario('MyScenario');
root.ExecuteCommand('New / */Satellite MySatellite');
root.ExecuteCommand('SetUnits / km');%Default Connect Units are meters
root.ExecuteCommand('SetState */Satellite/MySatellite Classical TwoBody "UseAnalysisStartTime" "UseAnalysisStopTime" 60 ICRF "UseAnalysisStartTime" 6678.14 0 28 180 0 180');
root.ExecuteCommand('New / */Satellite/MySatellite/Sensor MySensor');
root.ExecuteCommand('Define */Satellite/MySatellite/Sensor/MySensor Rectangular 20 25');
root.ExecuteCommand('Point */Satellite/MySatellite/Sensor/MySensor Fixed AzEl 90 60 Rotate');
root.ExecuteCommand('Location */Satellite/MySatellite/Sensor/MySensor Fixed Cartesian -.0004 -.0004 -.0004'); %default units is meters
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor Persist Time 7200 Forward On Fill On');
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor Fill On');
root.ExecuteCommand('Graphics */Satellite/MySatellite/Sensor/MySensor FillTranslucency 50');