看板 Cad_Cae 關於我們 聯絡資訊
我幫你測試的結果, 是 完全沒有問題。 我想,是你在 輸入的時候,直接按 [Enter] 的關係。 請耐心的輸入 每一個應該輸入的數字, 如下: 請使用 外部信件和我連絡, 我會 一行,一行的教你, 一個字,一個字的 慢慢教你 e-mail: sjgau4311@gmail.com C:LSP_32 指令: lsp_32 漸開線中心點:0,0 小圓半徑<5>:5 水平偏移距離<5>:6 垂直偏移距離<5>:7 1/4圓弧漸開數量<9>:11 指令: z ZOOM 指定視窗角點,輸入比例係數 (nX 或 nXP),或 [全部(A)/中心點(C)/動態(D)/實際範圍(E)/前次(P)/比例(S)/視窗(W)/物件(O)] <即時 >: e 指令: z ZOOM 指定視窗角點,輸入比例係數 (nX 或 nXP),或 [全部(A)/中心點(C)/動態(D)/實際範圍(E)/前次(P)/比例(S)/視窗(W)/物件(O)] <即時 >: 0.8x ※ 引述《note100 (XD)》之銘言: : 因為最近需要畫螺旋圖 : 直接套用了書上以及版上的LISP語法 : 但是,使用之後,都各自出現問題 : 不知道是版本問題(我使用autoCAD 2011)? : 還是語法錯誤? : 版上的語法: : 最後出現 : ; 錯誤: 損壞的引數類型: numberp: nil : _$ ); end of c:spiral : (princ) : ; end of file : ; 錯誤: 其他的輸入右 paren : _$ : 我參考書本上的 : (defun c:lsp_32() : (setvar "cmdecho" 0) : (setq os (getvar "osmode")) : (setq p1 (getpoint "漸開線中心點:")) : (setq rr (getdist p1 "\n小圓半徑<5>:"))(if (null rr)(setq rr 5)) : (setq ofs_h (getreal "\n水平偏移距離<5>:"))(if (null ofs_h)(setq ofs_h 5)) : (setq ofs_v (getreal "\n垂直偏移距離<5>:"))(if (null ofs_v)(setq ofs_v 5)) : (setq NN (getint "\n1/4圓弧漸開數量<9>:"))(if (null nn)(setq nn 9)) : ;*************************************************************************** : (setq p2 (polar p1 0 ofs_h) : p3 (polar p2 (* pi 1.5) ofs_v) : p4 (polar p3 pi ofs_h) : ) : (setq pp_list(list p2 p3 p4 p1));將4點成串列 : (command "circle" p1 rr);畫第一個圓 : (setq new_rr rr rr_list '()) : (setq i 0 new_ang pi) : (setq cc_list'("1" "2" "3" "4" "5" "6" "7")) : (repeat nn : (if (= (rem i 2) 0) : (setq add_rr ofs_h) : (setq add_rr ofs_v) : ) : (setq arc_cen(nth (rem i 4) pp_list)) : (setq new_rr (+ new_rr add_rr)) : (setq arc_ps (polar arc_cen new_ang new_rr)) : (setvar "cecolor" (nth (rem i 7) cc_list)) : (command "arc" arc_ps "c" arc_cen "a" -90) : (setq rr_list (cons new_rr rr_list)) : (setq i (1+ i) new_ang (- new_ang (* pi 0.5))) : ) : (setq arc_pe (polar arc_cen new_ang (nth 4 rr_list))) : (command "arc" "" arc_pe) : (setvar "cecolor" "bylayer") : (setvar "osmode" os) : (prin1) : ) : 還是有誤 不知道該如何執行 謝謝! -- e-mail: sjgau4311@gmail.com 我的課程介紹網頁: http://www.csie.ntu.edu.tw/train/teacher_display.php?num=18 AutoCAD 台灣地區菁英講師獲選 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 42.73.95.85