HOW to get the object which has been selected before an event

Discussion in 'AutoCAD' started by youngman, Oct 6, 2004.

  1. youngman

    youngman Guest

    hi,

    i want to add an event to give the user if the object should be erased.

    HOW to get the object which has been selected before the event.

    thank you

    regards
     
    youngman, Oct 6, 2004
    #1
  2. Hi,

    I'm sure there is a better way, but if an object is selected, then it
    Highlight value will be true.

    Hence you could cycle through the database looking for highlighted objects.

    If there is no better way, because this will be very slow, I would not
    recommend writing a program using it.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Oct 6, 2004
    #2
  3. youngman

    TomD Guest

    I haven't used this, but the help contains the following example:

    Sub Example_PickfirstSelectionSet()
    ' This example lists all the objects in the pickfirst selection set.
    ' Before running this example, create some objects in the active
    ' drawing and select those objects. The objects currently selected
    ' in the active drawing will be returned in the pickfirst selection set.

    Dim pfSS As AcadSelectionSet
    Dim ssobject As AcadEntity
    Dim msg As String
    msg = vbCrLf

    Set pfSS = ThisDrawing.PickfirstSelectionSet
    For Each ssobject In pfSS
    msg = msg & vbCrLf & ssobject.ObjectName
    Next ssobject
    MsgBox "The Pickfirst selection set contains: " & msg

    End Sub
     
    TomD, Oct 6, 2004
    #3
  4. youngman

    youngman Guest

    thank you all.
    i see, i will have a try.

    thanks
     
    youngman, Oct 7, 2004
    #4
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.