求助一个关于选择集的问题,有一张CAD画的表格,想提取里面的数据,如图
行与行之间是等距的,相差14.25,该文字在行之间,并未超过,参照帮助编了一个读取的程序,不知为何,老是不能正常读出来,有的读不出来,能读的,但是数值不对!请问给为高手可能的问题出现在什么地方:
Sub SelectTEXT()
Dim i%
Dim entity As AcadEntity
Dim ssetObj As AcadSelectionSet
For i = 1 To 32
Set ssetObj = ThisDrawing.SelectionSets.Add("SS1")
Dim mode As Integer
Dim pointsArray(0 To 11) As Double
Dim FilterType(3) As Integer
Dim FilterData(3) As Variant
mode = acSelectionSetFence
pointsArray(0) = 1852.7125: pointsArray(1) = -90.3167 - 14.25 * (i - 1): pointsArray(2) = 0
pointsArray(3) = 1926.9625: pointsArray(4) = -90.3167 - 14.25 * i: pointsArray(5) = 0
pointsArray(6) = 1852.7125: pointsArray(7) = -90.3167 - 14.25 * i: pointsArray(8) = 0
pointsArray(9) = 1926.9625: pointsArray(10) = -90.3167 - 14.25 * (i - 1): pointsArray(11) = 0
FilterType(0) = -4
FilterData(0) = "<or"
FilterType(1) = 0
FilterData(1) = "TEXT"
FilterType(2) = 0
FilterData(2) = "MTEXT"
FilterType(3) = -4
FilterData(3) = "or>"
ssetObj.SelectByPolygon mode, pointsArray, FilterType, FilterData
For Each entity In ssetObj
Debug.Print entity.TextString
Next
ssetObj.Delete
Next i
End Sub
|