Python API for Output request

Sudhir_Ingstron
Sudhir_Ingstron Altair Community Member

What is the python API to get the different output requests in a subcase, like Stress, Strain, displacement etc. Can an example be shared.

Thank you

Sudhir

Answers

  • Adriano_Koga
    Adriano_Koga
    Altair Employee

    import hm
    import hm.entities as ent

    def run():
    from hm.mdi import apis
    model = apis.HmModelDebug()

    # [TIP]: cardcreate is deprecated.
    model.cardcreate(cardname="GLOBAL_OUTPUT_REQUEST")

    card = ent.Card(model, 1)
    card.DISPLACEMENTS = 1

    card.DISPLACEMENTS_FORMAT = "H3D"
    card.STRESS = 1

    card.STRESS_FORMAT = "H3D"
    card.STRESS_LOCATION = "CORNER"
  • Adriano_Koga
    Adriano_Koga
    Altair Employee

    using the recorder in 2025, i got these. Apparently not everything s currently supported.

    import hm
    import hm.entities as ent

    def run():
    from hm.mdi import apis
    model = apis.HmModelDebug()

    # [TIP]: cardcreate is deprecated.
    model.cardcreate(cardname="GLOBAL_OUTPUT_REQUEST")

    card = ent.Card(model, 1)
    card.DISPLACEMENTS = 1
    # [ERROR]: Unrecognized attribute '1901' for ent.Card
    # [ERROR]: Unrecognized attribute '4871' for ent.Card
    # [ERROR]: Unrecognized attribute '4315' for ent.Card
    # [ERROR]: Unrecognized attribute '4008' for ent.Card
    # [ERROR]: Unrecognized attribute '4876' for ent.Card
    # [ERROR]: Unrecognized attribute '2174' for ent.Card
    # [ERROR]: Unrecognized attribute '2287' for ent.Card
    # [ERROR]: Unrecognized attribute '2175' for ent.Card
    # [ERROR]: Unrecognized attribute '12604' for ent.Card
    # [ERROR]: Unrecognized attribute '9621' for ent.Card
    # [ERROR]: Unrecognized attribute '10026' for ent.Card
    # [ERROR]: Unrecognized attribute '10027' for ent.Card
    # [ERROR]: Unrecognized attribute '11069' for ent.Card
    # [ERROR]: Unrecognized attribute '11314' for ent.Card
    # [ERROR]: Unrecognized attribute '11387' for ent.Card
    # [ERROR]: Unrecognized attribute '2939' for ent.Card
    card.DISPLACEMENTS_FORMAT = "H3D"
    card.STRESS = 1
    # [ERROR]: Unrecognized attribute '1923' for ent.Card
    # [ERROR]: Unrecognized attribute '4873' for ent.Card
    # [ERROR]: Unrecognized attribute '4325' for ent.Card
    # [ERROR]: Unrecognized attribute '3386' for ent.Card
    # [ERROR]: Unrecognized attribute '3387' for ent.Card
    # [ERROR]: Unrecognized attribute '4839' for ent.Card
    # [ERROR]: Unrecognized attribute '1221' for ent.Card
    # [ERROR]: Unrecognized attribute '11070' for ent.Card
    # [ERROR]: Unrecognized attribute '2295' for ent.Card
    # [ERROR]: Unrecognized attribute '8136' for ent.Card
    # [ERROR]: Unrecognized attribute '8430' for ent.Card
    # [ERROR]: Unrecognized attribute '9932' for ent.Card
    # [ERROR]: Unrecognized attribute '8429' for ent.Card
    # [ERROR]: Unrecognized attribute '9254' for ent.Card
    # [ERROR]: Unrecognized attribute '9255' for ent.Card
    # [ERROR]: Unrecognized attribute '9280' for ent.Card
    # [ERROR]: Unrecognized attribute '9281' for ent.Card
    # [ERROR]: Unrecognized attribute '11072' for ent.Card
    # [ERROR]: Unrecognized attribute '11312' for ent.Card
    # [ERROR]: Unrecognized attribute '12646' for ent.Card
    # [ERROR]: Unrecognized attribute '2432' for ent.Card
    card.STRESS_FORMAT = "H3D"
    card.STRESS_LOCATION = "CORNER"