Selected Objects

Discussion in 'AutoCAD' started by srinivasan, Jan 7, 2005.

  1. srinivasan

    srinivasan Guest

    Hello all

    Is there any way to find the list of objects selected in command.

    Thanks in advance.
    Sri
     
    srinivasan, Jan 7, 2005
    #1
  2. srinivasan

    Oberer Guest

    if you're searching for a particular object type, you may try the TypeOf(<object>) test.

    Sub test()
    On Error Resume Next
    Dim oSS As AcadSelectionSet
    Dim oEnt As AcadEntity
    Set oSS = ThisDrawing.SelectionSets.Add("TEST1")
    oSS.SelectOnScreen

    For Each oEnt In oSS
    Debug.Print oEnt.ObjectName
    Next oEnt

    End Sub
     
    Oberer, Jan 7, 2005
    #2
  3. srinivasan

    srinivasan Guest

    Thanks for the reply.

    Actually what i need is to get the objects
    which had been selected for editing comands like
    move,copy etc.

    The stage where i need is
    Command:Copy
    Select objects : user selecting objects
    Select objects :

    I need to know programatically the objects selected by the
    user through any of the events.Is this possible.

    Sri
     
    srinivasan, Jan 8, 2005
    #3
  4. srinivasan

    Oberer Guest

    srinivasan ,
    you may want to check out the begin command event...
     
    Oberer, Jan 10, 2005
    #4
  5. srinivasan

    Ledi Guest

    dim SSET as acadselectionset
    Set SSET = ThisDrawing.PickfirstSelectionSet

    this should work for you
     
    Ledi, Jan 11, 2005
    #5
  6. srinivasan

    srinivasan Guest

    Hi Oberer

    The begin command event fires as soon as i am start the command,the selection comes only after this step.

    regards
    Sri
     
    srinivasan, Jan 11, 2005
    #6
  7. srinivasan

    srinivasan Guest

    Thanks Ledi

    But the problem is i am not getting the selection count with
    Pickfirst selection since it always returns me a count 0.

    Regards
    Sri
     
    srinivasan, Jan 11, 2005
    #7
  8. srinivasan

    Ledi Guest

    with pickfirstselectionset you only get objects that are selected on screen! If no objects are selected then count is going to be 0.
     
    Ledi, Jan 11, 2005
    #8
  9. srinivasan

    srinivasan Guest

    Yes but only after giving command i am going to select object.
    Therefore i think pickfirst selection cannot be used.

    Regards
    Sri
     
    srinivasan, Jan 12, 2005
    #9
  10. srinivasan

    Ledi Guest

    you can select first and then write command in commnad line ;)

    you tried with thisdrawing.activeselectionset?
     
    Ledi, Jan 12, 2005
    #10
  11. srinivasan

    Kevin Terry Guest

    you have to wrap your vba routine with a lisp call like this:

    (defun c:Macro_Name ()
    (vla-runmacro (vlax-get-acad-object) "Macro_Name")
    (princ)
    )


    Kevin
     
    Kevin Terry, Jan 12, 2005
    #11
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.