How to define Quantity in Mechanical scripting when using CPython?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 178
100 Comments 25 Answers 25 Likes First Anniversary
✭✭✭✭

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

Answers

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 178
    100 Comments 25 Answers 25 Likes First Anniversary
    ✭✭✭✭
    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]")