TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ziele_o2k on December 07, 2017, 03:36:45 PM
-
Hi,
I'm working on tool for printing to pdf files. It is based on dynamic block (drawing frame). I have one question, how to quickly rotate plan to my block orientation (change viewtwist). When I'm printing with window option in model space, I have to change that.
Attached image explains everyithing I think.
-
Ok, I will ask in this way. Can it be done in another way (using VanillaLisp or VisualLisp) than this:
(defun c:r2e
( / RTD ang
) (defun RTD
(r
/ ) (/ (* r
180.0) pi
)) (command "._dview" "" "_twist" (* -1 ang
) "") )
I'm always trying to avoid command in my lisps...
-
you can use this lisp load and just type RV in model space and give directions exactly which way you want.
-
I've used this one for a few years. Select two points on the line you want to be horizontal.
Steve
;;
;; Posted by smorales02 12MAR2008
;; www.cadtutor.net/forum/showthread.php?21135-DVIEW-twist-or-UCS
;; Post 11
;;
; *** This program uses the dview to twist a view ***
; and to set the crosshairs to bottom of screen
;;;;The dtr funtion converts degrees to radians
;;;;The rtd funtion converts radians to degrees
(defun rtd (a) (/ (* a 180.0)pi))
(defun dtr (a)
(* pi (/ a 180.0)))
(DEFUN C:TW(/ W2 W1 ANG)
(PRINC"\nSelect two point along the desired horizontal line. ")
(SETVAR"OSMODE"512)
(IF(SETQ W2(GETPOINT"\nFirst point (left): "))
(PROGN(INITGET 1)
(SETQ W1(GETPOINT"\nSecond point: "W2)ANG(ANGLE W2 W1))
(COMMAND"DVIEW""L" "" "TW"(- 360(RTD ANG))"")(SETVAR"SNAPANG"ANG)))
(SETVAR"OSMODE" 0))