lsp 程序编写 遇到困难。求助
刚开始自学,计划是做成这样,可是在剪切的时候并没有达到目标。高手给指点指点。(等分数是随机,不定)
(defun c:chilun()
(setq cen1 (getpoint "\n 中心点:"))
(setq rr1 (getdist cen1 "\n 大半径 :"))
(command "circle" cen1 rr1)
(setq en1 (entlast))
(command "circle" cen1 "d" rr1)
(setq cen2 (polar cen1 0 rr1))
(setq rr2 (getdist cen2 "\n 小半径 : "))
(setq nn (getint "\n 等分数 : "))
(setq ang 0 ss (ssadd))
(setq angdd (/ (* pi 2) nn))
(repeat nn
(command "circle" cen2 rr2)
(setq ss (ssadd (entlast) ss))
(setq ang(+ ang angdd))
(setq cen2 (polar cen1 ang rr1))
)
(setq ang 0)
(repeat nn
(command "trim" ss "" (polar cen1 ang rr1 ) "")
(setq ang (+ ang angdd))
)
(setq ang1 (* -1(/ angedd 2.0)) ang2 (+ang1 angdd) ang 0)
(repeat nn
(command "trim" (polar cen1 ang1 rr1) (polar cen1 ang2 rr1 ) "" (polar cen1 ang (-rr1 rr2)) "")
(setq ang1 (+ang1 angdd) ang2 (+ang2 angdd) ang (+ang angdd))
)
(prinl)
) 厉害哦,这个的确很实用 这是干什么的,我没听说过什么LSp
页:
[1]