• VB编程修改AutoCAD坐标型尺寸标注


    坐标型尺寸标注的编辑与长度性尺寸标注的编辑相似,属性相同,为了使标注更加清楚,可以利用TextPrefix属性给坐标型尺寸标注添加汉字前缀,下面的代码标注一个圆的中心坐标,分别设置引导线终点坐标和被标注点坐标的X或Y值相等,并给坐标添加汉字前缀。

    Private Sub Command1_Click()
        Dim dimobj As AcadDimOrdinate
        Dim definingpoint(0 To 2) As Double
        Dim leaderendpoint(0 To 2) As Double
        Dim usexaxis As Boolean
        definingpoint(0) = 12#: definingpoint(1) = 25#: definingpoint(2) = 0#
        leaderendpoint(0) = 12#: leaderendpoint(1) = 45#: leaderendpoint(2) = 0#
        usexaxis = True
        Set dimobj = acadapp.ActiveDocument.ModelSpace.AddDimOrdinate(definingpoint, leaderendpoint, usexaxis)
        acadapp.ActiveDocument.ActiveTextStyle.fontFile = "C:\windows\fonts\vani.ttf"
        dimobj.TextPrefix = "圆心X坐标="
        Dim cricleobj As AcadCircle
        Set circleobj = acadapp.ActiveDocument.ModelSpace.AddCircle(definingpoint, 10)
        leaderendpoint(0) = 0#: leaderendpoint(1) = 25#: leaderendpoint(2) = 0#
        usexaxis = False
        Set dimobj = acadapp.ActiveDocument.ModelSpace.AddDimOrdinate(definingpoint, leaderendpoint, usexaxis)
        dimobj.TextPrefix = "圆心Y坐标="
        ZoomExtents
    End Sub

    作者:codee
    文章千古事,得失寸心知。


  • 相关阅读:
    播放m3u文件时不能时时更新的问题
    Oracle视图详解
    Oracle视图的作用与安全性
    Ext GridPanel 表头合并
    [AJAX] 001 AJAX核心操作
    [Java] 系统环境变量配置
    [AJAX] 002 AJAX异步验证
    判断文章/帖子操作权限
    让Tee 7.x版本和FastReport 3.x版本共存
    mysql基本语句
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2503160.html
Copyright © 2020-2023  润新知