layercase

Discussion in 'AutoCAD' started by richard_l_smith, Dec 7, 2004.

  1. I used to have a lisp routine that made all of the text in the layer dialog either upper or lower cae. Does anyone know where i can find this file? Thanks
     
    richard_l_smith, Dec 7, 2004
    #1
  2. dialog either upper or lower cae. Does anyone know where i can find this
    file? Thanks

    Is this the one?

    ; TIP958.LSP: CHGCASE.LSP Change Case of Text (c)1994, C.D. Iddings

    (defun C:CASE()
    (setvar "cmdecho" 0)

    (defun *error* (msg)
    (princ "error : ")
    (princ msg)
    (terpri)
    )
    (prompt "\nCHANGES CASE TO ALL UPPER OR ALL LOWER ")
    (setq itm (entsel "\nSelect Text String: ")
    enty (entget (car itm))
    itmid (cdr (assoc 0 (entget (car itm)))))
    (if (/= itmid "TEXT")(chgcase))
    (initget 1 "L U")
    (setq cse (getkword"\nWhat case (U/L) : ")
    txtoc (cdr (assoc 1 (entget (car itm))))
    lntxtoc (strlen txtoc)
    o_chr (ascii (substr txtoc 1 1)))
    (cond
    ((= cse "L")
    (if (and (>= o_chr 65)(<= o_chr 90))
    (setq n_chr (chr (+ o_chr 32)))(setq n_chr (chr o_chr))))
    ((= cse "U")
    (if (and (<= o_chr 122)(>= o_chr 97))
    (setq n_chr (chr (- o_chr 32)))(setq n_chr (chr o_chr))))
    )
    (setq n_str n_chr
    cnt 2)

    (repeat (- lntxtoc 1)
    (setq o_chr (ascii (substr txtoc cnt 1)))
    (cond
    ((= cse "L")
    (if (and (>= o_chr 65)(<= o_chr 90))
    (setq n_chr (chr (+ o_chr 32)))(setq n_chr (chr o_chr))))
    ((= cse "U")
    (if (and (<= o_chr 122)(>= o_chr 97))
    (setq n_chr (chr (- o_chr 32)))(setq n_chr (chr o_chr))))
    )
    (setq n_str (strcat n_str n_chr)
    cnt (+ cnt 1))
    )

    (setq enty (subst (cons 1 n_str)(assoc 1 enty) enty))
    (entmod enty)
    (princ)
    ); end chgcase.lsp

    Gordon Stephens.
     
    Gordon Stephens, Dec 7, 2004
    #2
  3. richard_l_smith

    dth Guest

    Depending on the version of AutoCAD, Express Tools has a lisp called TCASE.

    dialog either upper or lower cae. Does anyone know where i can find this
    file? Thanks
     
    dth, Dec 7, 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.
Similar Threads
There are no similar threads yet.
Loading...