Results 1 to 5 of 5

Thread: how to add Objects to SelectionSet

  1. #1
    Member
    Join Date
    2020-07
    Posts
    14
    Login to Give a bone
    0

    Default how to add Objects to SelectionSet

    How do I add Objects to Selection sets with out selection. Meaning with out prompting Selecting command.

    Thanks.

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,396
    Login to Give a bone
    0

    Default Re: how to add Objects to SelectionSet

    You can't add entities to a selection set. You have to use one of the selection methods. However, the SelectAll method using a filter can probably get you close to what you need. You didn't specify any criteria for what kind of items you want to add.
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2009-04
    Posts
    13
    Login to Give a bone
    0

    Default Re: how to add Objects to SelectionSet

    Quote Originally Posted by Ed Jobe View Post
    You can't add entities to a selection set. You have to use one of the selection methods. However, the SelectAll method using a filter can probably get you close to what you need. You didn't specify any criteria for what kind of items you want to add.
    Hi Ed, as matter of fact, objects can be added into AcadSelectionSet without calling SelectXXX() methods, or asking user to select on screen: AcadSelectionSet.AddItems([an array of AcadEntity]).

    To the OP:

    Here is simplified code sample:

    Code:
    Dim ss As ACadSelectionSet
    Dim ent As AcadEntity
    Dim ents() As AcadEntity
    Dim i As Integer
    Set ss=ThisDrawing.SelectionSets.Add("MySet")
    For Each ent in ThisDrawingModelSpace
      ReDim Preserve ents(i)
      Set ents(i)=ent
      i=i+1
    Next
    ss.AddItems ents
    '' Do whatever with the selection set
    ss.Delete
    Of course, objects can also be removed from selection set by calling AcadSelectionSet([array of AcadEntity])
    Last edited by Opie; 2020-08-06 at 07:21 PM. Reason: [code] tags added

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,396
    Login to Give a bone
    0

    Default Re: how to add Objects to SelectionSet

    Quote Originally Posted by norman.yuan View Post
    Hi Ed, as matter of fact, objects can be added into AcadSelectionSet without calling SelectXXX() methods,
    You're right. See what happens when an old man relies on memory.
    C:> ED WORKING....

  5. #5
    Member
    Join Date
    2020-07
    Posts
    14
    Login to Give a bone
    0

    Default Re: how to add Objects to SelectionSet

    Thank you.

Similar Threads

  1. Making a SelectionSet active in GUI
    By ncraig122139 in forum VBA/COM Interop
    Replies: 7
    Last Post: 2012-03-13, 05:47 PM
  2. Sort Selectionset by X coord
    By ccowgill in forum AutoLISP
    Replies: 10
    Last Post: 2012-03-09, 03:41 PM
  3. Select Block with XDATA by selectionset method
    By ptlong04x1 in forum VBA/COM Interop
    Replies: 1
    Last Post: 2011-07-04, 12:29 PM
  4. SelectionSet are KILLING me
    By jason907238 in forum VBA/COM Interop
    Replies: 22
    Last Post: 2005-07-12, 07:48 PM
  5. SelectionSet Error
    By jason907238 in forum VBA/COM Interop
    Replies: 4
    Last Post: 2005-06-21, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •