CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

AddDimArc Method (ActiveX)

2023-1-4 13:20| 发布者: admin| 查看: 545| 评论: 0|来自: AutoCAD

摘要: 为圆弧创建圆弧长度尺寸。

为圆弧创建圆弧长度尺寸。

支持的平台:仅窗口

签名

工 务 局:

RetVal = object.AddDimArc(ArcCenter, FirstEndPoint, SecondEndPoint, ArcPoint)
对象

类型:模型空间,图纸空间

此方法适用的对象。

弧形中心

访问:仅输入

类型:变体(双精度的三元素数组)

指定弧中心的 3D WCS 坐标。

第一个端点

访问:仅输入

类型:变体(双精度的三元素数组)

指定第一条延长线通过的点的 3D WCS 坐标。

第二个端点

访问:仅输入

类型:变体(双精度的三元素数组)

指定第二条延长线通过的点的 3D WCS 坐标。

ArcPoint

访问:仅输入

类型:变体(双精度的三元素数组)

指定圆弧上的点的三维 WCS 坐标。

返回值(RetVal)

类型:暗弧长度

新创建的弧长尺寸。

言论



中心是要标注尺寸的圆弧的中心。第一端点第二端点是两条延长线通过的点。

例子

工 务 局:

Sub Example_AddDimArc()
    Dim PI As Double: PI = 3.141592
    Dim oMS As AcadModelSpace
    Set oMS = ThisDrawing.ModelSpace

    Dim ptCenter(2) As Double
    Dim oA As AcadArc
    Set oA = oMS.AddArc(ptCenter, 10, PI / 3, PI * 3 / 4)
    
    Dim ptArcPoint(2) As Double
    ptArcPoint(0) = 0: ptArcPoint(1) = 15
    
    Dim oAcadDimArcLength As AcadDimArcLength
    Set oAcadDimArcLength = oMS.AddDimArc(oA.Center, oA.startPoint, oA.endPoint, ptArcPoint)
    
    Update
    ZoomExtents
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AddDimArc()
    ;; This example creates an arc and arc length dimension in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq modelSpace (vla-get-ModelSpace doc))

    ;; Define the arc
    (setq center (vlax-3d-point 0 0 0))

    ;; Create the arc in model space
    (setq arc (vla-AddArc modelSpace center 10 (/ PI 3) (/ (* PI 3) 4)))
    
    ;; Define the arc length dimension
    (setq arcPoint (vlax-3d-point 0 15 0)
          startPoint (vla-get-StartPoint arc)
          endPoint (vla-get-EndPoint arc))
  
    ;; Create the arc length dimension in model space
    (setq dimArcLength (vla-AddDimArc modelSpace center startPoint endPoint arcPoint))
    (vla-ZoomExtents acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 17:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部