Next: , Previous: CADAddSubLayer, Up: CAD areas and methods

6.25 CADAlign

CADAlign aligns a number of objects horizontally and/or vertically.

IO Parameter Type Description
in theCADArea longint Area ID
in theLocking integer kCADLockingIgnoreLock or kCADLockingSkipLock
in theBlockID longint A Block ID or kCADRootBlockID for the root drawing
in theObjScope longint kCADScopeSelectedObjects, kCADScopeAllObjects, kCADScopeObjOnEditableLayers, a Layer ID, a Sublayer ID, a programmer scope ID or an Object ID
in theTypeOfBoundsToAlignOn integer The type of bounds determines what object-edges to align on. See Bounds and bounds type constants
in theLeftRightAlign integer A alignment constant
in theTopBottomAlign integer A alignment constant
in theFlipStringJustificationFlag integer A boolean constant that determines whether to change the horizontal justification of String objects (see string horizontal justification constants) with the value o theLeftRightAlign parameter (see alignment constants)
out function result OSErr Error result code, also see Error handling

CADAlign first calculates the common bounds of the speficied objects. The exact metrics will depend on the value of theTypeOfBoundsToAlignOn parameter. Next, the horizontal and vertical alignment point to use for the alignment, will be either an edge or the center of the bounds.

It is not an error if the object scope contains 0 or 1 objects.

Related methods
CADBounds, CADStringBounds, CADGetFont, CADSetFont, CADTranslate and CADAlignToGrid.