CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

ExtLine1StartPoint 属性 (ActiveX)

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

ExtLine1StartPoint 属性 (ActiveX)

指定第一条延长线的起点。

支持的平台:仅限 Windows

签名

VBA:

object.ExtLine1StartPoint
对象

类型:DimAngular

此属性应用于的对象。

属性值

只读:

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

表示第一条延伸线起点的 3D 坐标。

言论

and 属性等于方法中的 and 参数。延伸线最初是从 和 位置绘制到尺寸线的交点。AutoCAD 将尺寸标注线绘制为延长线之间的圆弧。ExtLine1StartPointExtLine2StartPointFirstEndPointSecondEndPointAddDimAngularFirstEndPointSecondEndPoint



例子

VBA:

Sub Example_ExtLine1StartPoint()
    ' This example creates an angular dimension. It then changes
    ' the location of the ExtLine1StartPoint.
    
    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    
    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#
    
    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll
    MsgBox "The current value of ExtLine1StartPoint is " & dimObj.ExtLine1StartPoint(0) & ", " & dimObj.ExtLine1StartPoint(1) & ", " & dimObj.ExtLine1StartPoint(2), vbInformation, "ExtLine1StartPoint Example"
    
    ' Change the start point of the first extension line
    FirstPoint(0) = 0: FirstPoint(1) = 3: FirstPoint(2) = 0
    dimObj.ExtLine1StartPoint = FirstPoint
    dimObj.Update
    
    ' Return the start point of the first extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine1StartPoint
    MsgBox "The new value of ExtLine1StartPoint is " & dimObj.ExtLine1StartPoint(0) & ", " & dimObj.ExtLine1StartPoint(1) & ", " & dimObj.ExtLine1StartPoint(2), vbInformation, "ExtLine1StartPoint Example"
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_ExtLine1StartPoint()
    ;; This example creates an angular dimension. It then changes
    ;; the location of the ExtLine1StartPoint.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the dimension
    (setq AngleVertex (vlax-3d-point 0 5 0)
          FirstPoint (vlax-3d-point 1 7 0)
          SecondPoint (vlax-3d-point 1 3 0)
          TextPoint (vlax-3d-point 3 5 0))

    ;; Create the angular dimension in model space
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq dimObj (vla-AddDimAngular modelSpace AngleVertex FirstPoint SecondPoint TextPoint))
    (vla-ZoomAll acadObj)

    (setq extLineStartPoint (vlax-safearray->list (vlax-variant-value (vla-get-ExtLine1StartPoint dimObj))))
    (alert (strcat "The current value of ExtLine1StartPoint is " (rtos (nth 0 extLineStartPoint) 2) ", "
		                                                 (rtos (nth 1 extLineStartPoint) 2) ", "
		                                                 (rtos (nth 2 extLineStartPoint) 2)))
    
    ;; Change the start point of the first extension line
    (setq FirstPoint (vlax-3d-point 0 3 0))
    (vla-put-ExtLine1StartPoint dimObj FirstPoint)
    (vla-Update dimObj)
    
    ;; Return the start point of the first extension line
    ;; Note that the return value is a Variant
    (setq retPnt (vlax-safearray->list (vlax-variant-value (vla-get-ExtLine1StartPoint dimObj))))
    (alert (strcat "The new value of ExtLine1StartPoint is " (rtos (nth 0 retPnt) 2) ", "
		                                             (rtos (nth 1 retPnt) 2) ", "
		                                             (rtos (nth 2 retPnt) 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-28 17:14

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部