CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

绘图方向特性 (ActiveX)

2023-1-3 17:57| 发布者: admin| 查看: 631| 评论: 0|来自: AutoCAD

摘要: 指定多行文本段落的阅读方向。

指定多行文本段落的阅读方向。

支持的平台:仅窗口

签名

工 务 局:

object.DrawingDirection
对象

类型:地理位置标记MText

此属性适用的对象。

属性值

只读:

类型:枚举acDrawingDirection

  • acLeftToRight
  • acTopToBottom
  • acRightToLeft(保留供将来使用)
  • acBottomToTop(保留供将来使用)
  • acByStyle(保留供将来使用)

言论

对于英语或西班牙语等语言,文本从左到右水平阅读。对于中文或日语等语言,有时文本是从上到下垂直阅读的。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)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 19:51

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部