明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1412|回复: 2

如何用VBA在CAD中添加新字段?

[复制链接]
发表于 2007-9-6 13:04:00 | 显示全部楼层 |阅读模式

如题,并不是cad中已有的字段,而是自已在文件属性中加入的,比如“图号”、“设计院名称”等,查了vba手册,没有找到

发表于 2007-9-7 08:26:00 | 显示全部楼层
Sub Ch4_CreateMText()
    Dim mtextObj As AcadMText
    Dim insertPoint(0 To 2) As Double
    Dim width As Double
    Dim textString As String

    insertPoint(0) = 2
    insertPoint(1) = 2
    insertPoint(2) = 0
    width = 4
    textString = "This is a text string for the mtext object."

    ' 在模型空间中创建文字对象
    Set mtextObj = ThisDrawing.ModelSpace. _
               AddMText(insertPoint, width, textString)
    ZoomAll
End Sub
 楼主| 发表于 2007-9-7 09:57:00 | 显示全部楼层

mtext?我问的可是字段啊

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-22 05:22 , Processed in 0.136821 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表