Sub xmtext() Dim tsel As AcadSelectionSet Dim entry As AcadEntity Dim tpic As Variant Dim layerstr As String On Error Resume Next Set tsel = ThisDrawing.SelectionSets("topirolss") If Err Then Err.Clear Set tsel = ThisDrawing.SelectionSets.Add("topirolss") tsel.Clear End If tsel.Clear 'ThisDrawing.Utility.GetEntity entry, tpic Err.Clear layerstr = entry.Layer Dim FilterType(0) As Integer Dim FilterData(0) As Variant FilterType(0) = 0 FilterData(0) = "Mtext" tsel.Select acSelectionSetAll, , , FilterType, FilterData tsel.Highlight (True) If tsel.Count = 0 Then tsel.Delete Else ThisDrawing.Utility.InitializeUserInput 1, "Move Copy Erase" ThisDrawing.SendCommand "x" & vbCr & "p" & vbCr & vbCr End If tsel.delete End Sub |