我图形中有的图元包含如下的扩展数据 Dim datatype(0 To 7) As Integer Dim data(0 To 7) As Variant datatype(0) = 1001: data(0) = "" datatype(1) = 1000: data(1) = jfh datatype(2) = 1003: data(2) = "0" datatype(3) = 1040: data(3) = 1.232 datatype(4) = 1041: data(4) = 100’此处有时候为100,有时候为0 datatype(5) = 1070: data(5) = jfid datatype(6) = 1071: data(6) = zdh + 1 datatype(7) = 1042: data(7) = 10 ty.SetXData datatype, data ThisDrawing.Application.Update 我想构建扩展数据里data(4) = 100的图元的选择集,可怎么总是出错呀?请高手指点 下面是我的代码 Sub pd() On Error Resume Next Dim p1(0 To 2) As Double Dim p2(0 To 2) As Double Dim fType, fData As Variant 'p1(0) = 100 'p1(1) = 100 'p1(2) = 0 'p2(0) = 500 'p2(1) = 500 'p2(2) = 0 Dim x, y As Double Dim dh As Long fType(0) = 1041: fData(0) = 100 'ftype(1) = 2: fdata(1) = "界址圈" 'Call CreateSSetFilter(fType, fData, 1041, 100) 'tyxzj.Select acSelectionSetAll, , , fType, fData Dim ggdxzj As AcadSelectionSet If Not IsNull(ThisDrawing.SelectionSets.Item("jzq")) Then Set ggdxzj = ThisDrawing.SelectionSets.Item("jzq") ggdxzj.Delete End If Set ggdxzj = ThisDrawing.SelectionSets.Add("jzq") ggdxzj.Select acSelectionSetAll, , , fType, fData 'ggdxzj.Select acSelectionSetWindow, p1, p2 'tyxzj.Select acSelectionSetAll, , , ftype, fdata End Sub |