非现场对焊fdh
(defun c:fdh()(setq p1 (getpoint "\n焊缝位置:"))
(Setq p2 (getpoint "\n基线位置:"))
(Setq z$ (getstring "\n焊缝高度:"))
(if (> (car p2) (car p1)) (setq p3 (polar p2 0 15))
(setq p3 (polar p2 pi 15))
)
(if (> (car p2) (car p1)) (setq p4 (list (+ (car p2) 9) (+ (cadr p2) 4)))
(setq p4 (list (- (car p2) 11) (+ (cadr p2) 4)))
)
(if (> (car p2) (car p1)) (setq p5 (list (+ (car p2) 9) (- (cadr p2) 4)))
(setq p5 (list (- (car p2) 11) (- (cadr p2) 4)))
)
(if (> (car p2) (car p1)) (setq p6 (list (+ (car p2) 11) (+ (cadr p2) 4)))
(setq p6 (list (- (car p2) 9) (+ (cadr p2) 4)))
)
(if (> (car p2) (car p1)) (setq p7 (list (+ (car p2) 11) (- (cadr p2) 4)))
(setq p7 (list (- (car p2) 9) (- (cadr p2) 4)))
)
(if (> (car p2) (car p1)) (setq p8 (list (+ (car p2) 9) (+ (cadr p2) 5)))
(setq p8 (list (- (car p2) 11) (+ (cadr p2) 5)))
)
(setq ang (angle p1 p2))
(setq p9 (polar p1 ang 4))
(command "line" p1 p2 p3 "")
(command "line" p4 p5 "")
(command "line" p6 p7 "")
(command "pline" p1 "w" "0" "0.8" p9 "")
(command "text" p8 "4" "0" z$ "")
)
页:
[1]