CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

CenterMarkSize Property (ActiveX)

2023-1-3 20:53| 发布者: admin| 查看: 457| 评论: 0|来自: AutoCAD

摘要: 指定径向尺寸和直径尺寸的中心标记的大小。

指定径向尺寸和直径尺寸的中心标记的大小。

支持的平台:仅窗口

签名

工 务 局:

object.CenterMarkSize
对象

类型:暗径,暗径,暗径

此属性适用的对象。

属性值

只读:

类型:

一个正实数,指定中心标记或线条的大小。

言论

此属性的初始值为 0.0900。

如果此属性设置为 。CenterTypeacCenterNone

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

例子

工 务 局:

Sub Example_CenterMarkSize()
    ' This example creates a diametric dimension in model space.
    ' It then changes the type of center for the dimension to
    ' center mark, and adjusts the size of the center mark.
    
    Dim dimObj As AcadDimDiametric
    Dim chordPoint(0 To 2) As Double
    Dim farChordPoint(0 To 2) As Double
    Dim leaderLength As Double
    
    ' Define the dimension
    chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
    farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
    leaderLength = 1#
    
    ' Create the diametric dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
    ZoomAll
        
    ' Change the center type to center mark and set the size of the center mark
    dimObj.CenterType = acCenterMark
    dimObj.CenterMarkSize = 0.1
    dimObj.Update
    MsgBox "The center mark size is: " & dimObj.CenterMarkSize
    
    dimObj.CenterMarkSize = dimObj.CenterMarkSize * 2
    dimObj.Update
    MsgBox "The center mark size is: " & dimObj.CenterMarkSize
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_CenterMarkSize()
    ;; This example creates a diametric dimension in model space.
    ;; It then changes the type of center for the dimension to
    ;; center mark, and adjusts the size of the center mark.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define the dimension
    (setq chordPoint (vlax-3d-point 5 3 0)
          farChordPoint (vlax-3d-point 5 5 0)
          leaderLength 1)
    
    ;; Create the diametric dimension in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimDiametric modelSpace chordPoint farChordPoint leaderLength))
    (vla-ZoomAll acadObj)
        
    ;; Change the center type to center mark and set the size of the center mark
    (vla-put-CenterType dimObj acCenterMark)
    (vla-put-CenterMarkSize dimObj 0.1)
    (vla-Update dimObj)
    (alert (strcat "The center mark size is: " (rtos (vla-get-CenterMarkSize dimObj) 2)))
    
    (vla-put-CenterMarkSize dimObj (* (vla-get-CenterMarkSize dimObj) 2))
    (vla-Update dimObj)
    (alert (strcat "The center mark size is: " (rtos (vla-get-CenterMarkSize dimObj) 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 15:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部