4

I'm working with Python and STK integration. I need to build scenarios and save them, the problem is that I cannot find any saving example on AGI's documentation. Here is a starting point:

import win32com.client

uiApplication = win32com.client.Dispatch('STK11.Application')
uiApplication.Visible = True

root = uiApplication.Personality2

root.NewScenario('this_Scenario')
satellite = root.CurrentScenario.Children.New(18, 'this_Satellite') # eSatellite

input("Press enter to exit script.")

How to tell STK to save the created scenario?

Mefitico
  • 1,957
  • 9
  • 34
  • @DanPichelman : This is SpaceExploration.SE, I don't think there is a Space.SE. I did happen to post it before in Politics by accident. – Mefitico Feb 21 '19 at 12:09

1 Answers1

5

Your variable root is of type IAgStkObjectRoot. If you search the Programming Interface Help, there are five save related methods for this type. These include Save() and SaveAs()

So the easiest implementation would be: root.Save() which will save the scenario in the Documents\STK folder.

If you want to control the specific location to save to you can try: root.SaveAs([FULL FILE NAME AND PATH])

Carlos N
  • 4,444
  • 15
  • 37