文档简介
CATIA V5 Automation CATIA V5 Automation if ( CATIA = null) CATIA = WScript.CreateObject(“CATIA.Application“); CATIA.Visible = true; BoltJavaSript.js example Have a look on the source code. To run the “BoltJavaScript.js” example, you can doubleclick on it. To run the example on a Command prompt Window you can also use : Cscript BoltJavaScript.js Or wscript BoltJavaScript.js Out-Process in HTML (NT & Microsoft Internet Explorer Only) In HTML, you can include VBScript or JavaScript routines.Microsoft explorer provides ActiveXObject (in JavaScript) and CreateObject (in VBScript) functions to Launch Automation Servers.So, it is possible to call CATIA V5 this way.You can access to the Microsoft Development Environment to debug your Application.You can launch the “Microsoft Development Environment from Explorer by :“Script Debugger” “ Open” Out-Process in HTML with VBScript Load the “BoltVBScript.html” example in Microsoft Internet Explorer. You will be able to Click on the “Bolt” button to create a Bolt in CATIA V5. You can view the source code by + menus. Due to security reasons, some warning messages for running the script, may appear depending on the configuration and if the server is local or not. Out-Process in HTML with JavaScript Load the “BoltJavaScript.html” example in Microsoft Internet Explorer. You will be able to Click on the “Bolt” button to create a Bolt in CATIA V5. You can view the source code by + menus. About Objects, Collections, Properties and Methods Scripting languages such as Visual Basic rely on objects. With CATIA, documents, windows, viewers, parts, sketches, pads, even lines and curves are represented as objects in Visual Basic. Object: an entity. Ex: Document, Pad, Line, Property: a characteristic of an object. DocName = CATIA.ActiveDocument.FullName Method: an action on an object CATIA.ActiveDocument.SaveAs “MyNewName” Collection: a list of objects. The CATIA collections index begins at 1, and not 0 : For i=1 to CATIA.Documents.Count msgbox CATIA.Documents.Item(i).Name Next We can also access a collection with the name of the object: Example: msgbox CATIA.Documents.Item(“Product1.CATProduct“).Name We add objects to the collections with the method add : set myPartDoc = CATIA.Documents.add(“Part“) About Inheritance and Aggregation There are two kinds of relations between objects : Inheritance helps you to specialize objects while gathering common properties and methods. Aggregation is the ability of an object to contain another one. In the following diagram, the Application aggregates the Documents collection.The PartDocument object is a specialized document that is dedicated to parts and which inherits the properties and the methods of the Document object. Scripting Infrastructure features overview Documents and Windows The CATIA Application object aggregates two main collection objects : Documents and Windows. The Documents collection aggregates any number of Document(s) since the multiplicity is set to *. The Document object is an abstract object, and only its derived type can actually be created, that is the PartDocument, ProductDocument and DrawingDocument. The Windows collection aggregates number of Window(s), which themselves aggregate one Viewers collection which aggregates any number of Viewer(s).The binary association between the Window and the Document objects means that the Document object is the parent of the Window object. Infrastructure Object Architecture These objects are shared by all CATIA products. The root object is the Application, which aggregates or includes Documents and Windows. Application and Document Application is the Root object for all CATIA macros. This correspond to the CATIA frame window.The CATIA application is always named CATIA for in-process macro. The Documents collection provide a method to Add a new document and another to Open an existing document. A Document can be a PartDocument, ProductDocument or a DrawingDocument. Each Document provide Its own methods to Save or SaveAs Itself. Creating and Opening a Document Creating a new Document : Dim Doc as Document Set Doc = CATIA.Documents.Add(“Part”) ? create a PartDocument Instead of “Part”, Use “Product” for a Product Docum
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023年玉溪辅警协警招聘考试真题附答案详解(精练)
- 2023年西双版纳州辅警招聘考试真题附答案详解(培优b卷)
- 2023年葫芦岛辅警招聘考试题库附答案详解(b卷)
- 2024年临沧辅警协警招聘考试真题及答案详解(各地真题)
- 2023年盘锦辅警招聘考试题库附答案详解(研优卷)
- 2024年山南辅警招聘考试真题附答案详解(预热题)
- 2023年鄂尔多斯辅警协警招聘考试备考题库及答案详解(夺冠)
- 2023年荆州辅警招聘考试题库含答案详解(综合卷)
- 2024年乐山辅警招聘考试题库及答案详解(典优)
- 2024年三明辅警协警招聘考试真题附答案详解(黄金题型)
- 国开电大2025秋《形势与政策》大作业参考答案 一
- 上海莘光学校七年级下册数学期末试卷测试卷附答案
- 2025-2030钙钛矿光伏组件回收技术路线
- 2025年度北京市公务员录用考试行政职业能力测验试卷真题及答案
- 打造狼性团队培训课程
- 新能源汽车企业财务风险分析及防范研究-以北汽蓝谷为例
- 2025年驾照恢复考试题库(附答案)
- 销售周汇报管理办法
- 2024光伏发电站设计标准
- 安全生产管理:企业主要负责人落实“十个一次”执行计划
- 企业智能司库系统的构建与应用实践研究
评论
0/150
提交评论