CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

箭头块属性 (ActiveX)

2023-1-3 22:32| 发布者: admin| 查看: 415| 评论: 0|来自: AutoCAD

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

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

支持的平台:仅窗口

签名

工 务 局:

object.ArrowheadBlock
对象

类型:暗径,暗径大引线MLeader,MLeaderLeader

此属性适用的对象。

属性值

只读:

类型:字符串

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

言论

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

例子

工 务 局:

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

Visual 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 )

GMT+8, 2024-5-19 13:10

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部