外文资料翻译.pdf_第1页
外文资料翻译.pdf_第2页
外文资料翻译.pdf_第3页
外文资料翻译.pdf_第4页
外文资料翻译.pdf_第5页
已阅读5页,还剩6页未读 继续免费阅读

外文资料翻译.pdf.pdf 免费下载

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论