CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2023 开发者帮助

AddMLine 方法 (ActiveX)

2024-5-18 18:55| 发布者: admin| 查看: 153| 评论: 0|原作者: admin|来自: AutoCAD

AddMLine 方法 (ActiveX)

创建通过点数组的多条线。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.AddMLine(VertexList)
对象

类型:模型空间纸空间

此方法应用到的对象。

顶点列表

访问:仅输入

类型:变体(双打数组)

指定多线顶点的 3D WCS 坐标数组。

返回值 (RetVal)

类型: MLine

新创建的对象。MLine

言论

没有其他评论。

例子

VBA:

Sub Example_AddMLine()
   ' This example adds an Mline in model space

    Dim mLineObj As AcadMLine
    Dim vertexList(0 To 17) As Double
   
    ' Define data for new object
    vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
    vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
    vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
    vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
    vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
    vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 6

    ' Create the line in model space
    Set mLineObj = ThisDrawing.ModelSpace.AddMLine(vertexList)

    ThisDrawing.Application.ZoomAll
    
    MsgBox "A new MLine has been added to the drawing."
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_AddMLine()
    ;; This example adds an Mline in model space
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define data for new object
    (setq vertexList (vlax-make-safearray vlax-vbDouble '(0 . 17)))
    (vlax-safearray-fill vertexList '(4 7 0
                                      5 7 0
                                      6 7 0
                                      4 6 0
                                      5 6 0
                                      6 6 0
                                     )
    )

    ;; Create the line in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq mLineObj (vla-AddMLine modelSpace vertexList))

    (vla-ZoomAll acadObj)
    
    (alert "A new MLine has been added to the drawing.")
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-5 17:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部