- Sub tt()
- On Error Resume Next
- Dim i As AcadBlockReference
- Dim ss As AcadSelectionSet
- ThisDrawing.SelectionSets("Test").Delete
- Set ss = ThisDrawing.SelectionSets.Add("Test")
- Dim ft(0) As Integer, fd(0)
- ft(0) = 0: fd(0) = "Insert"
- ss.Select acSelectionSetAll, , , ft, fd
- For Each i In ss
- MyExplode i
- Next
- ss.Delete
- End Sub Sub MyExplode(oBlk As AcadBlockReference)
- '功能:炸开嵌套块
- Dim i, objs
- Dim j As AcadBlockReference
- objs = oBlk.Explode
- oBlk.Delete
- For i = 0 To UBound(objs)
- If objs(i).ObjectName = "AcDbBlockReference" Then
- Set j = objs(i)
- MyExplode j
- End If
- Next i
- End Sub
|