Public Sub remove_Line()
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim tm As Transaction = db.TransactionManager.StartTransaction()
Try
Dim res As PromptSelectionResult = ed.GetSelection
If res.Status <> PromptStatus.OK Then
Exit Sub
End If
Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
Dim tempIdArray() As ObjectId
tempIdArray = SS.GetObjectIds()
Dim tempId As ObjectId
For Each tempId In tempIdArray
Dim Ent As Entity = CType(tm.GetObject(tempId, OpenMode.ForWrite), Entity)
If Ent.GetType.Name.ToString() = "Line" Then
Ent.Erase()
End If
Next
tm.Commit()
Catch
Finally
tm.Dispose()
End Try
End Sub