明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1338|回复: 1

[VBA]请教一个关于取得文本内容的问题

[复制链接]
发表于 2004-11-3 15:45:00 | 显示全部楼层 |阅读模式
我已经通过选择集过滤选择了text和mtext,我怎样取得每个文本的内容呢? 哪位高手给段代码,谢谢了。 Option Explicit
Public SSetObj As AcadSelectionSet

Private Sub www()
Dim fType As Variant
Dim fData As Variant

On Error Resume Next
Set SSetObj = ThisDrawing.SelectionSets("test")
If Err.Number <> 0 Then
Err.Clear
Set SSetObj = ThisDrawing.SelectionSets.Add("test")
End If
SSetObj.Clear
BuildFilter fType, fData, -4, "<or", 0, "text", 0, "mtext", _
0, "AcDbAlignedDimension", 0, "AcDbRotatedDimension", -4, "or>"
SSetObj.SelectOnScreen fType, fData


End Sub Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes())
Dim fType() As Integer, fData()
Dim index As Long, i As Long

index = LBound(gCodes) - 1

For i = LBound(gCodes) To UBound(gCodes) Step 2
index = index + 1
ReDim Preserve fType(0 To index)
ReDim Preserve fData(0 To index)
fType(index) = CInt(gCodes(i))
fData(index) = gCodes(i + 1)
Next
typeArray = fType: dataArray = fData
End Sub
发表于 2004-11-3 17:57:00 | 显示全部楼层
[WEB]http://www.vba.cn/object/acad2004/idh_textstring.htm[/WEB]

[WEB]http://www.vba.cn/object/acad2004/idh_textoverride.htm[/WEB]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 00:54 , Processed in 0.177948 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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