Command: xform

Syntax

xform { <elist> ... }

Description

Transform graphic entities. This is basically the commands rotate, stretch, and shift, rolled into one.

Parameters

Switches

Notes

The current angle mode (angle_mode) is used when evaluating rotation angles. The rotation about an axis is counterclockwise. If local axes are in effect in the current graphic window, all operations are performed relative to these axes.

Sub-entities of compounds may be manipulated in isolation from their parent entities, but not when operating in "variable mapsheet" mode.

Examples

Rotate all entities in the these group.

xform -z=45

Rotate about a specific point, then shift, all entities in the these group.

xform -p=(100,100),-z=45,-sh=e:500&n:500

Consider an array of mapsheet transformations:

atable xforms
structure ~xforms.mapsheet_t {
   string m_name
   numeric m_xform[6]
}
~xforms.mapsheet_t mapsheets[]
mapsheets[1].m_name = 'sheet1'
mapsheets[1].m_xform = <500,500,2*degs,0,1000,0>
mapsheets[2].m_name = 'sheet2'
mapsheets[2].m_xform = <500,500,4*degs,0,2000,0>
mapsheets[3].m_name = 'sheet3'
mapsheets[3].m_xform = <500,500,-2*degs,0,3000,0>

Consider also some entity objects of the following 2 classes:

atable streets
gstructure ~streets.road_gt {
   string msheet
}
compound ~streets.road_ct {
   string msheet
   entity e[]
}

Note how both classes have a member msheet.
We will not include the entity creation code here, but will assume that every object has an msheet value of 'sheet1','sheet2' or 'sheet3'.
We can now transform the objects, e.g.

xform all,-mem='msheet',-mps=mapsheets

Those objects with an msheet value of 'sheet1', will get transformed by the mapsheet[1] transform,
those with an msheet value of 'sheet2', will get transformed by the mapsheet[2] transform, and so on.

See Also

Commands:

axes, entity, enlarge, mirror, rotate, shift, stretch, group

Identifiers:

angle_mode (string), current_filter (filter), these (group)

Structures:

entity