entsel and then nil

Discussion in 'AutoCAD' started by kpennell, Jul 21, 2004.

  1. kpennell

    T.Willey Guest

    (defun check-obj(/ ent)

    (setq pt1 '(0.0 0.0 0.0))
    (setq ent (nentselp pt1))
    (while ent
    (setq pt2 (+ 16.0 (car pt1)))
    (setq pt1 (reverse (cdr pt1)))
    (setq pt1 (reverse (append pt1 (list pt2))))
    (setq ent (nentselp pt1))
    )
    ;put what you want to do here
    (princ)
    )

    I'm A2K4.
    This will search until nothing is at pt1, and return the point pt1. The first one I posted would search until it found something, so if it never found anything then you would have to escape out of it.

    Didn't understand at first. Hope this works for you.
    Tim
     
    T.Willey, Jul 22, 2004
    #21
  2. kpennell

    kpennell Guest

    perfect, it don't crash and when I insert the appropriate variables it looks for the next point, and all that jazz.
    thanks tim
    your efforts are greatly appreciated.
     
    kpennell, Jul 22, 2004
    #22
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.