ジャンプ先: 概要. 戻り値. フラグ. MEL 例.

概要

convertUnit [-fromUnit string] [-toUnit string] string

convertUnit は、取り消し可能、照会不可能、および編集不可能です。

このコマンドを使うと、異なる測定単位間で値が変換されます。値だけでなく単位名も使用できるため、このコマンドは文字列を取ります(例を参照)。

戻り値

floatまたは文字列

フラグ

fromUnit, toUnit
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
-fromUnit(-f) string create
変換前の単位。指定しない場合は、システム既定とみなされます。11.2m (11.2メートル)のように、値の一部として変換前の単位を指定できます。
-toUnit(-t) string create
変換後の単位。指定しない場合は、システム既定とみなされます。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます コマンド内でフラグを複数回使用できます。

MEL 例

// 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";