Selecting text to change text style

Discussion in 'AutoCAD' started by schuler, Jul 14, 2003.

  1. schuler

    schuler Guest

    I am trying to select all text in a drawing and change the style to a predefined style. Not sure how to select only text (ssget?).
    I am kinda new to Lisping...any help would be appreciated.
    Thanks.
     
    schuler, Jul 14, 2003
    #1
    1. Advertisements

  2. schuler

    Rudy Tovar Guest

    Just so you know I edit the function, so you'll see a prompt to select, but the utility will do it for you.



     



    (ssget "x" '((0 . "TEXT")));select all..



     



     



     



    "Rudy Tovar" <> wrote in message news:...



    I wrote a loonnggg time ago, but it will do what you need. Remember that blocks have to be access another way.



     



     



    (defun c:ST (/ a1 a2 n index b1 b2 d1 d2 b3 ww)
      (graphscr)
      (setq #style "?")



     



      (prompt "Select entities to be changed ")
      (terpri)
      (setq a1 (ssget "x" '((0 . "TEXT"))))
      (setq a2 (entsel "\nPoint to entity on target STYLE OR ENTER FOR NEW STYLE:"))
      (terpri)
      (setq n (sslength a1))
      (setq index 0)
      (if (= a2 nil)
        (setq get 1)
      )
      (while get
        (terpri)
        (prompt "Enter new Style <")
        (princ #style)
        (setq d2 (getstring ">: "))
        (terpri)
        (setq d2 (strcase d2))
        (setq d2 (cons 7 d2))



     



        (setq get nil)
      )



     



      (if a2
        (progn
          (setq b2 (entget (car a2)))



     



          (setq d2 (assoc 7 b2))
        )
      )
      (repeat n
        (setq b1 (entget (ssname a1 index)))
        (setq d1 (assoc 7 b1))
        (setq b3 (subst d2 d1 b1))
        (entmod b3)
        (setq index (+ index 1))
      )



     



      (princ)



     



    )




     







     



    "schuler" <> wrote in message news:...

    I am trying to select all text in a drawing and change the style to a predefined style. Not sure how to select only text (ssget?).
    I am kinda new to Lisping...any help would be appreciated.
    Thanks.
     
    Rudy Tovar, Jul 14, 2003
    #2
    1. Advertisements

  3. schuler

    Walt Engle Guest

    Try the following I have been using for over 10 years:



    WE
     
    Walt Engle, Jul 14, 2003
    #3
  4. schuler

    John Crocco Guest

    Use the change properies dialog box, select all, and then select the text
    font and size you want. NO programming required. You can also use a lisp
    called ssx thats ran froam a command to get items in a drawing like lines,
    individual block names, circles, text, etc and then erase/change/move/etc as
    needed. Basically it is a filter ran within an existing autocad command.

    either way works for you.

    --
    John Crocco
    Cartland Kraus Engineering
    I am trying to select all text in a drawing and change the style to a
    predefined style. Not sure how to select only text (ssget?).
    I am kinda new to Lisping...any help would be appreciated.
    Thanks.
     
    John Crocco, Jul 14, 2003
    #4
  5. schuler

    Walt Engle Guest

    P.S. this is my copyrighted lsp function, but you can have it. It changes
    all text globally. If you add this to your acad.mnu, you will find it very
    useful.

    WE
     
    Walt Engle, Jul 14, 2003
    #5
    1. Advertisements

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.