|
[求助]再求助用SelectByPolygon acSelectionSetWindowPolygon选择不到实体的问题!!!![br]下面是我的一个函数xzb构成的封闭多义线内明明有注记的内容可怎么总是选择不到呢?
Function tqjfh(zb, ds) As String '提取街坊号
Dim xzb As Variant
'ReDim xzb(ds) As Double
xzb = zb
'On Error Resume Next
Dim zjxzj As AcadSelectionSet
If Not IsNull(ThisDrawing.SelectionSets.Item("zjst")) Then
Set zjxzj = ThisDrawing.SelectionSets.Item("zjst")
zjxzj.Delete
End If
Set zjxzj = ThisDrawing.SelectionSets.Add("zjst") '新建选择集
ReDim gpCode(0 To 1) As Integer
gpCode(0) = 0
gpCode(1) = 8
ReDim dataValue(0 To 1) As Variant
dataValue(0) = "MTEXT"
dataValue(1) = "街坊注记"
Dim groupCode As Variant, dataCode As Variant
groupCode = gpCode
dataCode = dataValue
zjxzj.SelectByPolygon acSelectionSetWindowPolygon, xzb, groupCode, dataCode‘此处总是提示错误:参数pointslist(位于selectbypolygon)中无效。
'zjxzj.SelectByPolygon acSelectionSetWindowPolygon, pointsArray, groupCode, dataCode
jfh = "320506" + zjxzj.Item(0).TextString '
'以上提取街坊坐标和街坊号
tqjfh = jfh
End Function
|
|