CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

AddLeaderLine 方法 (ActiveX)

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

AddLeaderLine 方法 (ActiveX)

将引线添加到具有指定索引的引线集群。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.AddLeaderLine(leaderIndex, pointArray)
对象

类型:MLeader

此方法应用到的对象。

leaderIndex

访问:仅输入

类型:

要添加新引线的引线集群的索引。索引必须为正整数。

点数组

访问:仅输入

类型:变体(双打的三元素阵列)

用于创建新引线的 3D OCS 坐标。

返回值 (RetVal)

类型:

添加的引线的索引。

言论

没有其他评论。

例子

VBA:

Sub Example_MLeaderLine()
    Dim oML As AcadMLeader
    Dim points(0 To 5) As Double
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    Dim r As Long
    r = oML.AddLeader()

    points(4) = 10
    Call oML.AddLeaderLine(r, points)

    MsgBox "LeaderCount = " & oML.LeaderCount
    ZoomExtents
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_MLeaderLine()
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq points (vlax-make-safearray vlax-vbDouble '(0 . 5)))
    (vlax-safearray-fill points '(1 1 0
                                  4 4 0
				                             )
    )  
    (setq i 0)

    (setq modelSpace (vla-get-ModelSpace doc))
    (setq oML (vla-AddMLeader modelSpace points i))

    (setq r (vla-AddLeader oML))

    (vlax-safearray-put-element points 4 10)
    (vla-AddLeaderLine oML r points)

    (alert (strcat "LeaderCount = " (itoa (vla-get-LeaderCount oML))))
    (vla-ZoomExtents acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-6-27 16:07

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部