0

有没有办法使用 python 在 Inventor 中打开和控制实体模型?

我的目标是从一个维度数据库开始并模拟每个配置。

4

1 回答 1

1

这个片段是一个很好的起点:

#Open Inventor
invApp = win32com.client.Dispatch("Inventor.Application")

#Make inventor visible
invApp.Visible = True

#Set file names of template
Part_FileName_BaseIPT = 'C:\\Base.ipt'

#Open the base model
oPartDoc=invApp.Documents.Open(Part_FileName_BaseIPT)

#Collect parameters
oParams = oPartDoc.ComponentDefinition.Parameters

#Set Angularity        
oParams.Item("Name").Expression = *Value*

#Update document
oPartDoc.Update()

#Save new version
oPartDoc.Save
于 2017-09-27T15:03:02.640 回答