[VBA]请教一个关于取得文本内容的问题
我已经通过选择集过滤选择了text和mtext,我怎样取得每个文本的内容呢?哪位高手给段代码,谢谢了。
Option Explicit<BR>Public SSetObj As AcadSelectionSet<BR><BR>Private Sub www()<BR> Dim fType As Variant<BR> Dim fData As Variant<BR> <BR> On Error Resume Next<BR> Set SSetObj = ThisDrawing.SelectionSets("test")<BR> If Err.Number <> 0 Then<BR> Err.Clear<BR> Set SSetObj = ThisDrawing.SelectionSets.Add("test")<BR> End If<BR> SSetObj.Clear<BR> BuildFilter fType, fData, -4, "<or", 0, "text", 0, "mtext", _<BR> 0, "AcDbAlignedDimension", 0, "AcDbRotatedDimension", -4, "or>"<BR> SSetObj.SelectOnScreen fType, fData<BR><BR><BR>End Sub
Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes())<BR> Dim fType() As Integer, fData()<BR> Dim index As Long, i As Long<BR> <BR> index = LBound(gCodes) - 1<BR> <BR> For i = LBound(gCodes) To UBound(gCodes) Step 2<BR> index = index + 1<BR> ReDim Preserve fType(0 To index)<BR> ReDim Preserve fData(0 To index)<BR> fType(index) = CInt(gCodes(i))<BR> fData(index) = gCodes(i + 1)<BR> Next<BR> typeArray = fType: dataArray = fData<BR>End Sub http://www.vba.cn/object/acad2004/idh_textstring.htm
http://www.vba.cn/object/acad2004/idh_textoverride.htm
页:
[1]