




文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 第十九章 生态系统说课稿-2025-2026学年初中生物学苏教版八年级上册-苏教版
- 足球一 说课稿 -九年级体育与健康
- 中医研究生试题及答案
- 福建省福州第十八中学2024-2025学年七年级下学期期末考试历史试题(无答案)
- 2024-2025学年山西省吕梁市孝义市九年级(上)期末数学试卷(含部分答案)
- 公积金贷款房产抵押及第三方担保机构合作合同
- 担保合同无效与担保物权法律后果
- 网红店铺装修补贴申请与执行协议范本
- 过敏性鼻炎的季节性防护
- 福州商圈调查报告
- 网络安全课件下载
- “城镇可持续发展关键技术与装备”重点专项2024年度项目申报指南(征求意见稿)
- 铜仁市大学生乡村医生专项计划招聘考试真题
- 光伏项目投标方案(技术方案)
- 模块化炼化设备的设计与集成
- 光伏发电功率预测系统
- HY/T 0404-2024潮流能、波浪能发电装置海试过程控制规范
- 设备维护服务方案(2篇)
- 医院检验科实验室生物安全程序文件SOP
- 手术前术前准备未执行的应急预案
- JJG 270-2008血压计和血压表
评论
0/150
提交评论