我下面这一段是选参考直线的角度来定后面绘图的角度的,但是在绘图中,却大部分角度是零度的,我想在零度的时候,就不用选参考直线,直接按空格键就默认是零度了,如果是其他的角度就选参考直线,请问要怎样改才能够实现? (setq Apc (entsel "\n选取参考方向的直线: ")) (setq pp2 (cadr Apc)) (setq Aen1 (entget (car Apc))) (setq Aang1 (cdr (assoc 10 Aen1))) (setq Aang2 (cdr (assoc 11 Aen1))) (setq jl1 (distance pp2 Aang1)) (setq jl2 (distance pp2 Aang2)) (if (< jl1 jl2) (setq Arad (angle Aang1 Aang2)) (setq Arad (angle Aang2 Aang1))) (setq Adeg (atof (angtos Arad 0 2))) (print (strcat "角度: " (rtos Adeg 2 5))) |