新建场景
1.获取当前打开的场景
#获取当前打开的场景
scenario = root.CurrentScenario
2.设置当前场景的时间
scenario.SetTimePeriod('Today','+24hr')
3.添加一个地面目标到当前的场景
scenario.SetTimePeriod('Today','+24hr')
4.添加一个地面目标到当前的场景,括号内是三维坐标
target.Position.AssignGeodetic(50,-100,0)
5.添加和配置太阳仰角访问限制
# IAgAccessConstraintCollection accessConstraints: Access Constraint collection
# To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
minmax = accessConstraints.AddConstraint(58) # eCstrSunElevationAngle
minmax.EnableMin = True
minmax.Min = 22.2
minmax.EnableMax = True
minmax.Max = 77.7
6.添加和配置高度访问限制Add and configure an altitude access constraint
# IAgAccessConstraintCollection accessConstraints: Access Constraint collection
# To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
# Attitude constraint
altitude = accessConstraints.AddConstraint(2) # eCstrAltitude
altitude.EnableMin = True
altitude.Min = 20.5 # km
7.为 STK 对象添加多个相同类型的访问约束
# IAgAccessConstraintCollection accessConstraints: Access Constraint collection
# Add constraints
# Only the eCstrApparentTime (4), eCstrDuration (13), eCstrGMT (16), eCstrIntervals (22), eCstrLocalTime (27) constraint
# types can be added multiple times to the constraint collection.
time1 = accessConstraints.AddConstraint(27) # eCstrLocalTime
time1.Min = '00:00:00.000'
time1.Max = '23:00:00.000'