2023年11月30日发(作者:)

中英文对照外文翻译

中英文资料对照外文翻译文献综述

附件1:外文翻译译文

CATIA V5 的自动化

CATIA V5的自动化和脚本:

NT Unix上:脚本允许你用宏指令以非常简单的方式计划CATIACATIA

使用在MS VBScript(V5.x中在NTUNIX3.0 )的共用部分来使得在两个平台

上运行相同的宏。

NT 平台上:自动化允许CATIAWord/Excel或者Visual Basic程序那样

与其他外用分享目标。ATIA 能使用Word/Excel对象就像Word/Excel能使用CATIA

对象

Unix 平台上:CATIA将来的版本将允许从Java分享它的对象。这将提供在

Unix NT 之间的一个完美兼容。

CATIA V5 自动化:介绍(仅限NT)

自动化允许在几个进程之间的联系:

CATIA V5 NT :接口COMVisual Basic 脚本(对宏来说)Visual Basic

为应用(适合前:Word/Excel )Visual Basic

COM(零部件目标模型)是“微软“标准于几个应用程序之间的共享对象。

Automation 是一种“微软“技术,它使用一种解释环境中的COM对象。

ActiveX 组成部分是“微软“标准于几个应用程序之间的共享对象,即使在解

释环境里。

OLE(对象的链接与嵌入) 意思是资料可以在一个其他应用OLE的资料里连结并

且可以被编辑的方法(在适当的位置编辑)

VBScriptVBAVisual Basic之间的差别:

中英文对照外文翻译

Visual Basic(VB) 是全部的版本。它能产生独立的计划,它也能建立ActiveX

和服务器。它可以被编辑。VB中提供了一个补充文件名为“在线丛书“VB5.0

VBA(应用的Visual Basic)是一个Visual Basic的子集。VBA是在诸如Word

ExcelCATIA的应用托管。它提供了一个用编辑器,调试器,一个帮助对象查看

器和完整的环境。该+< REFERENCE>菜单允许申报使用的对象库。这使得可

以访问结果和对象浏览器。VBScript(Visual Basic脚本)是一个VBA的子集。简单

的语言解释基本法可以调用CATIA对象。没有类型被使用。系统动态地尝试调用方

法和对象的属性。(后期绑定通过他们的IDispatch接口调用对象)

支持的语言

CATIA 支持的语言是:

CATScript :它是在V5的脚本语言,直到包容V5R7。从V5R8,它变得过时,

并建议使用MS VBScript MS VBA

MS VBScript:它是从V5R8首先使用的语言,唯一的解决方案是允许有一个在

NTUNIX可移植的脚本。MS - VBScript不同于CATScript的是,这个概念在模

糊地声明一个X变量为Y不存在。

MS -VBAVBA是一个集成到CATIA和专用于VB的开发环境,但只在NT上。 MS

- VBA不同于MS- VBScript的是编程的舒适性和实现简单图形界面的应用可能性。

面板ActiveX可以加入一个宏,但是只在NT 上。

如“stemObject“的其他服务被称为“CreateObject“,并只在

NT中可用。

对象类型的声明记录在宏里(即使它不是在VBScript中使用),但它可以帮助

你(在VB中与在NT上填写)计划你未来的应用。

CATIA V5的文件扩展名链接

CATIA V5中双击打开Windows资源管理器的“。CATPart“文件。在NT上,

如果没有运行CATIA V5,它会自动启动。

CATIA V5的脚本功能

在过程中的应用:

这是在CATIA菜单的工具+宏中进行。当宏运行时,CATIA停用。你不能在两个

调用间存储一个宏变量。使用VBScript(微软)和VBA访问Windows NT和使用

VBScriptWinsoft)访问Unix

中英文对照外文翻译

输出过程中的应用(仅限NT)

这基于自动化。一个外部过程可以调用CATIA,创建或修改几何,解码,测量

或试验CATIACATIA仍然运行。对于应用程序的每个动作,我们要检查是否CATIA

在良好的状态同步两个进程。这种应用可以被发展在:

Visual Basic

Windows Scripting Host(VBScript,JScript)Windows Explorer

