用autolisp編程可以實現.
(command "pline" )
(setq n 0)
(repeat 1000
(command (polar (list 0 0) (/ n 57.3) n))
(setq n (1+ n))
)
(command)
彈簧和螺紋(三維)
1、打開CAD後,找工具/AUTOLISP/VISUAL LISP編輯器,打開.點新建文件
2、然後輸入
(defun c:luoxuan
(/)
(setq b1 (getpoint "請指定螺旋線基點: "))
(setq r (getreal "請輸入螺紋平均半徑: "))
(setq disp (getreal "請輸入螺紋節距: "))
(setq n (getint "請輸入每圈細化段數: "))
(setq delta (/ (* 2.0 pi) n))
(setq j (/ disp n))
(setq bb (caddr b1))
(setq ang 0)
(setq jj 0)
(Command "UCS" "o" b1)
(Command "3dpoly" (list r 0 0))
(repeat n
(setq jj(+ jj 1)
(setq ang(+ delta ang))
(setq pt2(list (* r (cos ang)) (* r (sin ang)) (+ 0 (* j jj))))
(Command pt2)
)
(Command "")
)
存盤為luoxuan.lsp,關閉編輯器
3、要用時,點工具/AUTOLISP/加載,找到luoxuan.lsp文件將其加載,關閉對話框.在命令行輸入luoxuan回車,就開始了螺旋線的繪制
我來補充
頂壹下(0)