用坐标画图后CAD坐标如何在图上自动显示出坐标值
推荐回答
将下面的字符全部复制到记事本里,保存为:**.lsp,在cad里加载该lisp文件,运行命令:PTXT;;;* PTXT types coordinates and draws points and lines between them;;;* It uses the current style of points and text with height 0.2 and angle 90(defun C:PTXT ( / dp1 dp txt)(setq cmdech (getvar "CMDECHO")) ;Save mand echo(setvar "CMDECHO" 0) ;Turn mand echo off(graphscr)(repeat 25(setqdp1 dp ;Assign variablesdp (getpoint "\nEnter design point: " ) ;Get design pointtxt (strcat " " ;Offer default(rtos (car dp)) "/"(rtos (+ -000 (cadr dp))) " " ));setq(mand "_.TEXT" dp "0.2" "90" txt"_.POINT" DP);mand(if dp1 (mand "_.line" dp1 dp "")));repeat (setvar "CMDECHO" cmdech) ;Restore mand echo(princ) ;Ends program cleanly);end defun(defun C:STXT ( / dp1 dp txt)(setq cmdech (getvar "CMDECHO")) ;Save mand echo(setvar "CMDECHO" 0) ;Turn mand echo off(graphscr)(repeat 25(setqdp1 dp ;Assign variablesdp (getpoint "\nEnter design point: " ));setq ;Get design point(if dp1 (setq dp (list (+ (car dp1) (car dp)) (cadr dp))))(setqtxt (strcat " " ;Offer default(rtos (car dp)) "/"(rtos (+ 000 (cadr dp))) " " ));setq(mand "_.TEXT" dp "0.2" "90" txt"_.POINT" DP);mand(if dp1 (mand "_.line" dp1 dp "")));repeat (setvar "CMDECHO" cmdech) ;Restore mand echo(princ) ;Ends program cleanly);end defun;;;* ;;;* DSN types coordinates and draws lines between them;;;* It uses the current style of points and text with height 0.2 and angle 90(defun C:DSN (/ )(setq cmdech (getvar "CMDECHO")) ;Save mand echo(setvar "CMDECHO" 0) ;Turn mand echo off(graphscr)(mand "_.LAYER" "_M" "D" "_C" "6" "" "")(setqlvl (GETREAL "\nEnter level of ditch ")dp1 (list 12 lvl)dp2 (list 9 lvl)dp3 (list 6 (+ 2 lvl))dp4 (list 3 (+ 2 lvl))dp5 (list 0 lvl)dp6 (list -5 lvl));setq(tx dp1 dp1)(tx dp1 dp2)(tx dp2 dp3)(tx dp3 dp4)(tx dp4 dp5)(tx dp5 dp6)(setvar "CMDECHO" cmdech) ;Restore mand echo(princ) ;Ends program cleanly);end defun;;;* (defun tx (dpf dp /)(setqtxt (strcat ;Offer default(rtos (car dp)) "/"(rtos (+ 000 (cadr dp))) " ") dpi (list (car dp) (- (cadr dp) 1.0)));setq(mand "_.TEXT" "_R" dp "0.2" "90" txt"_.line" dpi dp "");mand(if dpf (mand "_.line" dpf dp ""))(princ));defun ;;;* DSG types coordinates and draws lines between them;;;* It uses the current style of points and text with height 0.2 and angle 90(defun C:DSG ( / dp dp1 dp2 txt)(setq cmdech (getvar "CMDECHO")) ;Save mand echo(setvar "CMDECHO" 0) ;Turn mand echo off(graphscr)(mand "_.LAYER" "_M" "D" "_C" "6" "" "")(repeat 25(setqdp1 dp ;Assign variablesdp (getpoint "\nEnter design point: " ) ;Get design pointtxt (strcat " " ;Offer default(rtos (car dp)) "/"(rtos (+ 000 (cadr dp))) " ") dp2 (list (- (car dp) 0) (- (cadr dp) 1.5)) );setq(mand "_.TEXT" "_R" dp "0.2" "90" txt"_.line" dp2 dp "");mand(if dp1 (mand "_.line" dp1 dp "")));repeat (setvar "CMDECHO" cmdech) ;Restore mand echo(princ) ;Ends program cleanly);end defun(defun C:ARE ()(mand "_.AREA" "E" "L"));DEFUN;;;* (defun C:LTL ()(mand "_.LINETYPE" "_S" "BYLAYER" ""));DEFUN