HTML(VBScriptJScript)或者任何其他COM 应用。在将来,V5自动化对象的Java

封装也将被提供。这将促使在NT和基于JavaUnix上应用软件的开发,无论是

在输入进程和输出进程。

宏进程

我们在加工过程中调用它,因为该脚本的解释在与CATIA相同的过程里进行。

一个列表显示了可用的宏。我们可以运行,编辑,重命名或删除现有的脚本,或创

建一个新的。上述小组建议的脚本库的列表是可以通过对库的一个窗口进行修改

的。利用CATIAVisual Basic编辑器,我们可以编辑现有的宏或创建一个新的,

插入图形形式,调试和运行VBA项目。

对话框的界面“工具++...“允许选择一个宏(一个宏目录或一个VBA

目)或一个我们希望工作的文档库上。

从这个窗口,我们可以关闭已打开的库,开放一个库,或建立一个库。库是按

类型显示(目录,VBA项目)

每库类型支持不同的语言。VBA 只支持语言MS -VBA,当在一个目录里时,而

在目录中,我们可以写在MS- VBScript或在CATScript

录制宏

该记录的VBA面板允许我们选择将记录的容器,使用的语言和宏的名字被记录。

所录制的脚本的语法是要根据不同的菜单中选择。录制宏生成一个对应创建或修改

对象的脚本再记录序列里。停止录音后,我们可以存储,编辑重放这个脚本(称为

宏)。作为一项规则,记录一个宏可以帮助你学习如何编程的东西。

运行宏

CATIACNEXT -macro

E:ipt

CATIACNEXT -batch -macro

中英文对照外文翻译

E:ipt

你可以以交互方式从“宏“菜单中运行宏,你可以以交互方式从一个工具栏图

标中运行宏。

来自另一个宏的宏的实行

CATIA V5R9通过自动化功能提供能力从另一个宏中执行宏。该功能可以让用户

调用另一个脚本函数,在另一个宏库中,可能在另外一种脚本语言编写。一个支持

ENUM CATSys库类型是用来让开发人员介绍库那种要调用的函数包含所在。(来自

VBScript的例子)

调用一个在确定的“E数学”目录库里的新增功能,文件中的“整数

“,一种将写成:

Dim args2(1)

args2(0) = 3

args2(1) = 2

Dim addResult

addResult = eScript ( "E:MacrosMath",

catScriptLibraryTypeDirectory, "", "Add", args2 ) MsgBox

addResult

要调用一个PrintReport在一个确定的子的“E零件 tV5

文档库文件中的““,一种将写成:

Dim args()

eScript

"E:t",catScriptLibraryTypeDocument,"

tvbs", "PrintReport", args

在工具条里增加一个作为命令的宏

选择你要添加自定义的工具和宏命令标签页的宏,拖放宏的名称到你想要的工

具栏,要选择另一个默认的图标,单击显示属性。

宏选项界面

对话框“工具+选项+宏“的面板允许根据语言选择,编辑器将被推出来编辑宏,

并且指定外部类库来考虑到脚本回放。Whith新接口,运行时间意见的全部typelibs

V5被自动考虑到。除运行时间意见(例如优于)之外,这种选择只为宣布typelibs

中英文对照外文翻译

务。

运行输出进程方案(只在NT)

该脚本是在另一个运行在另一个进程中的应用程序中运行,例如:Visual Basic

VBA( Excel Word)使用VBScriptJavaScriptWSHWindows脚本主机)

使用VBScriptJavaScriptHTMLCATIA可以从任何其他COM应用编写脚本。

VBA或者Visual Basic运行输出进程

VBAVisual Basic提供有用的工具:对这来说,你可以声明所有由Dassault

