Indexes   

Application (Object)

Represents the current CNext application and its frame window.
The application is the root object for all the other objects you can use and access from scripts. It directly aggregates:

The active document and the active window are two key objects for the application you can access using the ActiveDocument and ActiveWindow properties respectively. The active window is the window the end user is currently working in, and the active document is the document displayed in this active window and that the end user is being editing. This document sets its workshop, that is the available menus and toolbars that make it possible to edit it, according to its type.

When you create or use macros for in-process access, the application is always referred to as CATIA.


Property Index

ActiveDocument
Returns the active document.
ActivePrinter
Returns or sets the active printer.
ActiveWindow
Returns the active window.
CacheSize
Returns or sets the default local cache size used by the application.
Caption
Returns or sets the application's window title.
DisplayFileAlerts
Returns or sets the application ability to display file alerts.
Documents
Returns the collection of documents currently managed by the application.
FileSearchOrder
Returns or sets the default path concatenation used by the application to search for when opening files.
FileSystem
Returns the file system.
FullName
Returns the application's executable file full name, including its path.
HSOSynchronized
For selection performance purposes, returns or sets the HSO synchronization in comparison with the CSO.
Height
Returns or sets the height of the application's frame window.
Interactive
Returns or sets the application sensitivity to end user interactions.
Left
Returns or sets the distance from the application's frame window left side to the left side of the screen.
LocalCache
Returns or sets the default local cache path used by the application.
Path
Returns the path of the application's executable files.
Printers
Returns the collection of the printers currently managed by the application.
RefreshDisplay
Enables or disables the update of the display during the script replay.
StatusBar
Returns or sets the text displayed in the application's window status bar.
SystemConfiguration
Returns the system configuration object (an object which provides access to system or configuration dependent resources).
SystemService
Returns system services.
Top
Returns or sets the distance from the application'si frame window top to the top of the screen.
Visible
Returns or sets the application's window visibility.
Width
Returns or sets the width of the application's frame window.
Windows
Returns the collection of windows currently managed by the application.

Method Index

CreateSendTo
Creates a Send TO.
FileSelectionBox
Displays a modal dialog box which can be used to select / enter the name of a file to open / save.
GetWorkbenchId
Returns the identifier of the CATIA current workbench.
Help
Displays application's online help.
Quit
Exits the application and closes all open documents.
StartCommand
Starts a CATIA command.
StartWorkbench
Starts a CATIA workbench.

Properties


o Property ActiveDocument() As (Read Only)
Returns the active document. The active document is the document the end user is being editing.
Example:
This example retrieves in ActiveDoc the active document of the CATIA application.
 Dim ActiveDoc As Document
 Set ActiveDoc = CATIA.ActiveDocument
 
o Property ActivePrinter() As
Returns or sets the active printer. The active printer is the printer on which documents are printed
Example:
This example retrieves in ActivePrinter the active printer of the CATIA application.
 Dim ActivePrinter As Printer
 Set ActivePrinter = CATIA.ActivePrinter
 
o Property ActiveWindow() As (Read Only)
Returns the active window. The active window is the window in which the end user is currently editing the active document.
Example:
This example retrieves in ActiveWin the active window of the CATIA application.
 Dim ActiveWin As Window
 Set ActiveWin = CATIA.ActiveWindow
 
o Property CacheSize() As
Returns or sets the default local cache size used by the application.
Example:
This example sets the cache size for by the CATIA application to those defined in LocalCacheSize.
 LocalCacheSize= 10
 CATIA.CacheSize = LocalCacheSize
 
o Property Caption() As
Returns or sets the application's window title. This title is displayed in the application's window title bar.
Example:
This example retrieves in Title the CATIA application's window title.
 Title = CATIA.Caption
 

The returned value is like this:

 CNext
 
