#A simple tcl script to set up your unit system in STKO

#...................................
#UNITS
#Base units SI N-m-s
#unit force
set N 1.0
#unit length
set m 1.0
#unit time
set s 1.0

#Derived units
#unit pressure
set Pa [expr $N/$m/$m]
#unit acceleration
set ms2 [expr $m/$s/$s]
#unit mass
set kg [expr $N/$ms2]

#gravity acceleration
set g [expr 9.8065*$ms2]

#...................................
#Multipliers
set kN [expr $N*1000]
set hN [expr $N*100]
set daN [expr $N*10]
set km [expr $m*1000]
set dm [expr $m/10.]
set cm [expr $m/100.]
set mm [expr $m/1000.]

#...................................
#Conversions
set kip [expr $kN*4.4482216]
set lbf [expr $N*0.224809]
set inc [expr $m*0.0254]
set ft [expr $m*0.3048]
set yd [expr $m/0.9144]
set MPa [expr $Pa*1.0e+6]
set GPa [expr $Pa*1.0e+9]
set psi [expr $MPa/145.037738]
set ksi [expr $psi*1000.0]

#...................................
#Now you can input values
#without operating the conversion 
#yourself, just referencing the 
#correct unit.

#ex. d will be computed in meters
#even if it's typed in mm
set d [expr 10.0 * $mm]
