ArrowheadBlock 属性 (ActiveX) 
指定要用作径向尺寸或引线的自定义箭头的块。 支持的平台:仅限 Windows 签名VBA: object.ArrowheadBlock 
 属性值只读:不 类型:字符串 用作引线箭头的块的名称。 言论注意:此属性将覆盖给定维度的 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))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-5 00:06
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.