STK笔记2-python互联(读取存在的仿真)

stk11.2与python互联,并读取卫星的信息

# %%import
import datetime
import os
import time
from tqdm import tqdm
import pandas as pd
from win32api import GetSystemMetrics
import win32com.client
from comtypes.gen import STKObjects
from comtypes.client import CreateObject, GetActiveObject, GetEvents, CoGetObject, ShowEvents

# %%
# 创建数据存储路径
target_excel_dir = r'F:/python file/STK/stk01'
if not os.path.exists(target_excel_dir):
    os.makedirs(target_excel_dir)

# %%run stk
# Get reference to running STK instance
app = CreateObject("STK11.Application")
app = win32com.client.Dispatch('STK11.Application')
app.Visible = True


    # Disable graphics. The NoGraphics property must be set to true before the root object is created.


    # Create root object
    #stkRoot = CreateObject('AgStkObjects11.AgStkObjectRoot')
app.UserControl=True
# Get our IAgStkObjectRoot interface
root = app.Personality2

root.Load('F:\STKwork\

你可能感兴趣的:(python,开发语言)