Systèmes提供的类型库文件(*. TLB。该类型库文件包含所有对象,方法和公开

对象属性的声明。类型定义允许的类型检查和“早期绑定“帮助完成给你所有属性

和对象的方法,给你一个方法的参数类型。浏览器对象描述了全部的出口对象。

下面是从VBAVisual Basic来启动CATIA V5的语句。

如果CATIA已经运行:

[...]

Dim CATIA as Object

Set CATIA = GetObject(,ation)

[...] 第一个参数。为空白

如果CATIA没运行:

[...]

Dim CATIA as Object

Set CATIA = CreateObject(ation)

e = True

[...] 这个宏开始CATIA

如果类型库被引用,我们可以作为ation声明CATIA

使用Windows脚本宿主来运行输出进程

WSH支持用不同语言编写,如VBScriptJavaScript脚本。你可以使用标准

的编辑器来编写应用程序。如果你的程序失败,你将可以使用Windows开发环境。

它可以在Visual Basic开发应用程序,然后评论类型和通过WSH运行它。要运行

一个VBScript*. vbs的)或JavaScript*. js)文件,你可以使用CScript

Wscript命令。通常情况下,已经与这些扩展名相关。

Windows脚本宿主的VBScript

中英文对照外文翻译

你可以在一个简单的ASCII文本文件中用扩展名“vbs“为Visual Basic脚本

写一个VBScript程序。WSH对象Wscript也提供了GetObjectCreateObject

下面的代码启动CATIA V5

On Error Resume Next

Set CATIA = ect(,"ation")

If <> 0 Then

Set CATIA = Object("ation")

e = True

End If

例子:看一看源码。运行例子,你可以双

使Cscript

或者wscript

Windows脚本宿主的JavaScript

运用如VBScript中相同的方式,你可以在一个简单的ASCII文本文件中用扩展

js“为JavaScript写一个JavaScript 程序。 WSH,对象Wscript也提供了

GetObjectCreateObject。下面的代码启动CATIA V5

CATIA = ect(,"ation");

if ( CATIA == null) {

CATIA = Object("ation");

e = true;}

例子

看一看源码。要运行 例子,你可以双击它。要运行一个命

令提示符窗口的一个例子,你也可以使用:Cscript 或者

wscript

HTML输出进程(NT & Microsoft Internet Explorer )

HTML中,你可以包括VBScriptJavaScript例程。微软Explorer提供

ActiveXObject(在JavaScript)和CreateObjectVBScript中)函数来启动自动

化服务器。因此,它可以用这种方式调用CATIA V5。您可以访问Microsoft

Development 环境来调试应用程序。您可以通过“Script Debugger Open

来从Explorer环境启动“Microsoft Development“。

中英文对照外文翻译

HTML使用VBScript的输出过程

Microsoft Internet Explorer中载入““的例子。您可

以点击“螺栓“按钮,CATIA V5创建一个螺栓。您可以通过菜单+

查看源代码。由于安全原因,运行脚本的一些警告信息,可能会出现不同的配置并

且要是服务器是本地或者不是。

HTML使用Java脚本的输出进程

Microsoft Internet Explorer中载入““的例子。您

可以点击“螺栓“按钮来在CATIA V5创建一个螺栓。你能通过+

单查看源码。

CATIA V5的脚本

介绍

公开对象的体系结构,CATIA V5公开模式,使得在CATIA的工作台可以创建文

档,零部件,表面,线框,产品图纸和许多其他对象。那些公开对象提供属性和方

法来读取和修改现有的所有对象。在交互出现的所有对象,可以从宏或输出进程方

案编写脚本。

关于对象,集合,属性和方法

Visual Basic脚本语言依靠的对象。与CATIA,文件,窗口,浏览器,配件,

素描,垫...甚至直线和曲线表示为Visual Basic对象。

对象: 一个实体:例如:文件,填充,线。

属性:一个对象的特点。

DocName = me

方法:有一个对象的行动

yNewName

集合:对象列表。

CATIA 集合指数从1开始,而不是0

For i=1 to

msgbox (i).Name

Next

我们还可以访问该对象的名称集合:

例子: msgbox (" duct" ). Name

中英文对照外文翻译

我们用方法添加对象到集合:

set myPartDoc = ("Part")

关于继承和集中

在对象之间有两种关系:继承可以帮助你专注对象,而收集共同属性和方法,

集中是一个对象到包含另一个的能力。

在下面的图中,应用程序聚合Documents集合。PartDocument对象是一个专

门的文件,专于它继承属性的部件和文档对象的方法。

脚本基础设施功能概览

