| AddMText 方法 (ActiveX) 在由边界框的插入点和宽度定义的矩形中创建一个 MText 实体。 支持的平台:仅限 Windows 签名VBA: RetVal = object.AddMText(InsertionPoint, Width, Text) 言论没有其他评论。 例子VBA: Sub Example_AddMtext()
    ' This example creates an MText object in model space.
    
    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text String for the mtext Object"
    ' Creates the mtext Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll
    
End Sub可视化 LISP: (vl-load-com)
(defun c:Example_AddMtext()
    ;; This example creates an MText object in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the multiline text object
    (setq corner (vlax-3d-point 0 10 0)
          width 10
          text "This is the text String for the mtext Object")
    ;; Creates the mtext Object
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq MTextObj (vla-AddMText modelSpace corner width text))
    (vla-ZoomAll acadObj)
) | 
 |Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-10-31 06:46
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.