移動先: 概要 戻り値 フラグ. MEL 例.
convertUnit [-fromUnit string] [-toUnit string]
string
convertUnit は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
このコマンドを使うと、異なる測定単位間で値が変換されます。値だけでなく単位名も使用できるため、このコマンドは文字列を取ります(例を参照)。
fromUnit, toUnit
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
-fromUnit(-f)
|
string
|
|
|
変換前の単位。指定しない場合は、システム デフォルトとみなされます。11.2m(11.2メートル)のように、値の一部として変換前の単位を指定できます。
|
|
-toUnit(-t)
|
string
|
|
|
変換後の単位。指定しない場合は、システム デフォルトとみなされます。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// Returns string "4.80315in", which is 12.2cm in inches.
convertUnit -fromUnit "cm" -toUnit "in" "12.2";
// Returns string "3.499563yd", which is 3.2m in yards.
convertUnit -toUnit "yard" "3.2m";
// Returns float value 13.716, which is 5.4 inches in cm (default system units).
convertUnit -fromUnit "inch" "5.4";