o Property DisplayFileAlerts() As
Returns or sets the application ability to display file alerts.
True if the application enables file alert display.
True is the default. A file alert is, for example, the dialog box that prompts you that the file you want to save is in read only mode, or that the file you want to close needs to be saved. It could be handy to disable these file alerts for automation since they may freeze your macro execution, waiting for an end user input in the displayed dialog box.
Example:
This example disables file alerts for the CATIA application.
 CATIA.DisplayFileAlerts = False
 
o Property Documents() As (Read Only)
Returns the collection of documents currently managed by the application.
Example:
This example retrieves in DocCollection the collection of documents currently managed by the CATIA application.
 Dim DocCollection As Documents
 Set DocCollection = CATIA.Documents
 
o Property FileSearchOrder() As
Returns or sets the default path concatenation used by the application to search for when opening files.
Example:
This example sets the paths to search for by the CATIA application to those defined in PathConcatenation.
 PathConcatenation = "/u/users/fbq/db/model:/u/users/psr/db/model"
 CATIA.FileSearchOrder = PathConcatenation
 
Theese methods require the installation of CATIA - PPR xPDM Gateway 1 Product (PX1) In case this product is not granted, the first invocation to one of the methods will fail.
o Property FileSystem() As (Read Only)
Returns the file system. The file system provides access to a computer's file system.
Example:
This example retrieves in AppliFileSys the file sytem of the CATIA application.
 Dim AppliFileSys As FileSystem
 Set AppliFileSys = CATIA.FileSystem
 
o Property FullName() As (Read Only)
Returns the application's executable file full name, including its path. This name is the name of the executable file used to start the application.
Example:
This example retrieves in ApplicationFullName the CATIA application's executable file full name.
 ApplicationFullName = CATIA.FullName
 

The returned value is like this:

 \\lisa\cxr1arel\bsf\alpha_a\code\bin\CNEXT.exe
 
o Property HSOSynchronized() As
For selection performance purposes, returns or sets the HSO synchronization in comparison with the CSO.
Role: Precises if, for all
Selection object instances, the HSO (Highlighted Set of Objects) is synchronized in comparison with the CSO (Current Set of Objects).

Valid values are:

Note: even if this property is set to False, the HSO is synchronized in comparison with the CSO at the begining of the following methods:

CAUTION: If you use the False value of this property, you must make sure to reset it to True for CATIA's CSO to reflect properly the changes made in Automation Selection. For example, it should be reset to True before interactive parts of your script: MsgBox, InputBox calls, VBA forms updates and so on.

o Property Height() As
Returns or sets the height of the application's frame window. The height is expressed in pixels.
Example:
This example sets the height of the CATIA application's frame window to 300 pixels.
 CATIA.Height = 300
 
o Property Interactive() As
Returns or sets the application sensitivity to end user interactions.
True if the application is end user interaction sensitive.
Example:
This example makes the CATIA application sensitive to end user interactions.
 CATIA.Interactive = True
 
o Property Left() As
Returns or sets the distance from the application's frame window left side to the left side of the screen. This distance is expressed in pixels.
Example:
This example sets the distance from the CATIA application's frame window left side to the left side of the screen to 150 pixels.
 CATIA.Left = 150
 
o Property LocalCache() As
Returns or sets the default local cache path used by the application.
Example:
This example sets the cache path for by the CATIA application to those defined in LocalCachePath.
 LocalCachePath= "/tmp/cache"
 CATIA.LocalCache = LocalCachePath
 
o Property Path() As (Read Only)
Returns the path of the application's executable files.
Example:
This example retrieves in ApplicationPath the path where the CATIA application executable files are located.
 ApplicationPath = CATIA.Path
 

The returned value is like this:

 \\lisa\cxr1arel\bsf\alpha_a\code\bin
 
o Property Printers() As (Read Only)
Returns the collection of the printers currently managed by the application.
Example:
This example retrieves in PrintersCollection the collection of the printers currently managed by the CATIA application.
 Dim PrintersCollection As Windows
 Set PrintersCollection = CATIA.Printers
 
