CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2022 开发者帮助

AddDimAligned 方法 (ActiveX)

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

AddDimAligned 方法 (ActiveX)

创建对齐的尺寸对象。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.AddDimAligned(ExtLine1Point, ExtLine2Point, TextPosition)
对象

类型:模型空间纸空间

此方法应用到的对象。

ExtLine1Point

访问:仅输入

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

指定延伸线的第一个端点的 3D WCS 坐标。

ExtLine2Point

访问:仅输入

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

指定延伸线的第二个端点的 3D WCS 坐标。

文本位置

访问:仅输入

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

指定文本位置的 3D WCS 坐标。

返回值 (RetVal)

类型:DimAligned

新创建的对齐尺寸。

言论

在对齐尺寸中,尺寸线平行于延伸线原点。延长线原点是使用 和 属性指定的。ExtLine1PointExtLine2Point



例子

VBA:

Sub Example_AddDimAligned()
    ' This example creates an aligned dimension in model space.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    
    ' Define the dimension
    point1(0) = 5#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 5#: point2(2) = 0#
    location(0) = 5#: location(1) = 7#: location(2) = 0#
    
    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_AddDimAligned()
    ;; This example creates an aligned dimension in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the dimension
    (setq point1 (vlax-3d-point 5 5 0)
          point2 (vlax-3d-point 10 5 0)
          location (vlax-3d-point 5 7 0))
    
    ;; Create an aligned dimension object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimAligned modelSpace point1 point2 location))
    (vla-ZoomAll acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-6-27 15:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部