cad二次开发过程中遇到的,在输入第二点的时候出现函数错误,请高手指点,代码如下:
(defunc:hk(/p1p2q1q2q3q4abcdefgh)(setqp1(getpoint"\n指定图框左下角点"))(setqp2(getpoint"\n指定图...
(defun c:hk(/ p1 p2 q1 q2 q3 q4 a b c d e f g h)
(setq p1 (getpoint"\n指定图框左下角点" ))
(setq p2 (getpoint"\n指定图框右上角点:" ))
(setq a(/ 1.532 42.015))
(setq b(/ 3.824 31.056))
(setq c(/ 1.595 31.056))
(setq d(/ 5.833 42.015))
(setq e(*(-(cadr p2)(cadr p1))a))
(setq f(*(-(car p2)(car p1))b))
(setq g(*(-(car p2)(car p1))c))
(setq h(*(-(cadr p2)(cadr p1))d))
(setq q1(list ((-(car p1)f) (-(cadr p1)e))))
(setq q2(list ((-(car p1)f) (+(cadr p2)h))))
(setq q3(list ((+(car p2)g) (+(cadr p2)h))))
(setq q4(list ((+(car p2)g) (-(cadr p1)e))))
(command "layer" "Make" "TK1" "Color" 255 "TK1" "Ltype"
"Center" "TK1" "LWeight" 0.1 "TK1" "")
(command "pline" q1 q2 q3 q4 "c"))
运行出现问题如下:
命令: hk
指定图框左下角点
指定图框右上角点:; 错误: 函数错误: 225.123 展开
(setq p1 (getpoint"\n指定图框左下角点" ))
(setq p2 (getpoint"\n指定图框右上角点:" ))
(setq a(/ 1.532 42.015))
(setq b(/ 3.824 31.056))
(setq c(/ 1.595 31.056))
(setq d(/ 5.833 42.015))
(setq e(*(-(cadr p2)(cadr p1))a))
(setq f(*(-(car p2)(car p1))b))
(setq g(*(-(car p2)(car p1))c))
(setq h(*(-(cadr p2)(cadr p1))d))
(setq q1(list ((-(car p1)f) (-(cadr p1)e))))
(setq q2(list ((-(car p1)f) (+(cadr p2)h))))
(setq q3(list ((+(car p2)g) (+(cadr p2)h))))
(setq q4(list ((+(car p2)g) (-(cadr p1)e))))
(command "layer" "Make" "TK1" "Color" 255 "TK1" "Ltype"
"Center" "TK1" "LWeight" 0.1 "TK1" "")
(command "pline" q1 q2 q3 q4 "c"))
运行出现问题如下:
命令: hk
指定图框左下角点
指定图框右上角点:; 错误: 函数错误: 225.123 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询