Find and point to text

Discussion in 'AutoCAD' started by Big 'D', Jun 25, 2004.

  1. Big 'D'

    Big 'D' Guest

    I need to find user specified text. I know a string of text is on the drawing, someplace, but where? I used to have a program that would allow me to input text being searched for, then draw a line to that text location on the drawing. Zooming in on the text would be fine. Highlighted text on a large drawing zoomed out is not always that easy to find. Anyone have such a routine?

    Thanks for the help.
    D
     
    Big 'D', Jun 25, 2004
    #1
  2. Big 'D'

    zeha Guest

    Why not the autocad command find
    This find a text in attributes and (M)Text en zoomTo function
     
    zeha, Jun 25, 2004
    #2
  3. Big 'D'

    sandra Guest

    Yup, Find is better.
     
    sandra, Jun 25, 2004
    #3
  4. Big 'D'

    Big 'D' Guest

    Still looking. Could not edit previous file to work. Anyone have any suggesstions?
     
    Big 'D', Jun 25, 2004
    #4
  5. 2 programs - find by text character, find text by size
    ;-----------------------------------------------------------------------
    ;FTC = input specific text & layer to locate & zoom to
    (defun C:FTC (/ CHES CHET)
    (setq CHES nil)
    (setq CHET (strcase (getstring T "\nInput Text String to Search for or
    [ENTER]=All Text ? ")))
    (setq CHEL (strcase (getstring "\nInput Text Layer Name or [ENTER]=All
    Layers ? ")))
    (if (= CHEL "") (setq CHEL "*"))
    (setq CHKSS (ssget "X" (list (cons 0 "*TEXT") (cons 8 CHEL))))
    (if CHKSS
    (setq CHKK 0 CHKS (sslength CHKSS))
    (setq CHKK 0 CHKS 0)
    )
    (princ (strcat "\n" (itoa CHKS) " TEXT found on Layer " CHEL "."))
    (princ)
    )
    ;-----------------------------------------------------------------------
    ;FTS = input text size & layer to locate & zoom to
    (defun C:FTS (/ CHES CHET)
    (setq CHET nil)
    (setq CHES (getreal "\nInput Text Size to Search for or [ENTER]=All Text ?
    "))
    (setq CHEL (strcase (getstring "\nInput Text Layer Name or [ENTER]=All
    Layers ? ")))
    (if (= CHEL "") (setq CHEL "*"))
    (setq CHKSS (ssget "X" (list (cons 0 "*TEXT") (cons 8 CHEL))))
    (if CHKSS
    (setq CHKK 0 CHKS (sslength CHKSS))
    (setq CHKK 0 CHKS 0)
    )
    (princ (strcat "\n" (itoa CHKS) " TEXT found on Layer " CHEL "."))
    (princ)
    )
    ;-----------------------------------------------------------------------
    ;GT = zoom to text located by FTC & FTS (one at a time)
    (defun C:GT (/ EG P0 TT HH ZOOMTO)
    (if (not ZOOM)
    (setq ZOOM (* 6.0 DWGSCALE))
    )
    (cond
    ((and CHET (/= CHET ""))
    (princ (strcat "\nZooming to TEXT [" CHET "] " (itoa (1+ CHKK)) " of "
    (itoa CHKS) " [GNUM=" (itoa CHKK) "]."))
    )
    ((not CHES)
    (princ (strcat "\nZooming to TEXT Size [" (rtos CHES 2 2) "] " (itoa (1+
    CHKK)) " of " (itoa CHKS) " [GNUM=" (itoa CHKK) "]."))
    )
    (T
    (princ (strcat "\nZooming to ALL TEXT " (itoa (1+ CHKK)) " of " (itoa
    CHKS) " [GNUM=" (itoa CHKK) "]."))
    )
    )
    (while (< CHKK CHKS)
    (grtext -1 (strcat "Text " (itoa (1+ CHKK)) " of " (itoa CHKS)))
    (setq EG (entget (ssname CHKSS CHKK)))
    (if EG
    (progn
    (setq P0 (cdr (assoc 10 EG)))
    (setq TT (strcase (cdr (assoc 1 EG))))
    (setq HH (cdr (assoc 40 EG)))
    (cond
    ((and CHES (equal CHES HH 0.001))
    (setq ZOOMTO T)
    )
    ((and CHET (= CHET "?") (wcmatch TT "*[?]*"))
    (setq ZOOMTO T)
    )
    ((and CHET (/= CHET "?") (wcmatch TT (strcat "*`" CHET "*")))
    (setq ZOOMTO T)
    )
    (T (setq ZOOMTO nil))
    )
    (if ZOOMTO
    (progn
    (command "_ZOOM" "C" P0 ZOOM)
    (redraw (cdr (assoc -1 EG)) 3)
    (cond
    (CHES
    (princ (strcat " Text=[" TT "] - Size=[" (rtos HH 2 2) "]."))
    )
    ((and CHET (= CHET "TEXT"))
    (princ (strcat " Text=[" TT "]."))
    )
    )
    (C:SVV)
    (getstring "\nHit [ENTER]=Find Next text ? ")
    )
    )
    )
    )
    (setq CHKK (1+ CHKK))
    )
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Jun 25, 2004
    #5
  6. Big 'D'

    Big 'D' Guest

    The AutoCAD find command wants to replace text. I need a routine to point me to the text so I know where it is on the drawing but I do not always want to replace it.
     
    Big 'D', Jun 25, 2004
    #6
  7. It only wants to replace it if you type in something to replace it with.
    You can type in what you're looking for, and it shows you the wording around
    it so you can tell whether it's the one you want, then you can pick Zoom To
    and got to where it is, then pick Close. No replacement is necessary.

    Kent Cooper, AIA


    me to the text so I know where it is on the drawing but I do not always want
    to replace it.
     
    Kent Cooper, AIA, Jun 25, 2004
    #7
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.