问题
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