How to define Quantity in Mechanical scripting when using CPython?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 186
100 Comments 25 Answers Second Anniversary 25 Likes
✭✭✭✭

The method used by default (Ironpython) doesn't seem to work. Eg: Quantity("10 [mm]")

Answers

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 186
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭
    edited June 25

    The below should do the trick for defining Quantity in Cpython (which can be activated in Mechanical through Beta options). From v24R2, one would not need the below workaround.

    Ansys.Core.Units.Quantity("10 [mm]")