Selection set not working...

Discussion in 'AutoCAD' started by Yves, Oct 20, 2004.

  1. Yves

    Yves Guest

    Hi,

    I have this simple code that suddently stopped working, it is used to erase
    all the objects on a specific layer,

    I have the error, Invalid argument Items in Removeitems

    Set Sset = Nothing
    Set Sset = ThisDrawing.PickfirstSelectionSet
    Sset.Clear
    ft(0) = 8 ' layer name
    ThisDrawing.Utility.GetEntity ent, pt, "Choisit un objet:"
    nomLay = ent.layer
    Sset.Clear
    fd = Array(nomLay)
    Sset.Select acSelectionSetAll, , , ft, fd
    If Sset.count > 0 Then
    ThisDrawing.Utility.Prompt ("Efface le layer : " & nomLay & vbCr &
    vbLf)
    For Each ent In Sset
    If TypeName(ent) <> "IAcadPViewPort" Then
    *******The error occurs here : Sset.RemoveItems ent
    ent.Delete
    End If
    Next
    End If
     
    Yves, Oct 20, 2004
    #1
  2. In addition to any replies you might receive or already
    received, you may find more information or responses
    by posting future VBA related questions in the following
    discussion group:

    By NNTP discussion group reader at
    news://discussion.autodesk.com/autodesk.autocad.customization.vba

    By HTTP (web-based) interface at
    http://discussion.autodesk.com/forum.jspa?forumID=33
     
    Jason Piercey, Oct 20, 2004
    #2
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.