How can I change the Angle units (radian/degree) in Mechanical using Scripting?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

How can I change the Angle units (radian/degree) in Mechanical using Scripting?

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    Works only till version 2021R1, for versions 2021R2 use the Pythonic method above.

    The following jscript snippet works:

    For degrees:

    cmd = """DS.Script.doSelectDegrees();"""
    ExtAPI.Application.ScriptByName("jscript").ExecuteCommand(cmd)
    

    For radians:

    cmd = """DS.Script.doSelectRadians();"""
    ExtAPI.Application.ScriptByName("jscript").ExecuteCommand(cmd)