CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

箭头类型属性 (ActiveX)

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

摘要: 指定径向尺寸、引线或引线的箭头类型。

指定径向尺寸、引线或引线的箭头类型。

支持的平台:仅窗口

签名

工 务 局:

object.ArrowheadType
对象

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

此属性适用的对象。

属性值

只读:

类型:枚举acDimArrowheadType

  • acArrowDefault
  • acArrowDot
  • acArrowDotSmall
  • acArrowDotBlank
  • acArrowOrigin
  • acArrowOrigin2
  • acArrowOpen
  • acArrowOpen90
  • acArrowOpen30
  • acArrowClosed
  • acArrowSmall
  • acArrowNone
  • acArrowOblique
  • acArrowBoxFilled
  • acArrowBoxBlank
  • acArrowClosedBlank
  • acArrowDatumFilled
  • acArrowDatumBlank
  • acArrowIntegral
  • acArrowArchTick
  • acArrowUserDefined只读

言论

此属性的初始值为。acArrowDefault

当您使用 该属性指定要用作自定义箭头的块时,此属性将设置为 。ArrowheadBlockacArrowUserDefined

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

例子

工 务 局:

Sub Example_ArrowHeadType()
    ' This example creates a Leader object in model space with an associated Annotation
    ' and then alters the visible appearance (shape) of its arrowhead
    ' using the ArrowHeadType property

    Dim leaderObj As AcadLeader, MTextObj As AcadMText
    Dim points(0 To 8) As Double, insertionPoint(0 To 2) As Double, iTextWidth As Double
    Dim leaderType As Integer
    Dim annotationObject As Object
    Dim textString As String
    
    ' Define the new MText object
    textString = "Hello, World."
    insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
    iTextWidth = 2
    
    ' Create the MText object in model space
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, iTextWidth, textString)
    
    ' Data for Leader
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    points(6) = 4: points(7) = 5: points(8) = 0
    leaderType = acLineWithArrow
       
    ' Create the Leader object in model space and Associate new MText object
    ' with new Leader by making the MText object the annotation for the Leader
    Set annotationObject = MTextObj
    Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for this object is: " & leaderObj.ArrowheadType

    ' Alter the arrowhead type property for this object
    leaderObj.ArrowheadType = acArrowBoxBlank
    ThisDrawing.Application.ZoomAll
    
    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for this object is now set to: " & leaderObj.ArrowheadType
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ArrowHeadType()
    ;; This example creates a Leader object in model space with an associated Annotation
    ;; and then alters the visible appearance (shape) of its arrowhead
    ;; using the ArrowHeadType property
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Define the new MText object
    (setq insertionPoint (vlax-3d-point 5 5 0)
          textString "Hello, World."
	  iTextWidth 2)
    
    ;; Create the MText object in model space
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq MTextObj (vla-AddMText modelSpace insertionPoint iTextWidth textString))
    
    ;; Data for Leader
    (setq points (vlax-make-safearray vlax-vbDouble '(0 . 8)))
    (vlax-safearray-fill points '(0 0 0
				  4 4 0
				  4 5 0
				 )
    )
    (setq leaderType acLineWithArrow)
       
    ;; Create the Leader object in model space and Associate new MText object
    ;; with new Leader by making the MText object the annotation for the Leader
    (setq annotationObject MTextObj)
    (setq leaderObj (vla-AddLeader modelSpace points annotationObject leaderType))
    (vla-ZoomAll acadObj)

    ;; Read and display current arrowhead type
    (alert (strcat "The arrowhead type for this object is: " (itoa (vla-get-ArrowheadType leaderObj))))

    ;; Alter the arrowhead type property for this object
    (vla-put-ArrowheadType leaderObj acArrowBoxBlank)
    (vla-ZoomAll acadObj)
    
    ;; Read and display current arrowhead type
    (alert (strcat "The arrowhead type for this object is now set to: " (itoa (vla-get-ArrowheadType leaderObj))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 04:33

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部