All Frameworks  Object Hierarchy  This Framework  Indexes   

List (Collection)

Represents a CATIAList.

Method Index

Add
Adds an item at the end of the list.
Item
Retrieves a Feature using its index or its name from the Features collection.
Remove
Removes a Feature from the Features collection.
Reorder
Reorders an element by moving it from the current position to the target position.
Replace
Sets an item in the list at a position.

Methods


o Sub Add( iItemValue)
Adds an item at the end of the list. Does an AddRef on the item. Returns E_FAIL if the object type is not correct. Will return E_FAIL if trying to set an already existing element while IsDuplicateElementsAllowed is false.
o Func Item( iIndex) As
Retrieves a Feature using its index or its name from the Features collection.
Parameters:
iIndex
The index or the name of the Feature to retrieve from the collection of Features. As a numerics, this index is the rank of the Feature in the collection. The index of the first Feature in the collection is 1, and the index of the last Feature is Count. As a string, it is the name you assigned to the Feature using the
AnyObject.Name property or when creating the Feature.
Returns:
The retrieved Feature
Example:
This example retrieves the last Feature in the Features collection.
 Dim lastFeature As CATIABase
 Set lastFeature = Features.Item(Features.Count)
 
o Sub Remove( iIndex)
Removes a Feature from the Features collection.
Parameters:
iIndex
The index or the name of the Feature to retrieve from the collection of Features. As a numerics, this index is the rank of the Feature in the collection. The index of the first Feature in the collection is 1, and the index of the last Feature is Count. As a string, it is the name you assigned to the Feature using the
AnyObject.Name property or when creating the Feature.
Example:
This example removes the Feature named density from the Features collection.
 Features.Remove("density")
 
o Sub Reorder( iIndexCurrent,
iIndexTarget)
Reorders an element by moving it from the current position to the target position. Doesn't change the list if either position is out of the list. Return E_FAIL if cannot reorder.
o Sub Replace( iIndex,
iItemValue)
Sets an item in the list at a position. Does an AddRef on the item. Returns E_FAIL if the object type is not correct or the index is out of bounds. Returns E_FAIL if trying to set an already existing element while IsDuplicateElementsAllowed is false.

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