CATIA应用对象集合两个主要的集合对象:文件和Windows

因为多样性是设置为*文件收集了任意数量的文件。Document对象是一个抽象

的对象,只有其派生类型可以被创造,这是PartDocument,ProductDocument

DrawingDocument。在Windows收集了数量的WindowS)和它们本身并集了一个并

集任意数量浏览器的浏览器。窗口和文档对象之间的二进制关联意味着该文档对象

Window对象的上级。

应用程序和文档

应用程序是全部CATIA 宏的根对象。这对应于CATIA的框架窗口 CATIA应用

始终为进程宏命名CATIADocuments集合提供一个方法来添加一个新的文件,另

一个是打开现有文件。 一个文档可以是一个零件文档,产品文档或绘图文档。每

个文档提供它自己的方法来保存或自救。

中英文对照外文翻译

附件2:外文原文(复印件)

CATIA V5 Automation

CATIA V5 Automation & Scripting : Presentation

On both NT and UNIXThe scripting allows you to program CATIA in a very

simple way with macros on both NT and UNIX Use the common

part on MS-VBScript (v5.x on NT and v3.0 on Unix) to have the same macros

running on both platforms.

On NT platformsAutomation allows CATIA to share objects with other

external applications such as Word/Excel or Visual Basic can

use the Word/Excel objects as well as Word/Excel can use the CATIA Objects.

On UNIX platformsA future version of CATIA will allow to share its

objects from Java. This will provide a full compatibility between UNIX and

NT.

CATIA V5 Automation: Presentation (NT only)

Automation allows communication between several process.

CATIA V5 On NTInterfaces COMVisual Basic Script (for Macros)Visual

Basic For Applications (for ex:Word/Excel)Visual Basic

COM (Component Object Model) is the Microsoft standard to share

objects between several applications.

Automation is a Microsoft technology to use COM objects in an

interpreted environment.

ActiveX component is a Microsoft standard to share objects between

several applications even in an interpreted environment.

OLE (Object Linking and Embedding) means that the document can be linked

in the document of an other application OLE and can be edited in that other

application (In place editing).

Differences between VBScript, VBA and Visual Basic

Visual Basic(VB) is the full versionIt can generate independent

中英文对照外文翻译

programsIt can also create ActiveX and can be compiled. VB

provides an added documentation called Books on line (VB 5.0) VBA

(Visual Basic for Applications) is a subset of Visual BasicVBA is hosted

in applications such as Word, Excel or CATIA. It provides a complete

environment with an Editor, a debugger, a Help Object Viewer and Completion.

The + menu allows to declare the object library

gives access to the completion and the object

pt(Visual Basic Script) is a subset of interpreted

Basic language Can call CATIA type is used. The system tries

dynamically to call methods and properties of objects. (Late binding calling

objects through their IDispatch interface).

Supported Languages

The languages supported by CATIA are:

CATScript : It is the language of the scripting in V5 until the inclusive

V5R7. From the V5R8, it becomes deprecated and it is advised to use rather

MS VBScript or MS VBA.

MS-VBScript : It is the language to use first and foremost from the V5R8,

and the only solution allowing to have a portability of the scripts in NT

and UNIX. MS-VBScript differs from CATScript by the fact that the notion

to declare a variable by Dim X As Y does not exist.

MS-VBA : VBA is an environment of development integrated into CATIA and

dedicated to VB but only on NT. MS-VBA differs from MS-VBScript by the comfort

of programming and the possibility of realizing simple application with a

graphic interface.

ActiveX with panels can be added in a macro but only on NT.

Other services such as stemObject are called with

CreateObject and are available only on NT.

The declaration of object types is recorded in the macro (even if it is

not used in VBScript) but it can help you (with the completion in VB on NT)

to program your future application.

中英文对照外文翻译

CATIA V5 Association with file extension

A double-click in Windows Explorer on a .CATPart file opens it in

CATIA V5. On NT, If CATIA V5 is not running, it is launched automatically.

In the Windows Explorer, with As Web page mode, a thumbnail shows

a preview for all CATIA Documents.

CATIA V5 Scripting capabilities

IN process application:This is done from the Tools + Macro in CATIA menu.

