[英]Python win32com module save command in external application
我正在與win32com
模塊進行Python和STK集成。 我需要構建STK場景並保存它們,問題是我在AGI文檔中找不到任何保存示例。 這是一個起點:
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.")
如何告訴wind32com
保存創建的方案?
現在有效的是:
root.ExecuteCommand('Save / * "{}"'.format(scenario_path))
實際上,這是一種解決方法,正在發送Save
命令以由STK connect執行。 我給出了要保存該方案的位置的路徑,並且據我的理解, *
表示將保存所有內容,而可以將單個對象作為參數放置。
根據AGI的文檔 ,此命令的語法為:
SaveAs <ApplicationPath> <ObjectPath> "<FilePath>"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.