;;mysp.lsp by yuuboo ;;简易正弦波形 (defun c:mysp( / gdfx ps pe ang_se dis_se p1 p2 p3) (setq gdfx 12.0) ;;;;要改变波形的高度和方向 改gdfx的数值 比如改成-15.0 (setvar "cmdecho" 0) (if (setq ps (getpoint "\n 设备连线~起点:")) (if (setq pe (getpoint ps " 设备连线~终点:")) (progn (command "undo" "g") (setq ang_se (angle ps pe)) (setq dis_se (distance ps pe)) (setq p1 (polar (polar ps ang_se (/ dis_se 4.0)) (+ ang_se (* PI 0.5)) (/ dis_se gdfx)) ) (setq p2 (polar ps ang_se (/ dis_se 2.0))) (setq p3 (polar (polar pe ang_se (/ dis_se -4.0)) (- ang_se (* PI 0.5)) (/ dis_se gdfx)) ) (command "spline" "non" ps "non" p1 "non" p2 "non" p3 "non" pe "" "" "") (command "undo" "e") (c:mysp)
) ) ) (princ) ) |