CAD X,Y坐标标注AUTO LISP程序
;;(DEFUN IDPT(/ p px py pxx pyy) (DEFUN IDPT () (SETQ X T) (WHILE X
(SETVAR \(INITGET 1)
(SETQ PP (GETPOINT \\
(SETVAR \
(SETQ P (OSNAP PP \(IF(= P NIL)
(PROMPT \(SETQ X NIL))) (SETQ PXX (CAR P) PYY (CADR P) PX(RTOS PXX 2 PRE1) PY(RTOS PYY 2 PRE1)))
;;(DEFUN MAX_XY(WI PX PY / L PX PY) (DEFUN MAX_XY () (SETQ KKK \
1 / 30
(SETQ LLL \(SETQ LX (STRLEN PX) LY (STRLEN PY))(IF (> LX LY) (PROGN
(SETQ W_NU (- LX LY)) (WHILE (> W_NU 0) (SETQ PY (STRCAT \
(SETQ W_NU (- W_NU 1)))))(IF (< LX LY) (PROGN
(SETQ W_NU (- LY LX)) (WHILE (> W_NU 0) (SETQ PX (STRCAT \
(SETQ W_NU (- W_NU 1)))))(SETQ PY (STRCAT KKK PY)) (SETQ PX (STRCAT LLL PX)) (SETQ PXL(STRLEN PX) PYL(STRLEN PY)
MAXL (FLOAT (MAX PXL PYL)) L(* WI MAXL)))
;;(DEFUN TEXT_P(/ W WX WY) (DEFUN TEXT_P () (SETVAR \
2 / 30
(INITGET 1)
(SETQ W (GETPOINT \\
(SETQ WX (CAR W))
(SETQ WY (CADR W)));;(DEFUN DRLIN(CAL P W L / ALPW WE) (DEFUN DRLIN () (SETQ AL01 (+ PI CAL)) (SETQ ALPW (ANGLE P W)) (SETQ AG-D (- ALPW CAL)) (IF (> AG-D 0) (PROGN
(IF (AND (< AG-D (* PI 0.5)) (> AG-D (* PI 0))) (SETQ WE (POLAR W CAL L) BZ 1))
(IF (AND (> AG-D (* PI 0.5)) (< AG-D (* PI 1.5)))
(SETQ WE (POLAR W AL01 L) BZ 2))
(IF (AND (> AG-D (* PI
3 / 30
1.5)) (< AG-D (* PI 2))) (SETQ WE (POLAR W CAL L) BZ 3))
;>>>>>)(PROGN ;<<<<<
(IF (AND (> AG-D (* PI - 0.5)) (< AG-D (* PI 0))) (SETQ WE (POLAR W CAL L) BZ 1))
(IF (AND (< AG-D (* PI - 0.5)) (> AG-D (* PI - 1.5)))
(SETQ WE (POLAR W AL01 L) BZ 2))
(IF (AND (< AG-D (* PI 1.5)) (> AG-D (* PI -2))) (SETQ WE (POLAR W CAL L) BZ 3)) ;>>>>>))
(COMMAND \
0.0 \
4 / 30
(DEFUN DRCORD () (IF (= BZ 2) (SETQ WB WE)
(SETQ WB W))(SETQ WBX (POLAR WB (+ (* PI 0.5) CAL) H)
WBY (POLAR WB (+ (* PI
1.5) CAL) H))(SETQ AL_CAL (* 180 (/ CAL PI))) (COMMAND \
(COMMAND \WE CAL WI PRE2)
(DEFUN DRELEV () (IF (< WX PXX)
(SETQ EPL (POLAR WE AL01 (* WI 0.5)))
(SETQ EPR (POLAR WE CAL (* WI
0.5))))(SETQ DHH (GETREAL \\
(IF (= DHH NIL)
(PROMPT \(PROGN
(SETQ DH (RTOS DHH 2 PRE2)) (SETQ CLA (GETVAR \
5 / 30