Function Entry: TRANS

← Prev | ↑ Chapter | Next → | Index | Symbols

Function Entry: TRANS

Name

trans

Class

Function

Syntax

(trans pt from to [disp])

Arguments and Values

  • pt: a list of three reals, interpreted as a 3D point or as a 3D displacement.
  • from: an integer, list, or ename naming the source coordinate system. Designators are:
    • 0: WCS — World Coordinate System
    • 1: UCS — current User Coordinate System
    • 2: DCS — viewport Display Coordinate System
    • 3: PSDCS — paper-space DCS (only valid as the to designator and only from 2)
    • an ename: the Object Coordinate System of that entity
    • a list (extrusion vector): the OCS implied by that extrusion
  • to: same designator vocabulary as from.
  • disp (optional): when non-nil, treats pt as a displacement rather than a point (so translation components of the transform are skipped).

Description

Translates a point or a displacement from one coordinate system to another. When converting between systems whose Z-axes differ, this function applies the proper rotation.

Return Values

A 3D point (or displacement) expressed in the to coordinate system.

Side Effects

None.

Examples

  • (trans '(1.0 2.0 3.0) 0 1) returns (2.0 -1.0 3.0) when the UCS is rotated 90° counter-clockwise relative to the WCS.
  • (trans text-insert-point text-ename 1) converts a text-entity insertion point from its OCS to the current UCS.
  • (trans '(1 2 3) 1 circle-ename) converts a UCS displacement to a circle's OCS.

Availability

  • AutoCAD 2026: documented.
  • BricsCAD V26: presumed compatible.
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.