ISTKObjectElementCollection#

class ansys.stk.core.stkobjects.ISTKObjectElementCollection#

Represents a collection of STK objects.

Overview#

item

Given an index, returns an element in the collection. If the index is an integer, then the method returns the element in the collection at the given position. If the index is a string, then the method returns the element with the specified name.

contains

Check whether an object with the given name exists.

get_item_by_index

Retrieve an Stk object element from the collection by index.

get_item_by_name

Retrieve an Stk object element from the collection by name.

count

Return the number of elements in a collection.

_new_enum

Return an enumerator that can iterate through the collection.

Import detail#

from ansys.stk.core.stkobjects import ISTKObjectElementCollection

Property detail#

property ISTKObjectElementCollection.count: int#

Return the number of elements in a collection.

property ISTKObjectElementCollection._new_enum: EnumeratorProxy#

Return an enumerator that can iterate through the collection.

Method detail#

ISTKObjectElementCollection.item(self, index_or_name: Any) ISTKObject#

Given an index, returns an element in the collection. If the index is an integer, then the method returns the element in the collection at the given position. If the index is a string, then the method returns the element with the specified name.

Parameters:

index_or_name : Any

Returns:

ISTKObject

ISTKObjectElementCollection.contains(self, inst_name: str) bool#

Check whether an object with the given name exists.

Parameters:

inst_name : str

Returns:

bool

ISTKObjectElementCollection.get_item_by_index(self, index: int) ISTKObject#

Retrieve an Stk object element from the collection by index.

Parameters:

index : int

Returns:

ISTKObject

ISTKObjectElementCollection.get_item_by_name(self, name: str) ISTKObject#

Retrieve an Stk object element from the collection by name.

Parameters:

name : str

Returns:

ISTKObject