create_life_phase#

Lifecycle.create_life_phase(project: str, phase_name: str, duration: float, duration_units: str, num_of_cycles: float, cycle_type: str, description: str = '')#

Create a life phase.

Available Since: 2021R1

Parameters:
  • project (str) – Name of the Sherlock project.

  • phase_name (str) – Name of the life phase.

  • duration (float) – Event duration length.

  • duration_units (str) – Units for the event duration length. Options are "ms", "sec", and "min".

  • num_of_cycles (float) – Number of cycles for the life phase.

  • cycle_type (str) – Cycle type. Options include "COUNT", "DUTY CYCLE", "PER YEAR", and "PER HOUR".

  • description (str, optional) – Description of the life phase. The default is "".

Returns:

Status code of the response. 0 for success.

Return type:

int

Examples

>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> sherlock = launch_sherlock()
>>> sherlock.project.import_odb_archive(
    "ODB++ Tutorial.tgz",
    True,
    True,
    True,
    True,
    project="Test",
)
>>> sherlock.lifecycle.create_life_phase(
    "Test",
    "Example",
    1.5,
    "sec",
    4.0,
    "COUNT"
)