Specifies the direction in which the mtext paragraph is to be read.
Supported platforms: Windows only
VBA:
object.DrawingDirection
Type: GeoPositionMarker, MText
The object this property applies to.
Read-only: No
Type: acDrawingDirection enum
For languages such as English or Spanish, text is read horizontally, left to right. For languages such as Chinese or Japanese, sometimes text is read vertically, top to bottom. AutoCAD will draw the text according to this property setting.
Left to right
Top to bottom
The settings acRightToLeft, acBottomToTop, and acByStyle are reserved for future use and cannot be used in this release.
VBA:
Sub Example_DrawingDirection() ' This example changes the drawing direction for an MText object ' in model space. Dim MTextObj As AcadMText Dim corner1(0 To 2) As Double Dim width As Double Dim text As String ' Define the MText object corner1(0) = 0#: corner1(1) = 6#: corner1(2) = 0# width = 7 text = "This is a text String." ' Create the MText object in model space Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner1, width, text) ZoomAll 'Change the drawing direction of the MText object MTextObj.DrawingDirection = acLeftToRight ZoomAll MsgBox "The DrawingDirection of the text is left to right.", vbInformation, "DrawingDirection Example" MTextObj.DrawingDirection = acTopToBottom ZoomAll MsgBox "The DrawingDirection of the text is top to bottom.", vbInformation, "DrawingDirection Example" ' Return the drawing direction Dim retDirection As Integer retDirection = MTextObj.DrawingDirection End Sub
Visual LISP:
(vl-load-com) (defun c:Example_DrawingDirection() ;; This example changes the drawing direction for an MText object ;; in model space. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the MText object (setq corner1 (vlax-3d-point 0 6 0) width 7 text "This is a text String.") ;; Create the MText object in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq MTextObj (vla-AddMText modelSpace corner1 width text)) (vla-ZoomAll acadObj) ;; Change the drawing direction of the MText object (vla-put-DrawingDirection MTextObj acLeftToRight) (vla-ZoomAll acadObj) (alert "The DrawingDirection of the text is left to right.") (vla-put-DrawingDirection MTextObj acTopToBottom) (vla-ZoomAll acadObj) (alert "The DrawingDirection of the text is top to bottom.") ;; Return the drawing direction (setq retDirection (vla-get-DrawingDirection MTextObj)) (alert (strcat "The current value of DrawingDirection: " (itoa retDirection))) )