CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

ArrowheadBlock 属性 (ActiveX)

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

ArrowheadBlock 属性 (ActiveX)

指定要用作径向尺寸或引线的自定义箭头的块。

支持的平台:仅限 Windows

签名

VBA:

object.ArrowheadBlock
对象

类型:DimRadialDimRadialLargeLeaderMLeader、MLeaderLeader

此属性应用于的对象。

属性值

只读:

类型:字符串

用作引线箭头的块的名称。

言论

注意:此属性将覆盖给定维度的 DIMLDRBLK 系统变量的值。

例子

VBA:

Sub Example_ArrowHeadBlock()
    ' This example creates a radial dimension object in model space
    ' and then alters the visible appearance (shape) of the arrowhead
    ' using the ArrowHeadBlock property.
    ' Use the ArrowHeadBlock property to set the arrowhead to an existing
    ' block object containing a custom Circle object

    Dim dimObj As AcadDimRadial
    Dim center(0 To 2) As Double
    Dim chordPoint(0 To 2) As Double
    Dim leaderLen As Integer
    Dim BlockName As String
    
    ' Define the dimension
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    chordPoint(0) = 5#: chordPoint(1) = 5#: chordPoint(2) = 0#
    leaderLen = 5
    
    ' Create the radial dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRadial(center, chordPoint, leaderLen)
    ZoomAll
    
    ' Set arrowhead type to user-defined to allow
    ' the use of a block as the new arrowhead
    'dimObj.ArrowheadType = acArrowUserDefined
    dimObj.ArrowheadBlock = "CBlock"
    ZoomAll
    
    ' Read and display current arrowhead block name
    BlockName = dimObj.ArrowheadBlock
    
    MsgBox "The arrowhead block name for this object is: " & BlockName
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_ArrowHeadBlock()
    ;; This example creates a radial dimension object in model space
    ;; and then alters the visible appearance (shape) of the arrowhead
    ;; using the ArrowHeadBlock property.
    ;; Use the ArrowHeadBlock property to set the arrowhead to an existing
    ;; block object containing a custom Circle object
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Define the dimension
    (setq center (vlax-3d-point 0 0 0)
          chordPoint (vlax-3d-point 5 5 0)
          leaderLen 5)
    
    ;; Create the radial dimension in model space
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq dimObj (vla-AddDimRadial modelSpace center chordPoint leaderLen))
    (vla-ZoomAll acadObj)
    
    ;; Use the custom block as the new arrowhead, the block must exist in the drawing
    (vla-put-ArrowheadBlock dimObj "CBlock")
    (vla-ZoomAll acadObj)
    
    ;; Read and display current arrowhead block name
    (setq BlockName (vla-get-ArrowheadBlock dimObj))
    
    (alert (strcat "The arrowhead block name for this object is: " BlockName))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 12:53

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部