;;; Josh Crawford
;;; Function to twist view based on two picked points, or rotation angle of a block or text, or the angle of a line.
(defun c:tw (/ ang block blockdata text textdata dxf)
;;;Necessary functions
;;extract data from dotted pair
(defun dxf (code elist) (cdr (assoc code elist)))
;;radians to degrees
(defun rtd (r) (/ (* r 180.0) pi))
;;;main program
(if (and (= 0 (getvar "tilemode"))
(eq
16384
(logand
16384
(dxf 90
(entget
(ssname
(ssget
"x"
(list (cons 0 "viewport")
(cons 69 (getvar "cvport"))
(cons 410 (getvar "ctab"))
)
)
0
)
)
)
)
)
)
(princ "\nCurrent Viewport is LOCKED.\nUnlock viewport and try again.")
(progn
(setvar "CMDECHO" 0)
(initget 1 "Block Text Pick Line")
(setq ang
(getangle
"\nSet viewtwist by [Block angle/Line angle/Text angle/