The method used by default (Ironpython) doesn't seem to work. Eg: Quantity("10 [mm]")
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]")