coordsys

The [ in ] coordsys <coordsys_spec> context corresponds to the current reference coordinate system list in the main 3ds Max toolbar. Prefixing an expression, operation, or block-expression with a coordsys context causes 3D coordinate operations to be interpreted in the specified coordinate system. Moving, scaling, or rotating objects, or setting transform-related properties within a coordsys context operate in relation to the given coordsys. Accessing coordinate properties such as position, center, rotation axis, and so on, within a coordsys context causes those values to be delivered relative to the given coordsys.

The following forms are supported:

[ in ] coordsys world

use the world space coordinate system

[ in ] coordsys local

use the object's local coordinate system

[ in ] coordsys parent

use the object's parent's coordinate system

[ in ] coordsys grid

use the active grid’s coordinate system

[ in ] coordsys screen

use the currently active viewport’s coordinate system

[ in ] coordsys <node>

use the specified node's local coordinate system - this is equivalent to the "pick" coordinate system capability in the 3ds Max user interface

[ in ] coordsys <matrix3>

use the coordinate system specified by the given 3D matrix

Examples:

-- randomly jiggle each object in the selection around +/- 20 units

in coordsys local selection.pos = random [-20,20,20] [20,20,20]

-- rotate objects in parent’s coordinate system

in coordsys parent rotate selection (EulerAngles 0 0 90)