非现场熔透焊frth
(defun c:frth()(setq p1 (getpoint "\n焊缝位置:"))
(Setq p2 (getpoint "\n基线位置:"))
(Setq z$ (getstring "\n焊缝高度:"))
(if (> (car p2) (car p1)) (setq p3 (polar p2 0 20))
(setq p3 (polar p2 pi 20))
)
(if (> (car p2) (car p1)) (setq p4 (list (+ (car p2) 15) (+ (cadr p2) 3)))
(setq p4 (list (- (car p2) 8) (+ (cadr p2) 3)))
)
(setq p5 (list (car p4) (- (cadr p4) 3)))
(setq p7 (list (+ (car p5) 3) (cadr p5)))
(setq p8 (list (- (car p5) 5.5) (+ (cadr p2) 1.2)))
(setq ang (angle p1 p2))
(setq p9 (polar p1 ang 4))
(setq p10 (list (- (car p8) 4) (+ (cadr p8) 1.5)))
(setq p11 (polar p2 (+ Pi ang) 2))
(if (> (car p2) (car p1)) (setq p12 (list (+ (car p2) 2) (cadr p2)))
(setq p12 (list (- (car p2) 2) (cadr p2)))
)
(if (> (cadr p2) (cadr p1)) (setq p13 (list (car p2) (+ (cadr p2) 2)))
(setq p13 (list (car p2) (- (cadr p2) 2)))
)
(command "line" p1 p2 p3 "")
(command "line" p4 p5 "")
(command "line" p4 p7 "")
(command "pline" p1 "w" "0" "0.8" p9 "")
(command "arc" p11 p13 p12)
(command "circle" p10 "1.5")
(command "donut" "0" "1" p2 "")
(command "text" p8 "4" "0" z$ "")
)
页:
[1]