 - ;;--------单双开门---------
- (defun c:myu (/ th1 th2 thh thw point1 old_os old_cmd pt10 pt11 pt12 pt13 pt14 pt15
- )
- ;;保存系统变量设置
- (setq old_OS (getvar "OSMODE")
- old_CMD (getvar "CMDECHO")
- )
- (setvar "CMDECHO" 0)
- (command "-osnap" "INT")
- (setq point1 (getpoint "点取第一点:"))
- (if (= thw nil)
- (setq thw 900)
- )
- (setq th1 (getreal (strcat "\n门宽度<" (rtos ths 2 0) ">:")))
- (if (= th1 nil)
- (setq th1 thw)
- )
- (if (= thh nil)
- (setq thh 2400)
- )
- (setq th2 (getreal (strcat "\n门高度<" (rtos ths 2 0) ">:")))
- (if (= th2 nil)
- (setq th2 thh)
- )
- (progn
-
- ;;判断部分
- (setvar "OSMODE" 0)
- (command "-layer" "m" "mc"
- "C" "4" """")
- (if (<= th1 1100)
- ;; 画单开门
- (progn
- ;;门三点
- (setq Pt10 (polar point1 0 th1));门的右下点
- (setq Pt11 (polar point1 (* 0.5 pi) th2));门的左上点
- (setq Pt12 (polar pt11 0 th1));门的右上点
- ;;画门框线
- (command "Pline" point1 "W" "0" "" pt11 Pt12 pt10 "c")
- )
- ;;画双开门
- (progn
- ;;门三点
- (setq Pt10 (polar point1 0 th1));门的右下点
- (setq Pt11 (polar point1 (* 0.5 pi) th2));门的左上点
- (setq Pt12 (polar pt11 0 th1));门的右上点
- (setq Pt14 (polar point1 0 (/ th1 2)))
- (setq Pt15 (polar pt11 0 (/ th1 2)))
- (command "Pline" point1 "W" "0" "" pt11 Pt12 pt10 "c")
- (command "line" pt14 Pt15 "")
- )
- )
- (setvar "osmode" 0)
- ;;恢复系统变量设置
- (setvar "CMDECHO" old_CMD)
- (setvar "OSMODE" old_OS)
- ;;执行完毕返回0层
- (setvar "clayer" "0")
- )
-
- (princ "\n没有点取 结束")
- )
请高手看看这个小程序,执行后出现 “点取第一点:; 错误: 参数类型错误: numberp: nil”,哪里有问题 |