When the Macro is running, CATIA is deactivated. You cannot store variables

in a macro between two calls. Access with VBScript (Microsoft) and VBA on

Windows NT, and with VBScript (Winsoft) on Unix.

This is based on AUTOMATION. A foreign process can call CATIA, create

or modify geometry, decode, measure or pilot CATIA. CATIA is still running.

For each action of the application, we have to check if CATIA is in the good

state to synchronize the two processes. This kind of applications can be

developed in: Visual BasicWindows Scripting Host (VBScript , JScript)

Windows Explorer HTML (VBScript , JScript)or Any other COM applications.

In the future, a Java encapsulation of the V5 Automation objects will

also be provided. This will enable the development of applications on NT

and Unix based on Java, both in-process and out-process.

In-Process Macros

We call In-process because the script interpretation is performed in the

same process as CATIAA list shows the Macro available. We can run, edit,

rename or delete existing script, or create a new list of libraries

of script proposed into the panel above is modifiable through the window

of libraries.

CATIA V5 Visual Basic Editor

With CATIA Visual Basic Editor, We can edit existing macro or create a

new one, insert graphic form, debug and run VBA project.

Macro libraries

The interface of the dialog “Tools + Macro + Macros„” allows to choose

中英文对照外文翻译

a library of macro (a directory of macro or a VBA project) or a document

on which we wish to work.

From this window, we can close an already opened library, open a library,

or create a library. Libraries are shown by type (directory, VBA

).Every type of library supports different languages. VBA

supports only the language MS-VBA, while in a directory we can write in

MS-VBScript or in CATScript.

Recording a Macro

The panel of recording VBA allows to choose the container in which we

are going to record, the used language and the name of the macro to be

syntax of the recorded script is going to differ according to

the menu chosen. Recording a Macro generates a script corresponding to the

creation or modification of the objects in the recorded sequence. After

stopping the recording, we can store,edit or replay this script (called

macro). As a rule, recording a macro helps you to learn how to program

something

Running a Macro

You can execute a macro as soon as CATIA is started : CNEXT -macro

E:ipt

You can start CATIA in batch mode to execute a macroCNEXT -batch -macro

E:ipt

You can run a macro interactively from the Macro menu

You can run a macro interactively from an icon in a toolbar

Execution of a Macro from another Macro

CATIA V5R9 offers the capability through an Automation function to

execute a Macro from another Macro. The function lets the user invoke another

scripted function, contained in another macro library, potentially written

in another scripting language. A support enum CATSysLibraryType is used to

let the developer describe the kind of library the function to call is

contained in. (Example from VBScript)

中英文对照外文翻译

To call an Add function that is defined in a “E:MacrosMath” directory

library, in a file “”, one would write:

Dim args2(1)

args2(0) = 3

args2(1) = 2

Dim addResult

addResult = eScript ( "E:MacrosMath",

catScriptLibraryTypeDirectory, "", "Add", args2 )

MsgBox addResult

To call an PrintReport() sub that is defined in a

V5 in a “E:Partst” document library, file

“”, one would write:

Dim args()

eScript "E:t",

catScriptLibraryTypeDocument, "", "PrintReport",

args

Adding a Macro as a command in a Toolbar

Select the macro you want to add in Tools + Customize + Commands Tab

page + Macros:Drag and Drop the macro nameto the toolbar you wish :

To select another icon than the default one, click on Show

Macros Options Interface

The panel of the dialog “Tools + Options + Macros” allows to choose

according to the language, the Editor who will be launched to edit a macro,

and to specify external typelibs to take into account in the replay of

the new interface, all the typelibs V5 of the runtime view

are automatically taken into account. This option serves only for declaring

typelibs except runtime view (Excel for example).

Running Out-Process programs (On NT only)

The script is running in another application running in another process,

such as:Visual Basic,VBA (in Excel or Word),Using WSH (Windows Scripting

中英文对照外文翻译

Host) with VBScript or JavaScript,Using HTML with VBScript or JavaScript

CATIA can be scripted from any other COM Application.

Running Out-Process from VBA or Visual Basic

VBA and Visual Basic provide useful tools:For this, you can declare all

