;setvar cmdecho shortcut (if (= echo nil)(defun echo( temp / ) (setq old_cmdecho (getvar "cmdecho"))(setvar "cmdecho" temp))) ;set undo shortcut (if (= undo nil)(defun undo( temp / )(command "undo" temp))) ;radians to decimals (if (= rtd nil) (defun rtd (a) (/ (* a 180.0)pi))) ;decimals to radians (if (= dtr nil) (defun dtr (a) (* pi (/ a 180.0)))) ;################# ;### Twist ### ;################# ;v. 1.5 ;<<<< ADD >>>>> ; option to do a dview, twist on a viewport when in a paperspace ; if paperspace, then do this ; if not in an active layout ; set unactive flag ; select viewport & make active ; if layout is locked ; set a locked flag ; unlock ; command dview twist, realign ucs option ; put everthing (besides twist) back the way it was ;Command : TW ; shortcut for dview twist (with added functionality) ; Enter the twist angle explicitly or ; Align: set twist angle by picking two points (Point 1 is 0,0 and Point 2 is positive x-axis vector) ; Relative: set twist angle relative to current twist angle ; After twisting the view, the list will prompt (yes/no) to Realign UCS. Default (defun c:tw( / answer ) (echo 0)(undo "begin") (setq answer (getstring carriage_return "Specify angle or [Align/Relative]: ")) (if (or (= answer "") (= answer "a") (= answer "A")) (setq answer (- (rtd (getvar "ViewTwist")) (rtd (getangle "Pick first point:"))))) (if (or (= answer "R") (= answer "r")) (setq answer (+ (rtd (getvar "ViewTwist")) (getint "Specify angle relative to current view: "))) ) (command "dview" "" "twist" answer "" ) (initget "Yes No") (if (/= (getkword "\nRealign UCS?: [Yes/No] :") "No" ) (command "ucs" "v")) (undo "end")(echo old_cmdecho) (princ))