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

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 467
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭
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: 467
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    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)