MAXScript Language Reference > Names, Literal Constants, and Expressions > Context Expressions >

# 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)