ObjectLinkCollection#

class ansys.stk.core.stkobjects.ObjectLinkCollection#

Collection of names of STK objects that are available in the current Scenario.

Overview#

item

Given an index, returns an element in the collection.

add

Add to the collection a link to an STK object with the given object path and name.

remove

Remove from the collection a link to the STK object with the given index.

remove_all

Remove all links from the collection.

remove_name

Remove from the collection a link to an STK object with the given object path and name.

add_object

Add to the collection a link to the given STK object.

remove_object

Remove from the collection a link to the given STK object.

contains

Determine whether the object with the given name is in the collection.

index_of

Search the collection for the specified object and returns a zero-based index of the first occurrence within the collection, if found; otherwise, -1.

count

Return the number of elements in a collection.

_new_enum

Return an enumerator that can iterate through the collection.

available_objects

Return an array of valid objects.

Import detail#

from ansys.stk.core.stkobjects import ObjectLinkCollection

Property detail#

property ObjectLinkCollection.count: int#

Return the number of elements in a collection.

property ObjectLinkCollection._new_enum: EnumeratorProxy#

Return an enumerator that can iterate through the collection.

property ObjectLinkCollection.available_objects: list#

Return an array of valid objects.

Method detail#

ObjectLinkCollection.item(self, index: int) ObjectLink#

Given an index, returns an element in the collection.

Parameters:

index : int

Returns:

ObjectLink

ObjectLinkCollection.add(self, name: str) None#

Add to the collection a link to an STK object with the given object path and name.

Parameters:

name : str

Returns:

None

ObjectLinkCollection.remove(self, index: int) None#

Remove from the collection a link to the STK object with the given index.

Parameters:

index : int

Returns:

None

ObjectLinkCollection.remove_all(self) None#

Remove all links from the collection.

Returns:

None

ObjectLinkCollection.remove_name(self, name: str) None#

Remove from the collection a link to an STK object with the given object path and name.

Parameters:

name : str

Returns:

None

ObjectLinkCollection.add_object(self, object: ISTKObject) None#

Add to the collection a link to the given STK object.

Parameters:

object : ISTKObject

Returns:

None

ObjectLinkCollection.remove_object(self, object: ISTKObject) None#

Remove from the collection a link to the given STK object.

Parameters:

object : ISTKObject

Returns:

None

ObjectLinkCollection.contains(self, name: str) bool#

Determine whether the object with the given name is in the collection.

Parameters:

name : str

Returns:

bool

ObjectLinkCollection.index_of(self, name: str) int#

Search the collection for the specified object and returns a zero-based index of the first occurrence within the collection, if found; otherwise, -1.

Parameters:

name : str

Returns:

int