Units
Jump to navigation
Jump to search
Power user documentation
Some reading about units:
Examples
# -- some examples of the LabRPS unit translation system --
# make a shortcut for the examples
pq = LabRPS.Units.parseQuantity
# 10 meters in internal numbers
pq('10 m')
# doing math
pq('3/8 in')
# combined stuff
pq('100 km/h')
# transfer to other units
pq('100 km/h')/tu('m/s')
# derived units (Ohm)
pq('m^2*kg*s^-3*A^-2')
# or
pq('(m^2*kg)/(A^2*s^3)')
# angles
pq('2*pi rad') # full circle
# as gon
pq('2*pi rad') / tu('gon')
# more imperial
tu('1ft (3+7/16)in')
# or
pq('1\' (3+7/16)"') # the ' we have to escape because of python
# trigonometry
pq('sin(pi)')
Supported units
A complete list of all supported units can be found here.
See Also
- The Expressions page for a list of all known units.
- The documentation of Quantity.
- The Std UnitsCalculator tool.
- LabRPS scripting: Python, Introduction to Python, Python scripting tutorial, LabRPS Scripting Basics
- Modules: Units, Quantity
- Workbenches: Gui Commands, Commands
- Parametric objects: Scripted objects, Viewproviders
- Graphical interface: Interface creation, Interface creation completely in Python, PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Other: Expressions
- Hubs: User hub, Power users hub, Developer hub