How to define Quantity in Mechanical scripting when using CPython?

Options
Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 130
First Answer First Anniversary Name Dropper Solution Developer Community of Practice Member

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

Answers

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 130
    First Answer First Anniversary Name Dropper Solution Developer Community of Practice Member
    edited June 25
    Options

    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]")