指定多行文本段落的阅读方向。 支持的平台:仅窗口 属性值只读:不 类型:枚举acDrawingDirection
言论对于英语或西班牙语等语言,文本从左到右水平阅读。对于中文或日语等语言,有时文本是从上到下垂直阅读的。AutoCAD 将根据此属性设置绘制文本。 从左到右 从上到下 这些设置保留供将来使用,不能在此版本中使用。acRightToLeftacBottomToTopacByStyle 例子工 务 局: 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))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:24
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.