Overview
The RoseUnit enumeration identifies common units encountered in STEP data. The zero value indicates an unrecognized unit, and the "as_is" value is used to signal access functions that no unit conversion is desired.
RoseUnit Definition
class RoseUnit(IntEnum): UNKNOWN = 0 AS_IS # no conversion # length MM # millimeters CM # centimeters M # meters IN # inches INCH = IN # alias for convenience FT # feet MICROMETRE # millionth of a meter NANOMETRE # billionth of a meter MILLIINCH # thousandth of an inch MICROINCH # millionth of an inch # area MM2 # square millimeters CM2 # square centimeters M2 # square meters IN2 # square inches FT2 # square feet # volume MM3 # cubic millimeters CM3 # cubic centimeters M3 # cubic meters IN3 # cubic inches FT3 # cubic feet # angle DEG # degrees RAD # radians # solid angle STERADIAN # steradian # time SEC # seconds MIN # minutes HOUR # hours # feedrates - linear speed MMPS # millimeters per second MMPM # millimeters per minute CMPS # centimeters per second MPS # meters per second IPS # inches per second IPM # inches per minute FPS # feet per second FPM # feet per minute # feed per revolution MMPREV # millimeters per revolution IPREV # inches per revolution # feed per tooth MMPTOOTH # millimeters per tooth IPTOOTH # inches per tooth # spinspeeds - rotational speed HERTZ # revolutions per second (hz) RPM # revolutions per minute # pressure PA # pascals KPA # kilopascal MPA # megapascal PSI # pounds per square inch # force NEWTON # newtons LBF # pound force # power WATT # watts KW # kilowatts HP # horsepower # torque - full names to avoid confusion NEWTON_METER # newton meters POUND_FOOT # pound foot # temperature CELSIUS # degree Celsius KELVIN # degree Kelvin FAHRENHEIT # degree Fahrenheit RANKINE # degree Rankine # symbolic units COUNT PARAMETER RATIO REVOLUTION TOOTH MAX_VALUE
find()
@classmethod def find(cls, name:str) -> RoseUnit:
The find() function is a class method that returns the enum value for a given string. Both full and abbreviated names are recognized.
print ("FIND foot:", step.RoseUnit.find("foot"))
----------
FIND foot: RoseUnit.FT
fullname()
def fullname(self) -> str:
The fullname() function returns the full descriptive name of a unit enum value.
# print full names for every enum value for nm in sorted(step.RoseUnit.__members__.keys()): print (nm, step.RoseUnit[nm].fullname()) ---------- AS_IS default CELSIUS celsius CM centimetre CM2 square centimetre CM3 cubic centimetre CMPS centimetre/second COUNT count DEG degree ... [and so on] ...