本人想删除图中半径为0.01的面域出错(两种方法都不行),请指教
法一:
Public Sub mc() Dim ssetobj1 As AcadSelectionSet, ftyp(1) As Integer, fdat(1) As Variant, selobj As AcadEntity ThisDrawing.SelectionSets("mc").Delete Set ssetobj1 = ThisDrawing.SelectionSets.Add("mc") ftyp(0) = 0: fdat(0) = "*" ftyp(1) = 40: fdat(1) = 0.01 ssetobj1.Select acSelectionSetAll, , , ftyp, fdat For I = 0 To ssetobj1.Count - 1 Set selobj = ssetobj1.Item(I) selobj.Delete Next End Sub
法二:
Public Sub mc() Dim mic As AcadRegion For Each mic In ThisDrawing.ModelSpace If mic.Radius = 0.01 Then mic.Delete End If Next End Sub
|