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

6.23 CADAddString

CADAddString adds a single- or multi-line String object to a drawing or a block.

IO Parameter Type Description
in theCADArea longint Area ID
in theBlockID longint A Block ID or kCADRootBlockID for the root drawing
in theLayerOrSubLayerID longint Layer ID or Sublayer ID
in theText text The string or text
in theBaseX real The X-coordinate of the insertion point
in theBaseY real The Y-coordinate of the unrotated base line
in theRotation real The rotation Angle of the string
in theMacFontStr Str255 A Font string, to be used on Macintosh
in theDosFontStr Str255 A Font string, to be used on Windows
in theFontSize real A fontsize, expressed in 4D CAD Units (not in points)
in theFontStyle integer A mask of font style constants
in theJustificationH integer A string horizontal justification constant
in theJustificationV integer A string vertical justification constant or 0 for single-line strings
in theTextColor longint Color or a color constant
in theTextMaxLength longint A string maximum length constant or any maximum-length value up to kCADMaxStringLengthText4D
in theMultiLineFlag integer A boolean constant that specifies whether the string can have multiple lines, either by hard breaks through CR and/or LF characters, or by automatic wrapping to a specified width
in theOptionalBoxWidth real Optional wrapping-width of a multi-line string-box, otherwise 0.0.
in theOptionalBoxHeight real Optional clipping-height of a multi-line string-box, otherwise 0.0. Must be 0.0 if theOptionalBoxWidth is 0.0
in theOptionalLineHeight real Optional line-height of multi-line strings, expressed in 4D CAD Units (not in points). If 0.0, then the line-height is calculated from the default spacing of the font
out theNewObjID longint Object ID of the new object
out function result OSErr Error result code, also see Error handling

If theMultiLineFlag is kCADFalse but theText contains a LineFeed (LF) or Carriage Return (CR) character, then error kCADFoundCRorLFInString is returned.

Related methods
CADObjString, CADGetString, CADSetString, CADGetStringXY, CADSetStringXY, CADGetFont, CADSetFont, CADStringBounds.