转载别人的不要盲目崇拜我 (defun c:zbbz() (setq os (getvar "osmode")) (while (equal h nil) (setq h (getreal "\n 请输入字体高度:")) ;;; (setq a1 (getreal "\n 请输入字体角度:")) ;;;(lisp16) (command "LAYER" "Make" "gaobz" "") ) (setvar "osmode" 32) (setq p0 (getpoint "\n 请选择插入点:")) ;;;(setq p0 (cdr (entsel (ssget "x" ax)))) (setq pxx (car p0)) (setq pyy (nth 1 p0)) (setq px (rtos pxx 2 3)) (setq py (rtos pyy 2 3)) (setvar "osmode" 0) (setq pp (getpoint "\n 请输入第一点坐标:")) (setq ppp (getpoint "\n 请输入第二点坐标:")) (setq a1 (angle pp ppp)) (setq bb (/ 180 pi)) (setq b1 (/ pi 2)) (setq aa (* bb a1)) (setq h1 (* 0.5 h)) (setq h2 (* 1.5 h)) (setq h3 (* 12 h)) ;;;(setq wth (assoc 41 (tblsearch "style" (getvar "textstyle")))) (setq p1 (polar pp (+ b1 a1) h1)) (setq p2 (polar pp (- a1 b1) h2)) (setq p1 (polar p1 a1 h)) (setq p2 (polar p2 a1 h)) (setq p1x "X=") (setq p1y "Y=") (command "text" p1 h aa p1x) (command "text" p2 h aa p1y) (setq p1 (polar p1 a1 (* 2.0 h))) (setq p2 (polar p2 a1 (* 2.0 h))) (command "text" p1 h aa py) (command "text" p2 h aa px) (setq pp1 (polar pp a1 h3)) (setq dist1 (distance p0 pp)) (setq dist2 (distance p0 pp1)) (if (> dist1 dist2) (command "line" pp pp1 p0 nill) (command "line" p0 pp pp1 nill)) (setvar "osmode" os) (princ) ) ;(defun lisp16 (/ ent entlist ax) ;(prompt "\nPick an entity on the targer layer:" ) ;(setq ent (entsel)) ;(setq entlist (entget (car ent))) ;(setq ax (car (assoc 8 entlist))) ;)
|