Thanks, Robert.
I am still not quite satisfied with my knowledge of error handlers, I just
need to study them for a while before I can really grasp the whole thing. I
have put error handlers in some of my routines and on occasion I get a
"rejected setting" type error and haven't been able to track it down.
-Jason
"R. Robert Bell" wrote in message
news:23D16705832AFDCCFC75B81D7EDB74D7@in.WebX.maYIadrTaRb...
> Jason, no need to (setq *Error* nil) at the end of the routine, as you
have
> localized it...
>
> --
> R. Robert Bell, MCSE
> http://www.acadx.com
>
>
> "Jason Piercey" wrote in message
> news:9B95F2139FC12AB41BEEBBD7EBA9F115@in.WebX.maYIadrTaRb...
> | Here is one I will share. It rotates text or mtext nested or not. I
> | suppose I could modify it to include attributes as well. I am no expert
> on
> | *error* handlers but I think this one is correct, if not someone please
> | correct me.
> |
> | ;Written By Jason Piercey 05.17.01
> | ;Rotates a text entity to the specified angle.
> | ;Text, Mtext, Nested or Not Nested.
> |
> | ;Revised 10.07.01
> | ;Removed replace append with cons
> | ;Optimized the graphical updating of blocks
> |
> | (defun C:TextRotate (/ ss Ename Elist Erot Rot Eblk BlkLst Index
*Error*)
> |
> | (defun *Error* (msg)
> | (if (or (= msg "Function cancelled") (= msg "quit / exit abort"))
> | (princ) (princ (strcat "\nError: " msg))
> | )
> | )
> |
> | (while (not ss) (setq ss (nentsel "\nSelect Text: ")))
> |
> | (if (or (equal '(0 . "TEXT") (assoc 0 (entget (car ss))))
> | (equal '(0 . "MTEXT") (assoc 0 (entget (car ss))))
> | )
> | (progn
> | (setq Ename (cdr (assoc -1 (entget (car ss))))
> | Elist (entget (car ss))
> | Erot (cdr (assoc 50 Elist))
> | )
> |
> | ;if the text is nested get the parent block
> | (if (> (length ss) 2) (setq Eblk (cdr (assoc -1 (entget (car
(last
> | ss)))))))
> |
> | (princ (strcat "\nCurrent Rotation is " (vl-princ-to-string (rtd
> | Erot))))
> |
> | (while (not Rot) (setq Rot (getreal "\nEnter New Rotation Angle:
> ")))
> |
> | (setq Elist (subst (cons 50 (dtr Rot)) (cons 50 Erot) Elist))
> |
> | (entmod Elist)
> |
> | (entupd Ename)
> | (if Eblk
> | (progn
> | (setq ss (ssget "x" (list '(0 . "INSERT") (assoc 2 (entget Eblk)))))
> | (setq Index 0)
> | (repeat (sslength ss)
> | (entupd (ssname ss Index))
> | (setq Index (1+ Index))
> | )
> | )
> | )
> | )
> | ;else
> | (princ "\nSelection Was Not A Text Entity")
> | )
> | (setq *Error* nil)
> | (princ)
> | )
> |
> | ;converts degrees to radians
> | (defun dtr (d) (* pi (/ d 180.0)))
> |
> | -Jason
> |
> |
> |
> | suky wrote in message
> | news:3BBF930F.7ADEB8F9@hotmail.com...
> | > I understood it was included in express tools but i don't have it.
> | > It would rotate text within blocks without using refedit.
> | >
> | > Paul Turvill schreef:
> | >
> | > > What does it do?
> | > > ___
> | > >
> | > > "suky" wrote in message
> | > > news:3BBF0E67.71C425F2@hotmail.com...
> | > > > I am looking for torient.lsp
> | > > > Hope someone can send it to mee,
> | > > > thanx in advance.
> | > > >
> | >
> |
> |
>
>