CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

关于覆盖标注样式 (VBA/ActiveX)

2023-1-4 22:58| 发布者: admin| 查看: 980| 评论: 0|来自: AutoCAD

摘要: 每个维度都能够覆盖该维度的维度样式中的设置。

每个维度都能够覆盖该维度的维度样式中的设置。

以下属性可用于大多数维度对象:

AltRoundDistance
指定备用单位的舍入。
角度格式
指定角度尺寸的单位格式。
箭头1块, 箭头2块
指定要用作尺寸线的自定义箭头的块。
箭头1类型, 箭头2类型
指定尺寸线的箭头类型。
箭头大小
指定尺寸线箭头、引出线箭头和钩线的大小。
中心标记大小
指定径向尺寸和直径尺寸的中心标记的大小。
中心类型
指定径向尺寸和直径尺寸的中心标记类型。
十进制分隔符
指定要在十进制维度和容差值中用作小数分隔符的字符。
尺寸线颜色
指定尺寸、引线或公差对象的尺寸线的颜色。
尺寸线重量
指定尺寸线的线宽。
暗线1抑制, 暗线2抑制
指定尺寸线的隐含。
暗线内部
指定仅在延长线内显示尺寸线。
扩展线颜色
指定尺寸扩展线的颜色。
ExtensionLineExtend
指定延长线超出尺寸线的距离。
ExtensionLineOffset
指定延伸线与原点偏移的距离。
分机线权重
指定延长线的线宽。
ExtLine1EndPoint, ExtLine2EndPoint
指定扩展线的终结点。
ExtLine1StartPoint, ExtLine2StartPoint
指定延长线的起点。
ExtLine1Suppress, ExtLine2Suppress
指定延长线的隐含。
适合
指定文本和箭头在延伸线内或外的位置。
力线内部
指定是否在延长线之间绘制尺寸线,即使文本放置在延长线之外也是如此。
分数格式
指定尺寸和公差中分数值的格式。
水平文本位置
指定尺寸文本的水平对齐。
线性比例因子
指定线性尺寸标注测量的全局比例因子。
主要单位精度
指定为尺寸或公差的主要单位显示的小数位数。
抑制前导零,抑制尾随零
指定禁止显示维度值中的前导零和尾随零。
抑制零英尺,抑制零英寸
指定在尺寸值中抑制零英尺和零英寸测量值。
TextColor
Specifies the color of the text for dimension and tolerance objects.
TextGap
Specifies the distance between the dimension text and the dimension line when you break the dimension line to accommodate dimension text.
TextHeight
Specifies the height for the dimension or tolerance text.
TextInside
Specifies if the dimension text is to be drawn inside the extension lines.
TextInsideAlign
Specifies the position of dimension text inside the extension lines for all dimension types except ordinate.
TextMovement
Specifies how dimension text is drawn when text is moved.
TextOutsideAlign
Specifies the position of dimension text outside the extension lines for all dimension types except ordinate.
TextPosition
Specifies the dimension text position.
TextPrecision
Specifies the precision of angular dimension text.
TextPrefix
Specifies the dimension value prefix.
TextRotation
Specifies the rotation angle of the dimension text.
TextSuffix
Specifies the dimension value suffix.
ToleranceDisplay
Specifies if tolerances are displayed with the dimension text.
ToleranceHeightScale
Specifies a scale factor for the text height of tolerance values relative to the dimension text height.
ToleranceJustification
Specifies the vertical justification of tolerance values relative to the nominal dimension text.
ToleranceLowerLimit
Specifies the minimum tolerance limit for dimension text.
TolerancePrecision
Specifies the precision of tolerance values in primary dimensions.
ToleranceSuppressLeadingZeros
Specifies the suppression of leading zeros in tolerance values.
ToleranceSuppressTrailingZeros
Specifies the suppression of trailing zeros in dimension values.
ToleranceUpperLimit
Specifies the maximum tolerance limit for dimension text.
UnitsFormat
指定除角度以外的所有尺寸的单位格式。
垂直文本位置
指定文本相对于尺寸线的垂直位置。

为对齐尺寸输入用户定义的后缀

本示例在模型空间中创建一个对齐的尺寸,并使用该属性允许用户更改该尺寸的文本后缀。TextSuffix

Sub Ch5_AddTextSuffix()
    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim suffix As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace. _
 AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll
    ' Allow the user to change the text suffix for the dimension
    suffix = InputBox("Enter a new text suffix for the dimension" _
 , "Set Dimension Suffix", ":SUFFIX")

    ' Apply the change to the dimension
    dimObj.TextSuffix = suffix
    ThisDrawing.Regen acAllViewports
End Sub

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 15:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部