我编制的一小段程序,要达到对话框的零件效果
而左视图的参数d老是被参数q覆盖,造成画图错误
哪位大侠快点帮忙。以下是画图子程序
(defun sub_chk_layer()
(setq chklay (tblsearch "layer" "str"))
(if (= chklay nil)
(command "layer" "n" "str" "c" "4" "str" "")
)
(setq chklay (tblsearch "layer" "txt"))
(if (= chklay nil)
(command "layer" "n" "txt" "c" "3" "txt" "")
)
(setq chklay (tblsearch "layer" "dim"))
(if (= chklay nil)
(command "layer" "n" "dim" "c" "5" "dim" "")
)
(setq chklay (tblsearch "layer" "hat"))
(if (= chklay nil)
(command "layer" "n" "hat" "c" "6" "hat" "")
)
(setq chklay (tblsearch "layer" "cen"))
(if (= chklay nil)
(command "layer" "n" "cen" "c" "1" "cen" "lt" "center" "cen" "")
)
(setq chklay (tblsearch "layer" "hid"))
(if (= chklay nil)
(command "layer" "n" "hid" "c" "2" "hid" "lt" "hidden" "hid" "")
)
)
(defun cen()
(command "layer" "s" "cen" ""))
(defun hid()
(command "layer" "s" "hid" ""))
(defun str()
(command "layer" "s" "str" ""))
(defun txt()
(command "layer" "s" "txt" ""))
(defun dim()
(command "layer" "s" "dim" ""))
(defun hat()
(command "layer" "s" "hat" ""))
(defun draw_dialjlm()
(setq r (* 0.5 d))
(setq d1 (* 0.9 d))
(setq r1 (* 0.5 d1))
(cond ((= d 12) (setq l 40) (setq q 21.9) (setq s 19))
((= d 16) (setq l 50) (setq q 27.7) (setq s 24))
((= d 20) (setq l 60) (setq q 34.6) (setq s 30))
((= d 24) (setq l 75) (setq q 41.6) (setq s 36))
((= d 30) (setq l 90) (setq q 53.1) (setq s 46))
((= d 36) (setq l 110) (setq q 63.5) (setq s 55))
((= d 42) (setq l 130) (setq q 75) (setq s 65))
((= d 48) (setq l 160) (setq q 85.5) (setq s 75))
(t (princ "\n没有此值"))
)
(setq r2 (- (* 1.5 d) (sqrt (- (* 2.25 d d) (* 0.25 q q)))))
;以下依据不同的类别,调用不同的绘图模式
(cond ((= ddtype 1) (setq pa (getpoint "请输入基点:"))
(setq pb (polar pa 0 l))
(setq pc (polar pa (* pi 0.5) r))
(setq pd (polar pc 0 l))
(setq pe (polar pa (* pi 0.5) (* 0.5 q)))
(setq pf (polar pe 0 l))
(sub_chk_layer)