Code: Select all
from FreeCAD import Units
myquantity = Units.Quantity('500')
Units.Unit(myquantity)
Code: Select all
hugo@Ahorn:~/build$ ./bin/FreeCADCmd
FreeCAD 0.19, Libs: 0.19R21276 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>>
>>> from FreeCAD import Units
myquantity = Units.Quantity('500')
Units.Unit(myquantity)>>> >>>
<Exception> Unit underflow in unit
hugo@Ahorn:~/build$
Code: Select all
OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21276 (Git)
Build type: Unknown
Branch: femtmp
Hash: bed6f9f61cbfbb330b8ea6f68439bb267da53b40
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)