Changing Text Entities

Discussion of Common Lisp

Changing Text Entities

Postby giovanni64 » Mon Aug 22, 2011 1:53 pm

Hi,

I hope that there is someone who can help me with a Lisp Routine, please.

I tried to find out why the program only changes the text hight when changing text.
It does not work at all if I only change the text hight. I'm completely lost and don't know
what to do.
:(

Code: Select all
(DEFUN C:AETXT ()
(defun *error* (meldung)(grtext)(princ))
(defun ac (v / v) (assoc v tasa))
(defun ers (x y z)(setq tasa (subst (cons x y) z tasa)))

(menucmd "S=BLOCK 3")(setq asa (ssget))
  (if (= asa nil)(print "No object selected ")
     (progn(setq wasa (sslength asa))(menucmd "S=S")
     ) ; end progn
  ) ; end if

(setq sp '(0 0 0))
  (if (/= asa nil) (progn
(setq clr (getint
"\nNew Color, Return if no change: "))
(setq stn (getstring
"\nNew Textstyle, Return if no change: "))
(setq brn (getreal
  "\nNew Width, Return if no change: "))
(setq thn (getreal
  "\nNew Texthight, Return if no change: "))
(setq swn (getreal
  "\nNew Obliquing angel, Return if no change: ")))
  ) ; end if
    (if (/= swn nil)(setq swn (/ (* pi swn) 180.0))
    ) ; end if
   
(setq z1 0)
  (while (< z1 wasa)

    (if (= "TEXT" (cdr (assoc 0 (setq tasa (entget (ssname asa
         z1))))))

      (progn
        (setq cla (ac 62)
          tha (ac 40) bra (ac 41)
          swa (ac 51) sta (ac 7)
          ysa (cddr tsa) sp (cons (car sp) ysa)
       ) ; end setq
          (if (/= swn nil)(ers 51 swn swa))
          (if (and brn (> brn 0.0)) (ers 41 brn bra))
     
         (if (and thn (> thn 0.0)) (ers 40 thn tha))
   
         (if (/= stn "")(ers 7 stn sta))
          (if (/= clr "")(ers 62 clr cla))
(entmod tasa)
      ) ; end progn
    ) ; end if
(setq z1 (1+ z1))
  ) ; end while
(grtext)(princ)
) ;EOF C:AETXT.LSP


Regards,

Giovanni
giovanni64
 
Posts: 1
Joined: Mon Aug 22, 2011 1:33 pm

Re: Changing Text Entities

Postby edgar-rft » Tue Aug 23, 2011 7:58 am

Is this AutoLisp [the scripting language of AutoCAD] or something similar? "menucmd" is definitely no Common Lisp function.

Also do yourself a favour and learn how to indent Lisp code correctly, otherwise nobody will be able to read your code.

See Indenting Common Lisp to get an idea how it works.

- edgar
edgar-rft
 
Posts: 147
Joined: Fri Aug 06, 2010 6:34 am
Location: Germany


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 2 guests