[VBA]VBA如何取某个范围内的所有文字呢?
<FONT face=宋体 size=2>VBA如何取某个范围内的所有文字呢?如下图中,如何取出A区内的文字“0.1111”和“0.2198呢?(假如知道了“0.1111”的坐标),谢谢。<BR>有高手说用-boundary命令生成边界,再用选择集选择多段线内的文字,具体怎么样做?</FONT> <BR><IMG src="http://p4.xdcad.net/forum/file_upload/264567_abc.jpg"> Dim FilterType(0 To 0) As Integer<BR> Dim FilterData(0 To 0) As Variant<BR> Dim corner1(0 To 2) As Double<BR> Dim corner2(0 To 2) As Double<BR> Dim ssetObj As AcadSelectionSet<BR> Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")<BR> corner1(0) = x1: corner1(1) = y1: corner1(2) = 0<BR> corner2(0) = x2: corner2(1) = y2: corner2(2) = 0
FilterType(0) = 0: FilterData(0) = "Text"<BR> ssetObj .Select acSelectionSetAll,corner1,corner2, FilterType, FilterData
<BR> dim TextObj as acadtext,Str as String<BR> for each TextObj in ssetObj<BR> Str=TextObj.Textstring<BR> next<BR> TO <A name=68464><FONT color=#000066><B>cobalt</B></FONT></A>:
x1、 y1这些变量是什么呢?谢谢 x1,y1 分别是选框的一角的x,y坐标
页:
[1]