pycatia.system_interfaces.collection

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-10 10:58:07.270911

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.system_interfaces.collection.Collection(com_object, child_object=<class 'pycatia.system_interfaces.any_object.AnyObject'>)

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
Collection

Represents the base object for collections.
As a base object, it provides properties and methods shared by any other
object.
property application: Application

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911)
o Property Application() As Application (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
Return type:

Application

property count: int

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911)
o Property Count() As long (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
Return type:

int

get_item(id_name: str) AnyObject

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911))
o Func GetItem(CATBSTR IDName) As CATBaseDispatch

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 object name

Returns:
The searched object
Parameters:

id_name (str) –

Return type:

AnyObject

get_item_by_index(index)
Parameters:

index (str/int) – relation name or index

Returns:

child_object

items()
Returns:

[self.child_object()]

property name: str

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911)
o Property Name() As CATBSTR (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”)
Return type:

str

property parent: AnyObject

Note

CAA V5 Visual Basic Help (2020-06-10 10:58:07.270911)
o Property Parent() As CATBaseDispatch (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
Return type:

AnyObject