o Property RefreshDisplay() As
Enables or disables the update of the display during the script replay. To improve performance, this update can be temporarely disabled by setting this property to False in the script.
True if the application's display is refreshed after each method call (value set by default).
Example:
This example makes the update of the CATIA application's display disabled during the script replay.
 CATIA.RefreshDisplay = False
 
o Property StatusBar() As
Returns or sets the text displayed in the application's window status bar.
Example:
This example retrieves in Text the text displayed in the CATIA application's window status bar.
 Text = CATIA.StatusBar
 

The returned value is like this:

 Welcome to CATIA CxR1
 
o Property SystemConfiguration() As (Read Only)
Returns the system configuration object (an object which provides access to system or configuration dependent resources).
Parameters:
oConfiguration
The system configuration object.
o Property SystemService() As (Read Only)
Returns system services.
Example:
This example retrieves in AppliSysSer the CATIA application's system services.
 Dim AppliSysSer As SystemService
 Set AppliSysSer = CATIA.SystemService
 
o Property Top() As
Returns or sets the distance from the application'si frame window top to the top of the screen. This distance is expressed in pixels.
Example:
This example sets the distance from the CATIA application's frame window top to the top of the screen to 50 pixels.
 CATIA.Top = 50
 
o Property Visible() As
Returns or sets the application's window visibility.
True if the application's window is visible to the end user.
Example:
This example makes the CATIA application's window visible.
 CATIA.Visibility = True
 
o Property Width() As
Returns or sets the width of the application's frame window. The width is expressed in pixels.
Example:
This example sets the width of the CATIA application's frame window to 350 pixels.
 CATIA.Width = 350
 
o Property Windows() As (Read Only)
Returns the collection of windows currently managed by the application.
Example:
This example retrieves in WinCollection the collection of windows currently managed by the CATIA application.
 Dim WinCollection As Windows
 Set WinCollection = CATIA.Windows
 

Methods


o Func CreateSendTo() As
Creates a Send TO.
Role:This method creates a
SendToService instance.
Warning : CATIASendToService interface requires the installation of CATIA - PPR xPDM Gateway 1 Product (PX1) In case this product is not granted, the first invocation to one of CATIASendToService methods will fail.
o Func FileSelectionBox( iTitle,
iExtension,
iMode) As
Displays a modal dialog box which can be used to select / enter the name of a file to open / save.
Parameters:
iTitle
The title of the dialog box.
iExtension
A file extension filter.
iMode
The mode in which to run the dialog box (either CatFileSelectionModeOpen or CatFileSelectionModeSave.
oFilePath
The return string containing the full path of the selected file, or a zero-length string if the user selects Cancel.
Example:
This example asks the user to select a text file and prints the path of the selected file.
 filepath = CATIA.FileSelectionBox("Select a text file", "*.txt", CatFileSelectionModeOpen)
 CATIA.SystemServices.Print "The selected file is " & filepath
 
o Func GetWorkbenchId() As
Returns the identifier of the CATIA current workbench.
Parameters:
oworkbenchId
The id of the current workbench.
o Sub Help( iHelpID)
Displays application's online help.
Parameters:
iHelpID
Identifier of the help message to display
Example:
This example displays the string referred to by the HelpKey message key in the message catalog concatenation.
 CATIA.Help("HelpKey")
 
o Sub Quit()
Exits the application and closes all open documents.
Example:
This example exits the CATIA application and closes all its open documents.
 CATIA.Quit()
 
o Sub StartCommand( iCommandId)
Starts a CATIA command.
Role:This method starts a command and executes it untill its first interaction. Please notice interactions such as selections you could add after in your macro will not work. StartCommand is useful to execute one-shot (not interactive) commands, it is not safe for interactive commands.
Parameters:
iCommandId
The id of the command to be started. This id can be the name of the command or its alias.
o Sub StartWorkbench( iworkbenchId)
Starts a CATIA workbench.
Parameters:
iworkbenchId
The id of the workbench to be started.

Copyright © 2006, Dassault Systèmes. All rights reserved.