Johntosh Posted November 11, 2008 Posted November 11, 2008 This code is changing the oblique angle of my text in the variable... (setq text-to-oblique (entget (entlast))) (setq text-to-oblique (subst (cons 51 15.0)(assoc 51 text-to-oblique) text-to-oblique)) (entmod text-to-oblique) ...but not in the entity? the resultant variable reads 51 . 15.0 for the oblique angle but when I check the actual entity it still reads 51 . 2.4338 (I don't know why it has this number because usually it's 51 . 0) Any assistance appreciated. Quote
Lee Mac Posted November 11, 2008 Posted November 11, 2008 Hi John, Looks like you have radian/degree mix up. include this in your code somewhere: (defun dtr (x) (* pi (/ x 180.0)) ) ; end dtr Then use it in the main LISP to convert the 15 degrees into radians: i.e. (cons 51 (dtr 15.0)) Quote
ASMI Posted November 11, 2008 Posted November 11, 2008 Or (setq text-to-oblique(subst(cons 51[color="Blue"](angtof "15.0")[/color])(assoc 51 text-to-oblique)text-to-oblique)) Quote
Johntosh Posted November 11, 2008 Author Posted November 11, 2008 Thanks Lee! that made me smile. LISP is great! Quote
Johntosh Posted November 11, 2008 Author Posted November 11, 2008 Thank you very much ASMI I didn't know about that function but I do now. Quote
Lee Mac Posted November 16, 2008 Posted November 16, 2008 Just thought I'd post this for you John, may help ; Italic Text by Lee McDonnell ; ; SYNTAX: itxt ; ; [leebob3@hotmail.com for queries] (defun c:itxt (/ ss1 ssl index tents ent1 entyp) (if (not (getenv "itxt:ang")) (setenv "itxt:ang" "20.0") ) ; end if (princ (strcat "\nType \"ITXTANG\" to set Obliquing Angle - Current Angle: " (getenv "itxt:ang")) ) ; end princ (setq ss1 (ssget)) (setq ssl (sslength ss1) index 0 tents 0 ) ; end setq (repeat ssl (setq ent1 (entget (ssname ss1 index)) entyp (cdr (assoc 0 ent1)) ) ; end setq (if (= entyp "TEXT") (progn (setq ent1 (subst (cons 51 (dtr (atof (getenv "itxt:ang")))) (assoc 51 ent1) ent1) ) ; end setq (entmod ent1) (setq tents (+ tents 1)) ) ; end progn ) ; end if (setq index (+ index 1)) ) ; end repeat (if (/= tents 1) (alert (strcat (itoa tents) " Text Entities Modified.")) (alert (strcat (itoa tents) " Text Entity Modified. ")) ) ; end if (princ) ) ; end defun (defun c:itxtang (/ ang) (if (not (getenv "itxt:ang")) (setenv "itxt:ang" "20.0") ) ; end if (princ (strcat "\nCurrent Settings: " (getenv "itxt:ang"))) (if (setq ang (getreal (strcat "\nSpecify Obliquing Angle <" (getenv "itxt:ang") "> :")) ; end getreal ) ; end setq (setenv "itxt:ang" (rtos ang)) ) ; end if (princ "\nObliquing Angle Set.") (princ) ) ; end defun (defun dtr (x) (* pi (/ x 180.0)) ) ; end dtr Let me know if this helps at all Quote
Johntosh Posted November 21, 2008 Author Posted November 21, 2008 Thanks for the afterthought, Lee. I can certainly learn for this. Quote
Recommended Posts
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.