Using python to automate Autodesk Inventor

孤街醉人 提交于 2019-12-11 15:48:14

问题


Is there a way to open and control a solid model in Inventor using python?

My goal to start with a database of dimensions and simulate every configuration.


回答1:


This snippet is a great place to start:

#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


来源:https://stackoverflow.com/questions/46324690/using-python-to-automate-autodesk-inventor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!