How to get the Unit String of the active Project Unit system using ACT?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 427
5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
✭✭✭✭
edited May 24 in Structures

How to get the Unit String of the active Project Unit system using ACT?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 427
    5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
    ✭✭✭✭
    Answer ✓

    This can be requested using JavaScript:

    cmd = """unit_str = DS.UnitSystem.UnitString (DS.Script.id_utLENGTH); returnFromScript(unit_str)"""
    unit_str = ExtAPI.Application.ScriptByName("jscript").ExecuteCommand(cmd)
    

    For other units one can replace id_utLENGTH accordingly. Eg:

    • id_utANGLE
    • id_utVOLUME ...