erase selectionset error

Discussion in 'AutoCAD' started by gizmowiebe, Feb 18, 2005.

  1. gizmowiebe

    gizmowiebe Guest

    Hi I've got this code from a post. But when i'm trying to use it it gives the error "invalid entity name" on the sst.erase line.


    Public Sub EraseAll()
    Dim sst As AcadSelectionSet 'selection set object
    Set sst = ThisDrawing.SelectionSets.Add("ToErase") 'add the selection set to

    sst.Select acSelectionSetAll 'select all entities (no filters)
    If MsgBox("About to erase " & sst.count & " entities. Continue?", vbExclamation + vbYesNo + vbDefaultButton2, "Confirm Erase") = vbYes Then
    sst.Erase 'erase the selection
    End If
    sst.Delete 'delete the selection set object (not the entities)
    End Sub
     
    gizmowiebe, Feb 18, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.