Zoom to text

Discussion in 'AutoCAD' started by John Callaway, Jan 24, 2007.

  1. I am looking for a simple lisp routine that will search for and zoom
    to a specified text within an Acad R-14 file.



    JPC
     
    John Callaway, Jan 24, 2007
    #1
  2. John Callaway

    sivag_75 Guest

    Hi,

    This routine is case sensitive.

    (defun c:fn ()
    (setq txt (getstring t "\nEnter Text: "))
    (if (setq sel (ssget "x" (list (cons 0 "TEXT") (cons 1 (strcat "*"
    txt "*")))))
    (progn
    (setq prp (entget (ssname sel 0)))
    (setq elst (textbox prp))
    (setq llpt (cdr (assoc 10 prp)))
    (Setq urpt (list (+ (car llpt) (abs (- (car (car elst)) (car
    (cadr elst)))))
    (+ (cadr llpt) (abs (- (cadr (car elst)) (cadr (cadr
    elst)))))))
    (command "zoom" "w" llpt urpt)
    )
    (prompt "\nText not found.")
    )
    (princ)
    )
    (prompt "\nType \" fn \" to run.")
     
    sivag_75, Jan 25, 2007
    #2
  3. John Callaway

    Bestafor Guest

    HiHo;
    Phil Kreiker wrote a lisp program for just that and it can be found in "the
    Cad Cookbook Collection".
    It's called "Search" and Phil is still around. I see his name in the news
    now and then. Might google him.
     
    Bestafor, Jan 25, 2007
    #3
  4. Sivag,
    Works GREAT!!! Just what I needed. Now I can locate a particular area
    in an 84 meg file. Thank you, thank you, thank you!

    JPC
     
    John Callaway, Jan 25, 2007
    #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.