Inventor二次开发入门
- 格式:docx
- 大小:1.67 MB
- 文档页数:73
有关inventor ilogic与二次开发的书籍-回复在这篇文章中,我们将探讨与"有关inventor ilogic与二次开发的书籍"的主题,并提供一步一步的回答。
iLogic是AutoDesk Inventor中的一种功能强大的自动化工具,可用于创建自定义命令、规则和逻辑,以满足特定的设计需求。
以下是一些我们推荐的与iLogic二次开发相关的书籍。
第一步:选择合适的书籍1. "iLogic for Autodesk Inventor 2019: A Tutorial Introduction" - by Randy H. Shih这本书是学习iLogic的入门级指南,以AutoDesk Inventor 2019为基础。
它提供了详细的步骤和示例,帮助读者了解iLogic的基本概念和功能。
这本书特别适合没有iLogic经验的初学者。
2. "Autodesk Inventor iLogic: Advanced Concepts" - by Adam Ringley这本书是一个更高级的指南,适合那些已经熟悉iLogic并希望深入了解其高级概念和功能的人。
它包含了对规则、函数、表达式和循环等主题的广泛探讨,以及使用iLogic创建自定义界面的方法。
读者可以通过本书学习如何最大限度地使用iLogic来提高他们的设计效率。
第二步:阅读和实践一旦您选择了一本书,就可以开始阅读。
确保您理解了书中的概念和示例。
针对每个主题,尝试将其应用于您的具体需求,以加深对iLogic的理解。
该步骤涉及的关键是实践。
通过在实际项目中应用所学的概念和技巧,可以更好地掌握iLogic。
与书中的示例不同,实践使您能够适应各种情况和需求,并在应用中发现新的应用场景。
第三步:参考在线资源除了书籍,还有许多在线资源可以帮助您更好地理解iLogic并进行二次开发。
AutoDesk官方网站上有iLogic的文档和教程,可供参考。
Inventor基础培训教程(含多场合)Inventor基础培训教程一、引言AutodeskInventor是一款强大的三维机械设计软件,广泛应用于产品设计和制造领域。
本教程旨在为零基础用户介绍Inventor的基本功能和使用方法,帮助读者快速掌握Inventor的基本操作,为深入学习打下坚实基础。
二、软件界面与功能模块1.软件界面启动Inventor后,映入眼帘的是其直观、易用的界面。
软件界面主要包括栏、菜单栏、工具栏、浏览器、绘图区和状态栏等部分。
2.功能模块Inventor包含多个功能模块,以满足不同设计需求。
主要模块如下:(1)零件设计:用于创建和编辑三维零件模型。
(2)装配设计:用于将多个零件组合成装配体,并进行分析和仿真。
(3)工程图:用于创建和编辑二维工程图。
(4)钣金设计:用于设计钣金零件。
(5)焊接设计:用于设计焊接结构和焊接工艺。
(6)框架设计:用于设计框架和管路系统。
(7)模具设计:用于设计注塑模具。
(8)线路设计:用于设计电气线路和电缆。
三、基本操作与工具1.鼠标操作在Inventor中,鼠标操作至关重要。
左键用于选择和拖动对象,右键用于打开上下文菜单,中键用于平移和缩放视图。
2.视图控制视图控制工具位于界面右下角,包括旋转、平移、缩放等操作。
通过鼠标滚轮和键盘快捷键也可以实现视图控制。
3.工具栏Inventor的工具栏位于界面顶部和左侧,提供了丰富的设计工具。
通过右键工具栏,可以自定义显示的工具栏和命令。
4.命令输入在命令框中输入命令名称,可以快速执行相关操作。
输入命令时,系统会自动提示可能的命令,方便用户选择。
5.浏览器浏览器用于显示和管理当前文档中的零件、装配体和工程图。
通过浏览器,可以轻松地切换和编辑不同组件。
四、零件设计1.创建草图在零件设计模块中,需要创建草图。
草图是二维图形,用于定义三维模型的轮廓。
选择“草图”命令,在绘图区绘制草图。
2.创建特征基于草图,可以创建各种特征,如拉伸、旋转、扫掠等。
Inventor培训教程引言:Inventor是一款由Autodesk公司开发的3D设计软件,广泛应用于机械设计、建筑设计和产品设计等领域。
本教程旨在为初学者提供Inventor的基础知识和操作技能,帮助读者快速掌握Inventor的基本功能和使用方法。
第一部分:Inventor界面和基本操作1.1启动Inventor1.2熟悉Inventor界面1.3设置Inventor工作环境1.4创建和管理Inventor文件第二部分:2D草图绘制2.1了解2D草图绘制环境2.2绘制基本几何图形2.3编辑草图2.4尺寸标注和约束2.5创建草图块第三部分:3D建模3.1了解3D建模环境3.2创建基本几何体3.3创建草图并拉伸3.4创建旋转和扫掠特征3.5创建放样特征3.6编辑3D模型第四部分:装配设计4.1了解装配设计环境4.2创建和管理装配文件4.3放置和约束组件4.4编辑装配结构4.5创建运动仿真第五部分:工程图制作5.1了解工程图制作环境5.2创建和管理工程图文件5.3创建视图和投影视图5.4尺寸标注和注释5.5栏和表格第六部分:渲染和动画制作6.1了解渲染和动画制作环境6.2设置渲染环境6.3创建材质和纹理6.4设置灯光和阴影6.5创建动画和渲染输出第七部分:Inventor的高级功能7.1自定义特征和库7.2iLogic编程7.3运用API进行二次开发7.4和分析报告结论:通过本教程的学习,读者应该能够熟练掌握Inventor的基本功能和使用方法。
然而,Inventor是一款功能强大的软件,还有许多高级功能和技巧等待读者去探索和掌握。
希望本教程能够为读者提供一个良好的起点,帮助读者在Inventor的学习和应用中取得更大的成就。
重点关注的细节:3D建模3D建模是Inventor软件的核心功能之一,也是进行机械设计、建筑设计和产品设计的基础。
在Inventor中,3D建模不仅仅是创建一个静态的模型,还包括模型的编辑、参数化设计、装配和运动仿真等多个方面。
Inventor是一款广泛应用于三维CAD设计的软件,可以通过二次开发来扩展其功能。
将DWG 文件转换为PDF文件是Inventor二次开发的一种应用,以下是实现这一功能的基本步骤:准备开发环境:首先需要安装Inventor软件和Visual Studio开发环境。
确保安装了Inventor API,以便能够访问Inventor的对象模型。
创建Inventor应用程序:使用Visual Studio创建一个新的Inventor应用程序,该应用程序将用于调用DWG文件并将其转换为PDF文件。
引入必要的库和组件:在Visual Studio中,将Inventor库和必要的组件添加到项目中。
这包括Inventor库文件和相关的COM组件。
编写代码以读取DWG文件:使用Inventor API编写代码以打开和读取DWG文件。
您需要使用Inventor的文档管理功能来打开DWG文件并获取其内容。
将DWG内容转换为PDF格式:一旦读取了DWG文件的内容,您需要将其转换为PDF格式。
这可能需要使用第三方库或自定义代码来实现。
保存PDF文件:将转换后的PDF内容保存到磁盘上的文件中。
确保使用适当的文件名和文件类型,以便与其他应用程序兼容。
调试和测试应用程序:在完成基本框架后,进行测试和调试以确保应用程序能够正确地将DWG文件转换为PDF文件。
部署应用程序:最后,将应用程序部署到目标计算机上,以便其他人可以使用它来转换DWG 文件。
需要注意的是,这只是一个基本的概述,具体的实现细节可能会根据您的具体需求和开发环境而有所不同。
如果您不熟悉Inventor二次开发或DWG转换技术,建议参考相关的开发文档或寻求专业开发人员的帮助。
公司INVENTOR培训初级教程一、引言Inventor是由Autodesk公司推出的一款三维机械设计软件,广泛应用于产品设计和制造领域。
为了提高员工的专业技能和公司的竞争力,本教程旨在为公司员工提供Inventor软件的初级培训,帮助员工快速掌握Inventor的基本操作和常用功能。
二、Inventor软件概述1.软件界面:Inventor软件界面主要包括菜单栏、工具栏、浏览器、图形区域和状态栏等部分。
了解各个部分的功能和作用,有助于提高工作效率。
零件设计:创建和编辑三维零件模型;装配设计:将零件组合成装配体,进行干涉检查和运动仿真;工程图:和编辑二维工程图;表达视图:创建和编辑三维表达视图;渲染:为三维模型添加材质、灯光和背景,高质量渲染图像;分析:进行结构、热、运动等分析。
三、Inventor基本操作与常用功能1.基本操作:选择对象:使用鼠标左键选择对象,右键进行快捷操作;移动、旋转和缩放:使用鼠标和键盘进行视图操作;创建和编辑草图:绘制二维草图,为三维建模提供基础;创建特征:通过拉伸、旋转、扫掠等操作创建三维特征;编辑特征:修改特征参数,调整特征位置。
2.常用功能:参数化设计:通过修改尺寸参数,实现模型的快速修改;约束与标注:为草图添加几何约束和尺寸标注,确保模型精度;装配约束:在装配设计中,为零件添加配合约束,确保装配关系正确;工程图标注:为工程图添加尺寸、公差、注释等标注;表达视图制作:创建表达视图,展示产品内部结构和工作原理;渲染与动画:为三维模型添加材质、灯光和背景,渲染图像和动画。
四、Inventor实际应用案例1.零件设计案例:以一个简单的零件为例,介绍从草图创建、特征建模到工程图绘制的全过程。
2.装配设计案例:以一个装配体为例,介绍零件装配、干涉检查和运动仿真的操作步骤。
3.分析案例:以一个简单结构为例,介绍进行静力分析和动力分析的方法。
五、总结本教程为公司员工提供了Inventor软件的初级培训,通过学习本教程,员工可以掌握Inventor的基本操作和常用功能,为今后的产品设计工作奠定基础。
有关inventor ilogic与二次开发的书籍-回复题目:探秘inventor ilogic与二次开发的相关书籍引言:随着自动化技术的发展,许多设计工程师正在寻找更高效、更智能的方式来管理他们的设计流程,以提高工作效率。
在Autodesk Inventor软件中,iLogic是一种强大的工具,它允许用户通过编写脚本来自动化常规任务和设计过程。
对于想要进一步了解和掌握iLogic及其在二次开发中的应用的人来说,阅读相关书籍是一个不错的选择。
本文将为您介绍一些与inventor ilogic与二次开发相关的优秀书籍,并一步一步回答关于这方面的一些常见问题。
一、《iLogic与VBA编程案例教程》这本书是作者基于自身经验编写的一本iLogic与VBA编程案例指导书。
书中通过大量实例,详细介绍了iLogic与VBA编程语言的基础知识,使读者能够轻松上手并熟练运用。
此外,书中还提供了一些实用技巧和建议,帮助读者更好地利用iLogic和VBA进行二次开发。
对于初学者来说,这本书是入门的不二选择。
二、《Autodesk Inventor 2019中的iLogic编程》这是一本面向已经熟悉Autodesk Inventor 3D建模软件的用户的专业指南。
书中详细介绍了iLogic编程的各个方面,包括规则编制、表达式和条件、参数管理等。
此外,书中还提供了大量的示例和实战项目,帮助读者深入了解iLogic在实际设计中的应用。
无论您是初级还是高级用户,这本书都可以帮助您更好地理解和掌握iLogic编程。
三、《Mastering Autodesk Inventor 2020 and Autodesk Inventor LT 2020》这本权威的教程书籍涵盖了Autodesk Inventor 2020和Autodesk Inventor LT 2020软件的方方面面,并特别关注了iLogic编程的内容。
书中结合了实例和实际案例,向读者展示了如何使用iLogic编写规则、自动化任务和设计过程。
Inventor 二次开发学习指南作者:梁晓冬– Autodesk开发技术顾问Inventor作为Autodesk公司制造业旗舰产品,已经在三维领域得到了广泛的应用。
许多国内开发者迫切想学习Inventor API,学习如何应用到专业领域。
也有很多做设计的工程师,想借助API提高设计效率。
本文面向准备使用Inventor进行开发的读者,旨在提供一个新手学习指南,以及相关学习资料,视频,文档,例子。
每个人学习的速度和阶段不同,大家可根据自己的情况选取其中对你有用的内容(蓝色字体为对应资源下载或站点的链接)。
1.软件预备-Inventor 产品:可从Autodesk官方网站的Inventor产品目录下载试用版,或从该链接查看如何购买。
老一点的版本并不影响学习,但如果刚开始开发,建议用2012,2013,因为可用到最新的功能,如后面后提到的免注册插件机制。
-开发环境:本文建议用.NET开发(见第4点开发技能准备),因此需要Visual Studio 2008/2010或Visual Studio 2008/2010 Express。
-SDK(开发包): Inventor的SDK随产品安装(后面将详细介绍)。
2.学习三维设计概念或许你尚不知Inventor的功能和用途?或者尚不了解三维设计概念?在Autodesk University 和Autodesk University中国网站有大量教程。
下面选取几个,帮助学习三维设计的基本概念,例如,草图,特征,零件,装配,工程图等。
-籍Inventor及数字化样机, 打通设计与工程的任督二脉(英文):Autodesk 制造业部门资深副总裁Robert从最新的行业发展趋势到案例研究,介绍规模不同的制造企业如何依靠先进的技术在当今充满挑战的经济环境下保持竞争力。
-从AutoCAD迁移到Autodesk Inventor(中文): 展示如何充分轻松地从AutoCAD 迁移到Autodesk Inventor。
如何利用Inventor进行装船固定设计及二次开发发表时间:2020-12-24T06:42:08.631Z 来源:《建筑学研究前沿》2020年21期作者:倪红雨[导读] 随着海洋石油的不断发展,固定式导管架平台的适应水域的不断加深,由最初的几米、几十米增加至目前的百米直至两百米。
海洋石油工程股份有限公司天津 300461摘要:随着海洋石油的不断发展,固定式导管架平台的适应水域的不断加深,由最初的几米、几十米增加至目前的百米直至两百米。
作为平台基础部分的导管架重量也由几百吨猛增至几千吨甚至上万吨。
随着信息化,多元化时代的来临,大家在不拘谨于传统工艺、设计方法,在能够提供良好的信息支持与服务的同时,更在寻找更方便快捷的设计理念。
随着公司改革的深化,提升安装设计效率越来越重要,而装船固定设计参数化管理尤为凸显,更为重要。
关键词:参数化;三维设计;效率提升引言:参数化设计工作已经成为重要趋势之一,装船固定“管插板”参数化三维设计通过编程、调试、调整、应用,大大提高了安装三维设计工作效率,节省了大量人工成本。
“管插板”参数化三维设计,将复杂的三维设计简单化,其他工程师应用起来既简单又容易操作。
1.安装设计大型结构物装船固定形式 1.1“管插板”模式目前,安装设计大型结构物装船固定形式普遍应用“管插板”模式。
该模式不仅可以有效避免支撑管与结构物自身结构的干涉,又可以在满足计算强度的条件下优化设计减少现场施工工作量、节约施工周期等优势。
1.2“管插板”设计困难由于“管插板”的支撑管两端为插板结构且不同三维角度,对于安装三维设计来说较复杂:“管插板”中的支撑管和插板均为单独的个体,每一道支撑固定需要重新制作且不能被复制使用;结构物单体较多且经常会集中设计,三维建模工作量非常大;受船舶资源及方案变更的影响,“管插板”的固定位置会经常调整,每次调整都需要重新设计一次“管插板”模型,这无疑增加较多的人工时。
1.3“管插板”参数化优势“管插板”参数化三维设计是通过对“管插板”尺寸进行参数化管理,编辑一些关键尺寸作为可调参数,通过对关键尺寸数据的调整来关联其它相关尺寸,以达到快速调整“管插板”模型的目的。
Inventor 二次开发学习指南作者:梁晓冬– Autodesk开发技术顾问Inventor作为Autodesk公司制造业旗舰产品,已经在三维领域得到了广泛的应用。
许多国内开发者迫切想学习Inventor API,学习如何应用到专业领域。
也有很多做设计的工程师,想借助API提高设计效率。
本文面向准备使用Inventor进行开发的读者,旨在提供一个新手学习指南,以及相关学习资料,视频,文档,例子。
每个人学习的速度和阶段不同,大家可根据自己的情况选取其中对你有用的内容(蓝色字体为对应资源下载或站点的链接)。
1.软件预备-Inventor 产品:可从Autodesk官方网站的Inventor产品目录下载试用版,或从该链接查看如何购买。
老一点的版本并不影响学习,但如果刚开始开发,建议用2012,2013,因为可用到最新的功能,如后面后提到的免注册插件机制。
-开发环境:本文建议用.NET开发(见第4点开发技能准备),因此需要Visual Studio 2008/2010或Visual Studio 2008/2010 Express。
-SDK(开发包): Inventor的SDK随产品安装(后面将详细介绍)。
2.学习三维设计概念或许你尚不知Inventor的功能和用途?或者尚不了解三维设计概念?在Autodesk University 和Autodesk University中国网站有大量教程。
下面选取几个,帮助学习三维设计的基本概念,例如,草图,特征,零件,装配,工程图等。
-籍Inventor及数字化样机, 打通设计与工程的任督二脉(英文):Autodesk 制造业部门资深副总裁Robert从最新的行业发展趋势到案例研究,介绍规模不同的制造企业如何依靠先进的技术在当今充满挑战的经济环境下保持竞争力。
-从AutoCAD迁移到Autodesk Inventor(中文): 展示如何充分轻松地从AutoCAD 迁移到Autodesk Inventor。
有关inventor ilogic与二次开发的书籍-回复以下是关于inventor ilogic与二次开发的书籍的一篇1500-2000字的文章,一步一步地回答:在当今的工业设计领域,Autodesk Inventor是一款备受推崇的三维CAD 软件,广泛应用于各种行业,其中包括机械设计、汽车工程、航天航空以及消费品设计等。
为了满足不同用户的需求,Inventor还提供了一些高级功能,例如ilogic和二次开发。
ilogic是Inventor的一项强大的自动化工具,它允许用户通过创建规则和公式来自动执行各种操作。
通过ilogic,用户可以快速创建定制化的参数化模型,自动执行设计检查和确认,并自动应用标准和准则。
此外,ilogic 还可以与其他自动化工具(如Excel)进行集成,实现更高级的数据交互和处理。
对于那些希望深入了解ilogic的用户,有很多书籍可供选择。
以下是几本值得一读的书籍:1. "Autodesk Inventor 2021: Introduction to Solid Modeling"(英文版)- Randy Shih(ISBN:978-1-63057-348-1)这本书是一本综合介绍Autodesk Inventor的教材,其中包含了ilogic 的基础知识。
它提供了丰富的实例和演练,帮助读者逐步掌握ilogic的基本操作和功能。
此外,书中还介绍了二次开发的基础概念,为读者提供了进一步拓展和实践的机会。
2. "iLogic in Autodesk Inventor: The Complete Guide"(英文版)- Scott Hansen(ISBN:978-1-63057-343-6)作为ilogic的高级用户指南,这本书详细介绍了如何使用ilogic进行更复杂的自动化和定制化操作。
它深入探讨了ilogic的各种特性和选项,并提供了大量的示例和案例研究,以帮助读者解决实际工作中遇到的问题。
二次开发培训教程一、引言二次开发是指在已有软件的基础上进行功能扩展或改进,以满足用户特定需求的一种开发模式。
在实际的软件开发过程中,二次开发可以大大提高软件的定制性和适用性,同时也能为软件的推广和应用提供更多的可能性。
因此,二次开发技能已经成为了软件开发领域中必不可少的一部分。
本教程将介绍二次开发的基本概念、工具、技术和实现方法,帮助读者快速入门并掌握二次开发的相关技能。
二、二次开发的基本概念1. 二次开发的定义二次开发是指在原有软件基础上进行功能扩展或改进的一种软件开发方式,常用于定制化开发或适应特定需求的软件开发过程中。
2. 二次开发的分类根据二次开发的目的和方式,可以将其分类为插件开发、定制化开发和接口开发等几种类型。
其中,插件开发通常是指通过开发插件或扩展,为原有软件增加新的功能或功能模块;定制化开发则是指根据用户特定需求对软件进行定制开发,满足用户个性化需求;而接口开发则是指通过开发接口或SDK,实现与其他系统的集成或对接。
三、二次开发的工具和技术1. 二次开发的常用工具常见的二次开发工具包括IDE(集成开发环境)、文本编辑器、调试工具、版本控制工具等。
在实际开发过程中,可以根据具体的开发需求和技术框架选择合适的开发工具。
2. 二次开发的常用技术常见的二次开发技术包括脚本语言、面向对象编程语言、Web开发技术等。
在实际开发过程中,可以根据具体的开发需求和软件架构选择合适的开发技术。
四、二次开发的实现方法与步骤1. 了解原有软件结构在进行二次开发之前,首先要了解原有软件的结构和功能,包括核心模块、接口和数据交互等,以便确定二次开发的具体目标和范围。
2. 确定二次开发需求根据用户的具体需求和软件的现状,确定二次开发的具体需求和目标,明确二次开发的功能模块和实现方式。
3. 选择合适的开发工具和技术根据二次开发的具体需求和软件的技术框架,选择合适的开发工具和技术,为二次开发提供技术支持和开发环境。
Inventor二次开发入门Inventor二次开发入门 (1)课程1:开始接触InventorAPI,用写一个最简单的插件,实现选择集的隐藏 (2)课程2:帮助了解VisualStudio编程环境以及基本需要熟悉的方面 (12)课程3:深入解释课程1里出现的InventorAPI相关代码,帮助了解相关对象 (25)课程4:学习简单的带界面程序,了解其中的逻辑,以及如何操作选择集 (35)课程5:操作对象的附着属性(Attributes) (45)课程6:基于前面课程,制作一个更加丰富的插件 (61)课程7:深入学习的建议 (70)课程1:开始接触InventorAPI,用写一个最简单的插件,实现选择集的隐藏在本课中,你将开始写一个使用Autodesk Inventor API基于隐藏所选组件的应用程序。
演示视频(英文)演示代码lesson1_vb-net.zip (zip - 49Kb)lesson1_c-sharp.zip (zip - 73Kb)根据步骤来创建你的第一个插件1. Launch the Visual Basic Express development environment:Open Visual Basic 2010 Express using the Windows Start menu, selecting AllPrograms, then Microsoft Visual Studio 2010 Express, and then MicrosoftVisual Basic 2010 Express. Note: You can also use Visual Basic 2008 Expresswith this guide. Projects for both 2010 and 2008 are provided.2. Open a class library project:Inside Visual Basic Express, on the File menu, click Open Project. Navigate tothe subfolder of the supporting material you downloaded at the top of this guidecalled lesson1_VisualExpress2010 and open the project contained within it by selecting the project file MyFirstInventorPlugin_Lesson1.vbproj.3. Open the code:In the open project you will see a form with one button (if you don‟t see the Form, click on Form1.vb in the Solution Explorer frame in the upper right hand side).Right click on Form1 in the Solution Explorer and select View Code or justdouble click on the Form.4. Add the code:In the code window, type the code below into the Sub Button1_Click. (This is what runs when the button is clicked.) You may need to scroll down towards thebottom of the code to find the place to add the below code, looking for the words …Add code for Lesson 1 here‟.To get the full experience of developing with Visual Basic Express – including the use of features such as IntelliSense – we recommend you type the code from this guide rather than copying and pasting it.That said, if constrained for time you can also copy and paste into the Visual Basic Express code window, although this will reduce the experience you gain from working with the code directly.If _invApp.Documents.Count = 0 ThenMsgBox("Need to open an Assembly document")ReturnEnd IfIf _invApp.ActiveDocument.DocumentType <> _DocumentTypeEnum.kAssemblyDocumentObject ThenMsgBox("Need to have an Assembly document active")ReturnEnd IfDim asmDoc As AssemblyDocumentasmDoc = _invApp.ActiveDocumentIf asmDoc.SelectSet.Count = 0 ThenMsgBox("Need to select a Part or Sub Assembly")ReturnEnd IfDim selSet As SelectSetselSet = asmDoc.SelectSetTryDim compOcc As ComponentOccurrenceDim obj As ObjectFor Each obj In selSetcompOcc = objDebug.Print()compOcc.Visible = FalseNextCatch ex As ExceptionMsgBox("Is the selected item a Component?")MsgBox(ex.ToString())ReturnEnd Try5. Save the file:On the File menu, click Save All.6. Build the project:The code you have written is in human readable form. To make the code readable by a computer, you will need to translate it or “build” it.Inside Visual Basic Express, in the Debug menu, click Build Solution to compile and build your plug-in. The “Build Success” message shows in status bar of the Visual Basic Express window if the code is successfully built.That’s it! You have just written your first plug-in for Autodesk Inventor. Let’s run the plug-in to see what it does.Running the Plug-in1. Start Autodesk Inventor. (Note: When the plug-in is run it will start a new sessionof Inventor if one is not already open.)2. Create or open an existing Inventor assembly:Either unzip the file Clutch_Bell_Simplified.zip, and open theClutch_Bell_Simplified.iam assembly or within Inventor make sure you have anassembly of your choosing active. There are several types of document that canbe created or worked with inside Inventor. The most commonly used documenttypes are Part (.ipt), Assembly (.iam) and Drawing (.idw). Open a new assemblyand place some parts using the standard Inventor user-interface.3. Run your plug-in with Inventor and allow the plug-in to communicate withInventor:To make Visual Basic Express execute the code you have entered, select Start Debugging on the Debug menu (you can use the F5 key or click on the green arrow –which looks like a “play” button – on the Debugging toolbar). This will cause your form to be displayed. You may need to minimize VB Express to see both the form and Inventor.4. Work with the plug-in:Select one or more (by using the Ctrl key) components in the assembly that is active inside Inventor and then click Button1 on the form to execute your code and hide the selected components.5. To re-display the invisible components use the Inventor Assembly browser (youcan identify them via their component icons, which should now be grayed out). In the browser, right-click on the invisible components and pick Visibility, making them visible once again.Congratulations! You have just written your first plug-in for Autodesk Inventor. You will be reviewing the code in detail in Lesson 3.Before you move on to the next lessons, let us go back to some of the things we skipped over earlier, starting with basic concepts about programming, and the benefits it can bring to your day-to-day work.Additional TopicsIntroduction to ProgrammingThe code you have just executed that hides the selected components is only 30 lines long and more than half of the code that you entered into the project is doing error checking. The code that actually does the work can be narrowed down to these few lines of code:Dim asmDoc As AssemblyDocumentasmDoc = _invApp.ActiveDocumentDim selSet As SelectSetselSet = asmDoc.SelectSetDim compOcc As ComponentOccurrenceDim obj As ObjectFor Each obj In selSetcompOcc = objcompOcc.Visible = FalseNextAs you can see, a small amount of code can go a long way to simplify working with Inventor. Software programming allows you to capture the logic of a particular manual procedure once and then reap the benefits over and over again, every time you want to perform this functionality.What is Programming?A simple answer to this question is: Computer programming is the process of creating a sequence of instructions to tell the computer to do something. You can look at your program as a sequence of instructions. During the course of the upcoming lessons, you will look at the various lines and blocks of code in the context of being instructions for a computer.If you were to explain what computers are to a young child, you might say: a computer is a tool that follows instructions you provide. Programming is one way of giving instructions to the computer. Internally, a computer sees these instructions encoded as a series of numbers (also called machine code). The human-readable instructions you saw at the beginning of this lesson are called source code and the computer converts these instructions into machine code which it can then read and execute. A sequence of such instructions (or code), written to perform a specific task, is called a program and a collection of such programs and related data is called software. Autodesk Inventor is one such software product.Source code can be written in different languages, just as humans use different languages to communicate between ourselves. The language you will be using in this guide is called Visual ().What is an API?API is the acronym for Application Programming Interface: the way a software programmer can communicate with a software product. For instance, the Inventor API is the way programmers can work with Inventor, andestablishes what functionality a software programmer can use within Inventor. Such as the Inventor API allows you to write instructions for Inventor to execute one after the other.Putting this slightly differently: commercial software companies, such as Autodesk, often distribute a set of libraries that you can use in your own program to interact with a particular software product, such as Autodesk Inventor, and extend its functionality. This set of libraries is known as the software product’s API.The type of program you write to interact with a software product and extend its functionality will depend upon how the API has been designed and what has been exposed (through APIs) for you to work with.What is a Plug-in?A software plug-in is a type of program module (or file) that adds functionality to a software product, usually in the form of a command automating a task or some customization of the product’s behavior. When you talk about a plug-in for Inventor – and you will also hear the term AddIn or Application used for this product –we mean a module containing code that makes use of the Inventor API. The code can connect to Inventor to automate tasks, or be loaded by Inventor and used to adjust its behavior of Inventor under certain conditions, such as when a particular command is executed by the user of the plug-in.For terminology purposes, an Inventor AddIn would also be considered a plug-in. An AddIn is a special kind of plug-in that automatically loads when Inventor is started, has high performance and appears to the user to be part of Inventor..课程2:帮助了解VisualStudio编程环境以及基本需要熟悉的方面In the previous lesson, you saw how you can increase productivity in Autodesk Inventor by implementing a plug-in built from a small amount of code.You will probably have heard the terms COM and .NET from Lesson 1 with reference to programming with Inventor. Both COM and .NET are technologies that enable communication between software: if you are interested in learning more, you will find information in the Additional Topics section here.You will now look more closely at what happened when you executed the code in the previous lesson.代码示例lesson2_vb-net.zip (zip - 19Kb)lesson2_c-sharp.zip (zip - 23Kb)What does it mean to “build” code?The code that you typed in to Visual Basic Express in Lesson 1 was a set of human-readable instructions (source code) that needed to be converted into code that could be understood and executed by the computer. The “build” you performed did just that: it p ackaged up the resulting executable code inside a standard Windows EXE file. It’s also possible to create a DLL (Dynamic-Link Library) that can be loaded into Autodesk Inventor, but that’s a more advanced topic not covered by this guide.The following screenshot shows the output EXE along with the associated program debug database (which provides additional information when troubleshooting the EXE), once you have built the solution in Lesson 1 using Visual Basic Express. The path to which the EXE gets compiled is specified in the Visual Basic Express project settings and is set, by default, to the bin sub-folder of the Visual Basic Express project folder.Choosing a Programming Language and Development ToolJust as humans use different languages to communicate, you have various language options available to you when creating an Inventor plug-in: for the purposes of this guide we have chosen Visual Basic .NET (), a strong general-purpose programming language that is popular with Inventor developers.There are a number of tools available for developing code. They range from open source tools such as SharpDevelop to Microsoft’s flagship, professional development environment, Visual Studio. In your case you will be using Visual Basic Express, a free version of Visual Studio focused on building applications.Visual Basic Express is an Integrated Development Environment (IDE) because it is composed of various tools, menus and toolbars which ease the creation and management of your code.The project system in Visual Basic Express comprises Solution and Project files as well as Project Items, the individual files belonging to projects.A solution is a container for one or more projects. Each project can inturn be considered a container for project items –such as source files, icons, etc. – most of which get compiled into the resultant executable file (EXE or DLL). Visual Basic Express provides a Solution Explorer that organizes and displays the contents of the loaded solution in a tree-view format:The Visual Basic Express interface also contains a text editor and an interface designer. These are displayed in the main window depending on the type of file being edited. The text editor is where you will enter the Visual Basic code for your Inventor plug-in. This editor provides advanced features such as IntelliSense and collapsible code sections along with the more classic text-editing features such as bookmarks and the display of line numbers.IntelliSense is an extremely valuable feature of the Visual Studio family that greatly improves programmer productivity: it automatically provides suggestions for the code being written based on the objects available and the letters that are being typed. IntelliSense showing the methods and properties for a ComponentOccurrence:Clearly one of the key features of Visual Basic Express is its ability to build code into an executable file. During the build process, the language compiler performs various checks and analyses on the code. One such check is to ensure the code conforms to the syntactical rules of the Visual Basic language. The compiler also performs various other checks, such as whether a variable has been appropriately defined or not. Detected errors are reported via the Error List Window, typically found at the bottom of the main window. The Error List can be displayed by selecting Error List from the View menu > Other Windows.The Visual in Visual Basic ExpressOne of the main strengths of Visual Basic Express is its set of tools for creating a User Interface. When you create a new project you can select a Windows Forms Application. When this template is used, the main window for the application is automatically created. This window is called a form and you can place user interface elements (called controls), such as a command buttons, on it. You add an element simply by selecting it in the Toolbox and then clicking and dragging it onto the Form. The Toolbox can be displayed using the View menu> Other Windows > Toolbox. Much of the code to make these elements work correctly gets added automatically to the project, greatly reducing the effort needed to get your application up and running.Reviewing your use of Visual Basic ExpressIn this section, you will create a blank project similar to the one you were provided in Lesson 1. This project will be the starting point for Lesson 3.1. Create a Windows Forms Application:Close the project from Lesson 1, if it is still open in Visual Basic Express, and then on the File menu, click New and then select New Project.This will open up a new dialog called New Project in which you have the option to select the template that will be used to create the plug-in application.As you are working with Visual Basic Express, your installed templates are under the Visual Basic category.In the center of the dialog, you can see various application templates that are available to you, the choice of which depends on the type of application you wish to create. As you‟re creating a simple, standalone EXE wit h a dialog-based user interface, select the “Windows Forms Application” template.You now need to select a name for your project. Enter MyFirstInventorPlug-in in the box near the bottom of the New Project dialog and select OK: The basicsolution containing your project should now be created and loaded into the Visual Basic Express editor.2. View the references:By default your blank project was created containing a few standard projectreferences to core .NET components. You can see these references byright-clicking the project in the Solution Explorer and selecting Properties. In the Properties window select References.Along with the standard references, a blank VB form is created and added to the project. It‟s this form that gets displayed in the text editor window, Form1.vb.Forms have two views, Design and Code: you can switch between the two views by right-clicking on Form1.vb in the Solution Explorer and selecting View Code or View Designer.3. Add references:So far you have created a blank Windows Forms Application project usingVisual Basic Express.This blank Windows Forms Application project, as created by Visual BasicExpress, does not automatically make use of the Inventor API. For it to do so, you need to add a project reference to the interface DLL in Inventor describing itsAPI, Autodesk.Inventor.Interop.dll.In the Solution Explorer, right-click the project and choose AddReference. Click the Browse tab in the Add Reference dialog and navigate to a location such as this beneath the installed location of Inventor on your system: o C:\Program Files\Autodesk\Inventor 201x\Bin\Public AssembliesSelect Autodesk.Inventor.Interop.dll and then OK.The Inventor API has now been referenced into your project.4. View Object Browser:Before proceeding further, let‟s use the Object Browser in Visual Basic Express.The object browser is a tool that can help you understand how to use the objects in the Inventor API. Once you have referenced the Inventor API(Autodesk.Inventor.Interop.dll) in your project its objects can be displayed in the Object Browser. The Object Browser is a dialog containing a tree showing how various components‟ objects are organized. As well as using the tree to browse the hierarchy, you can also search on the name of an object to access it directly.Once you have the object displayed and selected in the left pane of the tree view, you can see its methods and properties in the right pane. In the screenshot below,the Application object is selected in the left pane and its ActiveDocument property is selected in the right from among the object‟s various properties and methods.Try selecting other properties to see their details.Note:To display the Object Browser go to the View menu and select it. If “Object Browser” is not available on the View Menu then go to the Tools Menu, click on “Settings” and then select “Expert Settings”. Also by default the function key “F2”will display the Object Browser. (In both Expert and Basic settings).5. Ready to add Inventor API code:You‟re now ready to use the Inventor API by entering code in Visual Basic Express.In other words, to provide instructions telling Inventor how to perform certaintasks.6. Build the project:While developing code, it‟s a good idea to build the solution, from time to time, to check whether errors have been introduced in the code. The code does notnecessarily have to be complete or functional when building the solution. Thisapproach can help avoid potentially lengthy troubleshooting once the code iscomplete, and has the side benefit of automatically saving any edited source files before the build starts.To build a solution inside Visual Basic Express, select Build <ProjectName> from the Debug pull-down menu.Tip: As a shortcut, you can use the Function key …F6‟ to directly build the solutionwithout accessing the menu.If the build was successful, you will see Build Succeeded in the status bar at the bottom-left corner of the Visual Basic Express interface.7. Save the file:On the File menu, click Save All. Saving the solution creates physical filesrepresenting the contents of your class library project on your computer‟s harddrive, allowing you to open and edit it at another time in the future.A quick recap: in this lesson you took a brief look at what happens when you build a project, as well as some background information on and Visual Basic Express. You then spent some time creating a brand new Windows Forms Application project in Visual Basic Express, adding the required project reference for it to be able to use the Inventor API.Additional TopicsVisual Basic Express vs. Visual Studio ProfessionalIn this guide, you are using Visual Basic Express. This is a free version of Visual Studio and a great tool to help you start writing and managing Visual Basic code for your Inventor plug-in without the need for an additional software investment. Microsoft has targeted the Express editions of Visual Studio at students, hobbyists and other part-time programmers. While they provide most of the features of Visual Studio Professional, such as IntelliSense, they do have certain limitations. For instance, Visual Basic Express contains fewer project templates and has limited options for debugging and troubleshooting your code. If you are serious about plug-in development beyond this introductory guide, we recommend investing in one of the more fully-featured members of the Visual Studio product family.What is COM?“Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. COM objects can be created with a variety of programming languages. Object-oriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects.” Source: MSDN LibraryCOM is the underlying API technology used by older versions of Visual Basic, including Visual Basic for Applications (VBA). While some Windows application developers have exposed .NET interfaces to their software, others have continued to invest in their COM interfaces, as these can also be called from .NET applications (see below for further information).What is .NET?The .NET Framework is a software framework that sits on top of the Microsoft® Windows® operating system* and provides the underlying platform, libraries and services for all .NET applications. The services generally include memory management, garbage collection, common type system, class libraries, etc.* Subsets of .NET are also available on other operating systems, whether via the open source Mono project or via Micr osoft® Silverlight®, but these are not topics for this guide: you will focus solely on the use of .NET in the context of Microsoft Windows.What does the .NET Framework Contain?The framework contains two main components:1. Common Language Runtime (CLR)–This is the agent (or execution engine) inthe .NET Framework responsible for managing the execution of code. Which iswhy code written to target this runtime is also known as managed code. Allmanaged code runs under the supervision of the CLR, but what does this mean?The CLR manages code by providing core services such as memory management(which includes automatically releasing the computer‟s memory for reuse on othertasks when it is no longer needed), error (or exception) handling, managing theuse of multiple threads of execution and ensuring rules around the use of differenttypes of object are adhered to. The CLR is really the foundation of the .NETFramework.2. .NET Framework Class Library–As the name suggests, this is a library orcollection of object types that can be used from your own code whendeveloping .NET applications. These .NET applications are targeted for Windows(whether command-prompt based or with a graphical user interface), the web ormobile devices. This library is available to all languages using the .NETFramework.As mentioned above, the CLR improves code robustness by making sure the executing code conforms to a common type system (CTS). The CTS ensures that all .NET (or managed) code – irrespective of the language – uses a similar set of object types and can work together in the same environment. It is this feature that makes it possible for you to write applications in the development language of your choice and yet make use of components/code written by programmers using other .NET languages.Building ExecutablesWhen you built your code into an EXE, it was compiled into Common Intermediate Language (CIL – also known as MSIL) code using the language-specific compiler. CIL is a CPU-independent set of instruction that can be executed by the CLR on Windows operating systems. CIL is typically portable across 32- and 64-bit systems and even –to some extent –to non-Windows operating systems. The CIL code generated from your VBsource code was then packaged into a .NET assembly. Such an assembly is a library of CIL code stored in Portable Executable (PE) format (which contains both the CIL and its associated metadata). Assemblies can either be process assemblies (EXEs) or library assemblies (DLLs).During the course of this guide, you will focus on developing a particular type of Inventor plug-in: a process assembly (EXE) which communicates with Inventor. Because of the overhead associated with developing them, you will not spend time looking at Inventor AddIns, which are usually library assemblies (DLLs) that get loaded into and executed within the memory space of Inventor. One reason that implementing an EXE to work with Inventor is simpler than developing an AddIn is related to its user interface: Executables do not need to integrate seamlessly with the Inventor user interface by adding ribbon buttons (for instance).Running ExecutablesDuring execution of a .NET assembly, CIL(residing in the assembly) is passedthrough the CLR’s just-in-time (JIT)compiler to generate native (ormachine) code. JIT compilation of theCIL to native code occurs when theapplication is executed. As not all ofthe code is required during execution,the JIT compiler only converts the CILwhen it is needed, thus saving time andmemory. It also stores any generatedcode in memory, making it available forsubsequent use without the need torecompile.In the last step of this process, thenative code gets executed by thecomputer’s proce ssor.If you would like more details on theprocess of building .NET applications,please refer to the MSDN Library.课程3:深入解释课程1里出现的InventorAPI相关代码,帮助了解相关对象示例代码lesson3_vb-net.zip (zip - 24Kb)lesson3_c-sharp.zip (zip - 24Kb)Add code to the project you created in Lesson 2In Lesson 2 you created a project and it referenced the Inventor API via Autodesk.Inventor.Interop.dll. Adding this reference to the Inventor API allows you to start using it in your project. In the following steps you will access the top level object in the API, the Inventor.Application object.1. Open Lesson 2 class library project:Open the project you created in Lesson 2 and type the following lines of code tothe Form1.vb code window (above “Public Class Form1”). You can display thecode window by right-clicking on Form1.vb in the Solution Explorer andselecting View Code. To make room for the code, place the cursor to the left ofPublic Class and press the Enter key a few times to add some blank lines at thetop of the code window.2.Imports System3.Imports System.Type4.Imports System.Activator5.Imports System.Runtime.InteropServicesImports InventorKeywordsWhen you look at the code above, one of the first things you‟ll notice is the coloring: for readability, Visual Basic Express changes the color of certain words in the code. Words highlighted in blue are known as keywords, which can only be used in certain situations. You would not be able to declare a variable named Imports, for instance, as it is reserved to mean something very specific.NamespacesThe first few lines of code start with the Imports keyword. When working with different components and APIs in your Visual Basic project, it‟s quite common for classes to share the same name - there might be multiple versions of the Point class in different libraries, for instance. To avoid naming conflicts, .NET provides。