PhaseCollection#

class ansys.stk.core.stkobjects.aviator.PhaseCollection#

Class defining the collection of phases.

Overview#

item

Given an index, returns an element in the collection.

add

Add a phase at the end of the mission.

add_at_index

Add a phase at the given index.

remove

Remove given phase.

remove_at_index

Remove phase at the given index.

count

Return the number of elements in a collection.

_new_enum

Return an enumerator that can iterate through the collection.

Examples#

Add a new phase and use the same performance models as the first phase

# PhaseCollection phases: Phase Collection object
# Add a new phase at the end of the mission
newPhase = phases.add()
# Rename the phase
newPhase.name = "New Phase"
# Copy the performance models from the first phase and paste it to the new phase
phases[0].copy_performance_models()
newPhase.paste_performance_models()

Import detail#

from ansys.stk.core.stkobjects.aviator import PhaseCollection

Property detail#

property PhaseCollection.count: int#

Return the number of elements in a collection.

property PhaseCollection._new_enum: EnumeratorProxy#

Return an enumerator that can iterate through the collection.

Method detail#

PhaseCollection.item(self, index: int) Phase#

Given an index, returns an element in the collection.

Parameters:

index : int

Returns:

Phase

PhaseCollection.add(self) Phase#

Add a phase at the end of the mission.

Returns:

Phase

PhaseCollection.add_at_index(self, index: int) Phase#

Add a phase at the given index.

Parameters:

index : int

Returns:

Phase

PhaseCollection.remove(self, phase: Phase) None#

Remove given phase.

Parameters:

phase : Phase

Returns:

None

PhaseCollection.remove_at_index(self, index: int) None#

Remove phase at the given index.

Parameters:

index : int

Returns:

None