使用python自动化Autodesk Inventor [英] Using python to automate Autodesk Inventor

查看:668
本文介绍了使用python自动化Autodesk Inventor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用python在Inventor中打开和控制实体模型?

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.

推荐答案

此代码段是一个很好的起点:

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

这篇关于使用python自动化Autodesk Inventor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