Entlast Changed since R14? or ssget changed?

Discussion in 'AutoCAD' started by Peter Farrell, Apr 2, 2004.

  1. I searched for messages on this - has anybody noticed this?
    In R14 I used to use (entlast) to set a marker, then create a selection set
    of all things since the marker using a (ssfrom) routine, ie. (ssfrom ent)

    Ever since I upgraded I keep seeing an error "lselsetp nil" which I think is
    the result of (entlast) not being the absolute last entity with complex
    entities (ie. a SEQEND). This didn't ever seem to bother R14, but it seems
    that R2K4 and maybe any R2K+ versions have a problem with trying to add the
    attributes or vertex entities to the subsequent selection set? Can somebody
    verify this? Explain the change?

    Here's my code snipets:

    ;;;The ssfrom function creates a set of all entities after a given entity in
    the drawing
    (defun ssfrom (ent / ent1 sset)
    (setq sset (ssadd))
    (while (setq ent1 (entnext ent))
    (setq sset (ssadd ent1 sset))
    (setq ent ent1)
    )
    sset
    )
    ;;;

    I used to use just (setq ent0 (entlast)) then do some stuff and
    (setq sset (ssfrom ent0)) for the selection set of all things since ent0
    2004 doesn't like this with a block or old pline as the last entity
    So I came up with this...

    ;;;The entlast2004 function steps to the end of the entity list including
    finding the
    ;;;"SEQEND" entity in complex entities (Plines, Blocks, etc.)
    ;;;so that next call of SSFROM isn't trying to add Attributes or vertexes to
    ;;;the selection set.
    (defun entlast2004 ()
    (setq entl (entlast))
    (setq entn (entnext entl)) ;;;need to look for nested entities in 2004?
    (while (not (null entn))
    (setq entl entn)
    (setq entn (entnext entl))
    )
    entl
    )

    Comments?

    Peter Farrell
     
    Peter Farrell, Apr 2, 2004
    #1
  2. Yeah, I discovered that too. Here's what I use:


    (defun SSCOL (e / ss elist flag)
    (setq ss (ssadd))
    (if (null e) (setq ss (ssadd (setq e (entnext)) ss)))
    ;; If the last entity is an insert with attributes, (entnext e) will
    ;; find the ATTRIB and SEQEND sub entities of the block, and then
    ;; will add the block to the selection set. Not what is intended, so
    ;; routine scans the entities until it is beyond the SEQEND sub entity
    ;; before adding entities to the selection set.
    (while (setq e (entnext e))
    (setq elist (entget e))
    (if (not flag)
    (setq flag (not (wcmatch (field 0 elist) "ATTRIB,SEQEND")))
    )

    (if flag (ssadd e ss))
    )
    )
     
    Allen Johnson, Apr 2, 2004
    #2
  3. Peter Farrell

    Joe Burke Guest

    Peter,

    See the thread titled "Set of objects added" dated 3/28/2004. It might shed some
    light.

    I don't how entnext behaved before A2kx. But if you are looking for a function to
    return primary objects added after "mark" entlast, see my post 3/30.

    Joe Burke
     
    Joe Burke, Apr 2, 2004
    #3
  4. I insert a "point" on a non-plot layer, use entlast to store info and then
    entdel the point.
     
    Alan Henderson, Apr 2, 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.