ISTKObjectCollection#

class ansys.stk.core.stkobjects.ISTKObjectCollection#

Represents a collection of STK objects.

Overview#

item

Given an index, returns the element in the collection. If the index is an integer, then 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.

new

Create an STK object using specified class and instance name.

unload

Remove an STK object using specified object’s type and name.

get_elements

Return a collection of objects of specified type.

new_on_central_body

Create an STK object using specified class, instance name and the central body.

contains

Check whether the collection contains an object with the given type and name.

import_object

Import object from external file and returns the pointer to the object.

copy_object

Copy and paste the specified object.

get_item_by_index

Retrieve an Stk object from the collection by index.

get_item_by_name

Retrieve an Stk object from the collection by name.

count

Return the number of elements in the collection.

_new_enum

Return an enumerator for the collection.

supported_child_types

Return the available objects that can be added to this object.

Import detail#

from ansys.stk.core.stkobjects import ISTKObjectCollection

Property detail#

property ISTKObjectCollection.count: int#

Return the number of elements in the collection.

property ISTKObjectCollection._new_enum: EnumeratorProxy#

Return an enumerator for the collection.

property ISTKObjectCollection.supported_child_types: list#

Return the available objects that can be added to this object.

Method detail#

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

Given an index, returns the element in the collection. If the index is an integer, then 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

ISTKObjectCollection.new(self, class_type: STKObjectType, inst_name: str) ISTKObject#

Create an STK object using specified class and instance name.

Parameters:

class_type : STKObjectType

inst_name : str

Returns:

ISTKObject

ISTKObjectCollection.unload(self, class_type: STKObjectType, inst_name: str) None#

Remove an STK object using specified object’s type and name.

Parameters:

class_type : STKObjectType

inst_name : str

Returns:

None

ISTKObjectCollection.get_elements(self, class_type: STKObjectType) ISTKObjectElementCollection#

Return a collection of objects of specified type.

Parameters:

class_type : STKObjectType

Returns:

ISTKObjectElementCollection

ISTKObjectCollection.new_on_central_body(self, class_type: STKObjectType, inst_name: str, central_body_name: str) ISTKObject#

Create an STK object using specified class, instance name and the central body.

Parameters:

class_type : STKObjectType

inst_name : str

central_body_name : str

Returns:

ISTKObject

ISTKObjectCollection.contains(self, class_type: STKObjectType, inst_name: str) bool#

Check whether the collection contains an object with the given type and name.

Parameters:

class_type : STKObjectType

inst_name : str

Returns:

bool

ISTKObjectCollection.import_object(self, file_path: str) ISTKObject#

Import object from external file and returns the pointer to the object.

Parameters:

file_path : str

Returns:

ISTKObject

ISTKObjectCollection.copy_object(self, object_to_clone: ISTKObject, new_object_name: str) ISTKObject#

Copy and paste the specified object.

Parameters:

object_to_clone : ISTKObject

new_object_name : str

Returns:

ISTKObject

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

Retrieve an Stk object from the collection by index.

Parameters:

index : int

Returns:

ISTKObject

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

Retrieve an Stk object from the collection by name.

Parameters:

name : str

Returns:

ISTKObject