System Collection (Collection)
All Frameworks Object Hierarchy This Framework Indexes
Collection (Collection)
Represents the base object for collections.
As a base object, it provides properties and methods shared by
any other object.
Property Index
-
Application
- Returns the application.
-
Count
- Returns the number of objects in the collection.
-
Name
- Returns or sets the name of the object.
-
Parent
- Returns the parent object.
Method Index
-
GetItem
- Returns an object from its name.
Properties
o Property Application( | ) As (Read Only) |
-
Returns the application.
The application is the root object in the object structure and can be
retrieved from any object
in the object structure using the Application property.
The Application property is the way to jump from any object up to the
root of the object data structure, allowing then to navigate downwards.
For in-process scripting, the application is always referred to as
CATIA.
Note that the Application property of the Application object returns the
Application object itself.
- Example:
-
This example retrieves in CurrentApplication the application
object, root of the object structure, from a given object of this
structure: a document refered to using the MyDocCollecion
variable.
Dim CurrentApplication As Application
Set CurrentApplication = MyDocCollecion.Application
o Property Count( | ) As (Read Only) |
-
Returns the number of objects in the collection.
This is handy to scan all the objects in a collection.
- Example:
-
This example retrieves in ObjectNumber the number of objects
currently gathered in MyCollection.
ObjectNumber = MyCollection.Count
o Property Name( | ) As (Read Only) |
-
Returns or sets the name of the object.
The name is a character string you can assign to any object to
handle it easier.
In the case of an object part of a collection, the name can often
be used in place of the object rank to retrieve or remove the object,
providing the Item and Remove methods of the collection feature
an argument with the Variant type.
If the object has no name set, the name returned is the one of
its parent.
- Example:
-
This example sets to MyObject the name Nice and Handy
Object Name.
MyObject.Name("Nice and Handy Object Name")
o Property Parent( | ) As (Read Only) |
-
Returns the parent object.
The parent object of a given object is the object that created this
object, usually the object just above in the object tree structure
and that aggregates it.
In the case of an object part of a collection, the parent object
is not the collection object itself, but the object that
aggregates the collection object.
The Parent property is the way to step upwards in the object data
structure.
Note that the Parent property of the Application object returns the
Application object itself.
- Example:
-
This example retrieves in ParentObject the parent object
of the GivenObject object.
Dim ParentObject As AnyObject
Set ParentObject = GivenObject.Parent
Methods
o Func GetItem( | | IDName) As |
-
Returns an object from its name.
Role: To retrieve an object when only its name is available.
You should not use this method, but you can find it in the macros generated
by the Tools->Macro command.
- Parameters:
-
- IDName
- The searched obect name
- Returns:
- The searched object
Copyright © 2003, Dassault Systèmes. All rights reserved.