- (defun C:BC1()
- (setvar "cmdecho" 0)
- (princ "[B冲绘制]")
- (setq l (getreal "\n B冲高度:"))
- (setq d (getreal "\n 直径: "))
- (setq sl (getstring "\n 数量: "))
- (setq p0 (getpoint "\n 摆放位置:"))
- (setq p0x (car p0))
- (setq p0y (cadr p0))
- (if (< d 7)
- (setq dd (+ (/ d 2) 1))
- )
- (if (>= d 7)
- (setq dd (+ (/ d 2) 1.5))
- )
- (setq p1x (- p0x dd))
- (setq p3y (- p0y 5))
- (setq p2x (+ p0x dd))
- (setq p1 (list p1x p0y))
- (setq p2 (list p2x p0y))
- (setq P3 (list p2x p3y))
- (setq P4 (list p1x p3y))
- (command "line" "none" p1 "none" p2 "none" p3 "none" p4 "none" p1 "")
- (setq p5x (+ p0x (/ d 2)))
- (setq p5y (- p0y 5 ))
- (setq p7x (- p0x (/ d 2)))
- (setq p7y (- p0y l))
- (setq p5 (list p5x p5y))
- (setq p6 (list p5x p7y))
- (setq P7 (list p7x p7y))
- (setq P8 (list p7x p5y))
- (command "line" "none" p5 "none" p6 "none" p7 "")
- (command "line" "none" p7 "none" p8 "")
- (command "dim" "ver" "none" p2 "none" p3 "none" "@4,0" "" "ver" "none" p2 "none" p6 "none" "@10,0" ""
- "hor" "none" p1 "none" p2 "none" "@0,4" "%%c<>" "hor" "none" P6 "none" p7 "none" "@0,-4" "%%c<>" "e")
- (command "text" "none" "@-8,-10" "2.5" "0" "名 称:B冲 " "")
- (command "change" "l" "" "p" "C" "3" "")
- (command "text" "none" "@-0,-5" "2.5" "0" "材 质:SKD11" "")
- (command "change" "l" "" "p" "C" "3" "")
- (command "text" "none" "@-0,-5" "2.5" "0" (strcat "数 量:"sl"PCS") "")
- (command "change" "l" "" "p" "C" "3" "")
- (command "text" "none" "@-0,-5" "2.5" "0" "热处理:HRC58-60" "")
- (command "change" "l" "" "p" "C" "3" "")
- (prompt "\n B冲已绘制完毕!")
- )
|