hehe ~~谢谢
Dim pl As AcadEntity Dim sss As AcadSelectionSet Set sss = ThisDrawing.SelectionSets.Add("123") Dim Gpcode(0) As Integer Gpcode(0) = 0 Dim Datavalue(0) As Variant Datavalue(0) = "lwpolyline" sss.Select acSelectionSetAll, , , Gpcode, Datavalue MsgBox sss.count For Each pl In sss If (UBound(pl.Coordinates) + 1) / 2 = 4 Then pl.Delete End If Next
哦
这个呢 炸开轮廓线并保存到选择集
Dim explodedObjects As Variant Dim outlinearr() As Variant Dim outliness As AcadSelectionSet Set outliness = ThisDrawing.SelectionSets.Add("ss") explodedObjects = plent.Explode For j = 0 To UBound(explodedObjects) - 1 explodedObjects(j).Update Set outlinearr(j) = explodedObjects(j) 'subscript out of range ????? explodedObjects(j).Update Next outliness.AddItems outlinearr
我这样没问题呀
Sub test() Dim a As Variant a = ThisDrawing.ModelSpace(0).Explode Dim ss As AcadSelectionSet Set ss = ThisDrawing.ActiveSelectionSet ss.AddItems a MsgBox ss.Count ss.Clear End Sub