How to define degrees as unit for property instead of radians in WB Wizard?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 450
100 Answers 250 Likes 100 Comments First Anniversary
✭✭✭✭
edited June 2023 in Structures

I'm currently creating a project page wizard in which I want to display the rotation in a joint obtained in an analysis that was conducted in the previous step. While I'm able to get the value back to the wizard (through extension's attributes), I can't find a way to specify the unit correctly (should be degrees and not radians in picture below):

enter image description here

How can I specify that the angle unit in the wizard should be degrees and not radians?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 450
    100 Answers 250 Likes 100 Comments First Anniversary
    ✭✭✭✭
    Answer ✓

    The units in the wizard property are related to the unit system chosen in WB project page. Whatever unit system you choose in WB project, the corresponding units of the physical quantities should be updated accordingly. The key to this would be to define a custom unit system with degree as a unit for Angle.

    enter image description here

    One can define and use the custom unit system the code below:

    SetScriptVersion(Version="21.1.216")
    unitSystem1 = CreateCustomUnitSystem(
        UnitSystemName="Custom Unit System",
        UnitSystemDisplayName="Custom Unit System",
        BaseUnitSystemName="SI")
    dictionary1 = SetQuantityUnitForUnitSystem(
        UnitSystemName="Custom Unit System",
        QuantityName="Angle",
        Unit="degree")
    unitSystem2 = SetProjectUnitSystem(UnitSystemName="Custom Unit System")
    

    Once this is done, just define the property in the Wizard XML:

    <property name="Rotation" caption="ROTX" unit="Angle" control="float"/>