if a selectionset is saved when the drawing is saved

Discussion in 'AutoCAD' started by youngman, Jun 11, 2004.

  1. youngman

    youngman Guest

    hi,

    here is my problem.

    if a selectionset is saved when the drawing is saved,

    i mean if i can activate the selectionset when i open the drawing in which i
    make a selectionset

    thank you.
     
    youngman, Jun 11, 2004
    #1
  2. youngman

    Mark Propst Guest

    one idea
    You could save a list of handles of the objects in your selection set to a
    dictionary, xrecord, or xdata
    Then read that data when you open the dwg and repopulate a selection set
    with the objects corresponding to those handles
     
    Mark Propst, Jun 11, 2004
    #2
  3. youngman

    john m Guest

    selection sets are not persistant
    perhaps you could look at groups

    jm
     
    john m, Jun 11, 2004
    #3
  4. youngman

    Jürg Menzi Guest

    youngman

    A selection set is not persistent. After closing a drawing the set is gone.
    You have to store the handles or object id's in a dictionary.

    Cheers
     
    Jürg Menzi, Jun 11, 2004
    #4
  5. youngman

    Matt W Guest

    Just thinking out loud here, Mark.
    If you repopulate the selection set with the objects and their corresponding
    handles, would you have to verify the existance of each object (just in case
    something was deleted) or could you just throw in an "On Error Resume Next"
    statement??

    I haven't done a lot of work with selection sets, that's why I'm asking.

    Although as John pointed out, a GROUP might be better, but I suppose that
    all depends on what you want to do with the objects.

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    | one idea
    | You could save a list of handles of the objects in your selection set to a
    | dictionary, xrecord, or xdata
    | Then read that data when you open the dwg and repopulate a selection set
    | with the objects corresponding to those handles
    |
    |
    | | > hi,
    | >
    | > here is my problem.
    | >
    | > if a selectionset is saved when the drawing is saved,
    | >
    | > i mean if i can activate the selectionset when i open the drawing in
    which
    | i
    | > make a selectionset
    | >
    | > thank you.
    | >
    | >
    | >
    |
    |
     
    Matt W, Jun 11, 2004
    #5
  6. youngman

    Mark Propst Guest

    I would think yes, just not sure how to go about it.
    I'm not sure how one would structure the error statement in relation to the
    foreach loop or however you would iterate whatever collection was storing
    the handles

    pseudocode
    On Error GoTo ObjectGoneErrHandler

    'some manner of iterating the handles collection
    For each lngHndl in StorageLocation
    set oObject = HandleToObject(lngHndl)
    if not err then
    PutObjectInSet oObject, ssSelSet
    end if
    '''don't know if this can go here????
    ObjectGoneErrHandler:
    err.clear
    next lngHndle
     
    Mark Propst, Jun 11, 2004
    #6
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.