- (defun c:plcs()
- (if (= (setq blc (getreal "\n1:?<1>")) nil)
- (setq blc 1)
- )
- (setq bl (/ blc 1000.0))
- (initget "L C")
- (if (= (setq bz (getkword "\n画直线-L/画圆-C <L>:")) nil)
- (setq bz "L")
- )
- (cond ((= bz "L")
- (while (setq p1 (getpoint "\n起点<回车结束>:"))
- (if (and (setq p2 (getpoint p1 "\n止点所在方向:"))
- (setq ll (getreal (strcat "\n直线长度<" (rtos (getvar "userr5")) ">:")))
- )
- (progn
- (setvar "userr5" ll)
- (setq ang (angle p1 p2)
- pt (polar p1 ang (/ ll bl))
- )
- (command "_line" p1 pt "")
- )
- )
- )
- )
- ((= bz "C")
- (while (setq p1 (getpoint "\n圆心<回车结束>:"))
- (if (setq rr (getreal (strcat "\n半径<" (rtos (getvar "userr4")) ">:")))
- (progn
- (setvar "userr4" ll)
- (command "_circle" p1 (/ rr bl))
- )
- )
- )
- )
- )
- (princ)
- )
|