本帖最后由 zmzk 于 2019-12-15 09:16 编辑
还有你这功能和我以前在本论坛下载的"斜轴线对正垂直显示"程序功能一样,请看下边- (defun C:gv (/ os ctscale tt pt pt1 pt2 pt3 by ang)
- (setvar "CMDECHO" 0)
- (setvar "ucsfollow" 0)
- (setvar "regenmode" 1)
- (setq os (getvar "OSMODE"))
- ;;; (if (= cts nil)(setq cts 100))
- ;;; (setq ctscale (getreal (strcat "\n出图比例(1:?) <" (rtos cts 2 0) ">:")))
- ;;; (if (= ctscale nil)(setq ctscale cts))
- ;;; (setq cts ctscale)
- (setq ctscale 100)
- (initget "Y W")
- (setq tt (getkword "\nW-世界坐标系/<垂直显示>: "))
- (if (or (= tt "w") (= tt "W"))
- (progn
- (command "plan" "w")
- (command "ucs" "w")
- (command "view" "r" "dz")
- (setq ptt nil)
- (command "regen")
- )
- (progn
- (if (= ptt nil)(command "view" "s" "dz"))
- (setvar "osmode" 513)
- (setq pt1 (getpoint "\n点取Y轴原点<退出>:"))
- (if pt1
- (progn
- (setq pt2 (getpoint "\n选择Y轴正向<退出>:"))
- (if pt2
- (progn
- (setq ang (angle pt1 pt2))
- ;;;(command "color" "250")
- (setq pt3 (polar pt1 (- ang (/ pi 2)) (* 0.1 ctscale)))
- (setvar "osmode" (+ 16384 os))
- (command "line" pt1 pt3 "")
- (command "color" "Bylayer")
- (setq pt (entlast))
- (command "ucs" "e" pt)
- (command "plan" "")
- (setq ptt '(0 0))
- (setq by (* 150 ctscale))
- (command "zoom" "c" ptt by)
- (entdel pt)
- (command "regen")
- ) ;progn
- ) ;if pt2
- ) ;progn
- ) ;if pt1
- (setvar "osmode" os)
- ) ;progn
- ) ;if tt
- (princ)
- )
|