Transparent Find w/ more options

Discussion in 'AutoCAD' started by tader, Jun 4, 2004.

  1. tader

    tader Guest

    Anyone seen anything like this? It would be nice to be able to find a text string then move it around or put a circle around it for later modifying and then continuing your search to other text matching criteria and also implementing the typical "F3" as a find next. There could be numerous powerful options applied to the find command, like maybe searching on a preferred layer(s). There are more but I can't think of them right now.
    Thnx for any info,
    Shawn
     
    tader, Jun 4, 2004
    #1
  2. I wrote this is a hurry a while back for a specific task, but never went any
    further with the programming. It isn't as elegant as your request, but it
    does allow you to find any text string or text style

    ;FTC = input specific text & layer to locate & zoom to
    (defun C:FTC ()
    (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 ()
    (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 (getvar "VIEWSIZE"))
    )
    (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 "]."))
    )
    )
    (getstring "\nHit [ENTER]=Find Next text or [ESC]=to stop and modify
    {GT}to resume ? ")
    )
    )
    )
    )
    (setq CHKK (1+ CHKK))
    )
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Jun 4, 2004
    #2
  3. tader

    tader Guest

    Thnx Alan. Looks like a good project for my spare time and a place to start.
     
    tader, Jun 4, 2004
    #3
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.