无痕/ws 17:10:02
Sub 去重()
Dim  L As AcadPolyline
Dim sel As AcadSelectionSet
On Error Resume Next
Set sel = ThisDrawing.SelectionSets.Add("ssel")
If Err Then
Err.Clear
Set sel = ThisDrawing.SelectionSets.Item ("ssel")
End If
On Error GoTo 0
sel.SelectOnScreen
Dim Ent1, Ent2 As AcadEntity
Dim n%, i%, j%
Dim SX, TF As Boolean
Dim arr1, arr2
TF = True
For Each Ent1 In sel
If VBA.UCase(Ent1.ObjectName) = "ACDBPOLYLINE" Then
For Each Ent2 In sel
'筛选实体名为多段线且句柄不同的
If VBA.UCase(Ent2.ObjectName) = "ACDBPOLYLINE" And Ent2.Handle Ent1.Handle Then
...............
Next Ent2
End If
Next Ent1
sel.Delete
End Sub |