the typelib files (*.tlb) provided by Dassault typelib files

contain the declarations of all the objects, methods and properties of the

exposed objects.

Running Out-Process from VBA or Visual Basic

Type definition allows type checking and “early binding”.Helpful

completion gives you all the properties and methods of an object and gives

you the argument types of a r Object describes all the exported

objects

Running Out-Process from VBA or Visual Basic

Here are the statements to launch CATIA V5 from VBA or Visual Basic.

If CATIA is already running :

[...]

Dim CATIA as Object

Set CATIA = GetObject(, “ation”)

[...]

If CATIA is not already running :

[...]

Dim CATIA as Object

Set CATIA = CreateObject(“ation”)

e = True

[...]

If the typelib is referenced, we can declare CATIA as

ation.

Bolt from Excel Example

The purpose of this example is to launch CATIA and to create a bolt part

from Excel.

中英文对照外文翻译

In this Example, we will learn : the Visual Basic for Application

environment in Excel. how to create a Button in Excel. how to associate a

macro to this macro will launch CATIA and create a Bolt.

Bolt from Excel

Have a look on the code:This tries to retrieve CATIA and if not successful

starts it.

Dim CATIA As Object

'Get CATIA or start it if necessary.

On Error Resume Next

Set CATIA = GetObject(, "ation")

If <> 0 Then

Set CATIA = CreateObject("ation")

e = True

End If

On Error GoTo 0

Both functions GetObject and CreateObject are provided by VBA (as well

as Visual Basic).

Running Out-Process using the Windows Scripting Host (WSH)

WSH enables scripts written in different languages such as VBScript and

JavaScript. You can use a standard Editor to write your application. If your

program fails, you will be able to use the Windows Development environment.

It is possible to develop an application in Visual Basic, then put the

types in comment and run it with WSH. To run a VBScript (*.vbs) or JavaScript

(*.js) file, you can use cscript or wscript commands. Usually,

is already associated with those extensions.

VBScript under Windows Scripting Host.

You can write a VBScript program in a simple ASCII text file with the

extension “.vbs” for Visual Basic Script. Under WSH, GetObject and

CreateObject are provided by the object following code launches

CATIA V5.

中英文对照外文翻译

On Error Resume Next

Set CATIA = ect(,"ation")

If <> 0 Then

Set CATIA = Object("ation")

e = True

End If

example

Have a look on the source code.

To run the “” example , you can double–click on it.

To run the example on a Command prompt Window you can also use : Cscript

Or wscript

JavaScript under Windows Scripting Host

In the same way as VBScript, you can write a JavaScript program in a simple

ASCII text file with the extension “.js” for JavaScript.

Under WSH, GetObject and CreateObject are provided by the object Wscript.

The following code launches CATIA V5.

CATIA = ect(,"ation");

if ( CATIA == null) {

CATIA = Object("ation");

e = true;}

example

Have a look on the source code.

To run the “” example, you can double–click on it.

To run the example on a Command prompt Window you can also use : Cscript

Or wscript

Out-Process in HTML (NT & Microsoft Internet Explorer Only)

In HTML, you can include VBScript or JavaScript oft

explorer provides ActiveXObject (in JavaScript) and CreateObject (in

VBScript) functions to Launch Automation , it is possible to call

CATIA V5 this can access to the Microsoft Development Environment

中英文对照外文翻译

to debug your can launch the Microsoft Development

Environment from Explorer by :Script Debugger Open

Out-Process in HTML with VBScript

Load the 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 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 = me

Method: an action on an object

“MyNewName”

Collection: a list of objects.

The CATIA collections index begins at 1, and not 0 :

For i=1 to

msgbox (i).Name

Next

We can also access a collection with the name of the object:

Example: msgbox ("duct").Name

We add objects to the collections with the method add :

中英文对照外文翻译

set myPartDoc = ("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

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 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 = (“Part”) create a PartDocument

Instead of Part, Use Product for a Product Document or Drawing

for a Drawing Document

Opening a new Document :

Dim Doc as Document

Set Doc= (“E:Partst”)

Both Add and Open functions add the Document in the Documents Collection.