Jump to content

Recommended Posts

Posted

Maybe something along these lines:

 

;; ZoomText © Lee Mac 2011

(defun c:ZoomText ( / ss ac l p1 p2 x ) (vl-load-com)
 (if
   (ssget "_X"
     (list (cons 0 "TEXT,MTEXT")
       (cons 1
         (strcat "*"
           (vl-list->string
             (apply 'append
               (mapcar
                 (function
                   (lambda ( c )
                     (if (vl-position c '(35 64 46 42 63 126 91 123 44 96))
                       (list 96 c)
                       (list c)
                     )
                   )
                 )
                 (vl-string->list
                   (getstring t "\nSpecify Text to Search for <All> : ")
                 )
               )
             )
           )
           "*"
         )
       )
     )
   )
   (progn
     (vlax-for o
       (setq ss
         (vla-get-ActiveSelectionSet
           (vla-get-ActiveDocument
             (setq ac (vlax-get-acad-object))
           )
         )
       )
       (setq l
         (cons
           (cons o
             (mapcar 'vlax-safearray->list
               (progn                
                 (vla-getBoundingBox o 'p1 'p2) (list p1 p2)
               )
             )
           )
           l
         )
       )
     )
     (vla-delete ss)
     (while (setq x (car l))
       (vla-ZoomCenter ac (vlax-3D-point (apply 'mapcar (cons '(lambda ( a b ) (/ (+ a b) 2.)) (cdr x)))) 1.0)
       (vla-ZoomScaled ac [b][color=red]0.01[/color][/b] acZoomScaledRelativePSpace)
       
       (initget "Next Exit")
       (setq l
         (if (eq "Exit" (getkword "\nZoom to Next Object? [Next/Exit] <Next> : ")) nil (cdr l))
       )
     )
   )
   (princ "\n** None Found **")
 )

 (princ)
)

 

I'm not sure whether the figure marked in red needs to be 0.01 or 100.0 however...

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    9

  • dchilders

    7

  • lfe011969

    3

  • svorgodne

    2

Top Posters In This Topic

Posted

Awesome, I can't thank you enough. What a time saver:D

Posted
Awesome, I can't thank you enough. What a time saver:D

 

You're very welcome :)

  • 6 years later...
Posted

Hi, is this possible to add other items, like ATTRIBUTES, MLEADERS etc... to the search ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...