 - (defun ukword (bit kwd msg def / inp)
- (if (and def (/= def ""))
- (setq msg (strcat "\n" msg "<" def ">: ")
- bit (* 2 (fix (/ bit 2)))
- )
- (setq msg (strcat "\n" msg ": "))
- )
- (initget bit kwd)
- (setq inp (getkword msg))
- (if inp
- inp
- def
- )
- )
- (defun C:66 ()
- (setq msg "选择加腋方向:[1.一左/11.一上/2.二上/22.二右/3.三右/33.三下/4.四下/44.四左"
- uk (Ukword 1 "1 11 2 22 3 33 4 44" msg uk)
- )
- (cond ((= uk "1") (setq r1 0) (setq r2 (* 0.5 pi)))
- ((= uk "11") (setq r1 (* 0.5 pi)) (setq r2 0))
- ((= uk "2") (setq r1 (* 0.5 pi)) (setq r2 pi))
- ((= uk "22") (setq r1 pi) (setq r2 (* 0.5 pi)))
- ((= uk "3") (setq r1 pi) (setq r2 (* 1.5 pi)))
- ((= uk "33") (setq r1 (* 1.5 pi)) (setq r2 pi))
- ((= uk "4") (setq r1 (* 1.5 pi)) (setq r2 0))
- ((= uk "44") (setq r1 0) (setq r2 (* 1.5 pi)))
- (t (princ))
- )
- (if (setq L1 (getpoint "\n选择加腋位置(梁柱交点)<退出>: "))
- (progn
- (setq CL (getvar "clayer"))
- (command "layer" "make" "梁加腋图层" "c" "253" "" "")
- (setq p1 (polar L1 r1 500))
- (setq p2 (polar L1 r2 200))
- (command "cecolor" 7)
- (command "pline" L1 "w" "0" "0" "non" p1 "non" p2 "c")
- (command "cecolor" 256)
- (command "hatch" "solid" (entlast) "")
- (setvar "clayer" CL)
- )
- )
- (princ)
- )
|