Select only one object with filter

Discussion in 'AutoCAD' started by facicad, Aug 5, 2004.

  1. facicad

    facicad Guest

    How can select only one object with filter. If I use
    selectionset.SelectOnScreen(Codes, Datas), I can select more then one
    object, and if I use Utility.GetEntity(Object,PickPoint,Prompt), it dont
    have filter. How can do this ???
     
    facicad, Aug 5, 2004
    #1
  2. Use GetEntity and test the selected object. If it's the wrong type,
    prompt for another selection.
     
    Frank Oquendo, Aug 5, 2004
    #2
  3. facicad

    ajtruckle Guest

    But how does one test the entity type of the AcadObject selected?
     
    ajtruckle, Nov 12, 2004
    #3
  4. facicad

    ajtruckle Guest

    I sed the ObjectName and tested against the AcDbXXXXX of interest.
     
    ajtruckle, Nov 12, 2004
    #4
  5. facicad

    Jackrabbit Guest

    [pre]
    If TypeOf Entity Is AcLine Then
    ...
    End If
    {/pre]
     
    Jackrabbit, Nov 12, 2004
    #5
  6. facicad

    ajtruckle Guest

    Is there a benifit to doing this "Type of entity" as opposed to "ent.objectname = "...""

    ??
     
    ajtruckle, Nov 12, 2004
    #6
  7. There is no benefit in performance, but search this NG for reasons why
    TypeOf should be used instead of ObjectName.
     
    Jorge Jimenez, Nov 12, 2004
    #7
  8. facicad

    ajtruckle Guest

    I found this:

    If TypeOf objBlockSelect Is AcadBlockRef Then
    'The variable holds a reference to a block reference
    End If

    There are two benefits to this syntax. One is that the IDE will assist you
    in selecting the type of interface from a dropdown list while you are typing
    instead of having to consult a list somewhere. Two is that the code will
    actually execute quicker than doing the string comparison.
     
    ajtruckle, Nov 13, 2004
    #8
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.