(defun c:luoxuan(/ b1 r1 disp n ) (setvar "cmdecho" 0) (setq b1 (getpoint "请指定螺旋线基点: ")) (setq r1 (getreal "请输入螺纹平均半径: ")) (setq disp (getreal "请输入螺纹节距: ")) (setq n (getint "请输入每圈细化段数: ")) (command "ucs" "w") (setq delta (/ (* 0.5 pi) n)) (setq j (/ disp n)) (setq bb (caddr b1)) (setq ang 0) (setq jj 0) (Command "UCS" "o" b1) (Command "3dpoly" (list r1 0 0)) (repeat n (setq jj(+ jj 1)) (setq ang(+ delta ang)) (setq pt2(list (* r1 (cos ang)) (* r1 (sin ang)) (+ 0 (* j jj)))) (Command pt2) ) (Command "") (setq e1(entlast)) (command "ucs" "n" "x" "") (setq p1'(1 1)) (setq p2'(2 9)) (setq p3'(5 9)) (setq p4'(6 1)) (command "pline" p1 p2 p3 p4 "c") (setq e2(entlast)) (command "extrude" e2 "" "p" e1 "" ) (entdel e1) 这是个让一个梯形沿一段螺旋线拉伸的程序,如果输入某一组参数是,程序是能实现的,但是如果改变参数积不行了,不知道为什么? |