Wanted: filter fields out in a selection set. DXF Code for FIELDS?

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

  1. Why not just

    On Error Resume Next
    ThisDrawing.SelectionSets.Item(SSetName).Delete
    err.Clear
    Set CreateSSet = ThisDrawing.SelectionSets.Add(SSetName)


    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    My suggestion:

    Public Function CreateSSet(SSetName As String) As AcadSelectionSet
    Dim SSetObj As AcadSelectionSet
    Dim SSetExists As Boolean

    SSetExists = False
    For Each SSetObj In ThisDrawing.SelectionSets
    If SSetObj.Name = SSetName Then
    SSetExists = True
    Exit For
    End If
    Next
    If SSetExists = True Then ThisDrawing.SelectionSets.Item(SSetName).Delete
    Set CreateSSet = ThisDrawing.SelectionSets.Add(SSetName)
    End Function

    Regards,
    Maksim Sestic
     
    Jorge Jimenez, Oct 22, 2004
    #21
  2. It happens more often than we think it will
    specially if the user is running other apps
    that apply the same technique
     
    Jorge Jimenez, Oct 22, 2004
    #22
  3. Here's my 2 cents. I always use the delete method of the selection set when I have finished with it. I also have a Selection Set Function I use for simplification of creating selection sets. This function always creates a new selection set and I have never had any problems simply because I delete selection sets as soon as I am finished with them.
    Regards - Nathan
     
    Nathan Taylor, Oct 24, 2004
    #23
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.