AutoLISP / Visual LISP

HomeHome BlogBlog TwitterTwitter YouTubeYouTube ContactContact
   
 

Free AutoLISP for AutoCAD

More Free AutoLISP and Visual LISP code snippets for AutoCAD

;;; By Jimmy Bergmark
;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved
;;; Website: www.jtbworld.com
;;; E-mail: info@jtbworld.com
;;; rotate selected text objects to specified angle

(defun c:txtrot (/ sset i ed ang)
  (if (setq sset (ssget '((-4 . "<OR")
                          (0 . "MTEXT")
                          (0 . "TEXT")
                          (-4 . "OR>")
                         )
                 )
      )
    (progn
      (setq ang (getangle "Specify rotation angle <0>: "))
      (if (null ang)
        (setq ang 0)
      )
      (repeat (setq i (sslength sset))
        (setq ed (entget (ssname sset (setq i (1- i)))))
        (entmod (subst (cons 50 ang)
                       (assoc 50 ed)
                       ed
                )
        )
      )
    )
  )
  (princ)
)
 
© 2001-2012 JTB World. All rights reserved.