All Frameworks  Object Hierarchy  This Framework  Previous  Next  Indexes  

List (Collection)

IUnknown
  |
  +---IDispatch
    |
    +---CATBaseUnknown
      |
      +---CATBaseDispatch
        |
        +---Collection
          |
          +---List
 


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(CATIABase 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(CATVariant iIndex) As CATIABase
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(CATVariant 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(CATVariant iIndexCurrent,
CATVariant 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(CATVariant iIndex,
CATIABase 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.