看板 Cad_Cae 關於我們 聯絡資訊
新的版本 不用管 group (defun PurgeAllGroups (/ grpList index grp) (setq grpList (dictsearch (namedobjdict) "ACAD_GROUP")) (setq index 1) (while (setq grp (nth index grplist)) (if (= (car grp) 3) (entdel (cdr (nth (+ index 1) grplist))) ) (setq index (+ 1 index)) ) (princ) ) ; ----------------------------------------------- (defun c:test (/) (PurgeAllGroups) (command "sphere" '(0 0 0) 10) (command "-group" "c" "big" "big" "L" "") (command "sphere" '(5 0 0) 6) (command "-group" "c" "small" "small" "L" "") (command "subtract" "G" "big" "" "G" "small" "") (princ) ) ;| 指令: test sphere 指定中心點或 [三點(3P)/兩點(2P)/相切、相切、半徑(T)]: 指定半徑或 [直徑(D)] <6.0000>: 10 指令: -group 輸入群組選項 [?/排序(O)/加入(A)/移除(R)/分解(E)/更名(REN)/可選取的(S)/建立(C)] <建立>: c 輸入群組名稱或 [?]: big 輸入群組描述: big 選取物件: L 找到 1 個 選取物件: 指令: sphere 指定中心點或 [三點(3P)/兩點(2P)/相切、相切、半徑(T)]: 指定半徑或 [直徑(D)] <10.0000>: 6 指令: -group 輸入群組選項 [?/排序(O)/加入(A)/移除(R)/分解(E)/更名(REN)/可選取的(S)/建立(C)] <建立>: c 輸入群組名稱或 [?]: small 輸入群組描述: small 選取物件: L 找到 1 個 選取物件: 指令: subtract 選取要從中減去的實體、曲面或面域 .. 選取物件: G 輸入群組名稱: big 找到 1 個 選取物件: 選取要減去的實體、曲面和面域 .. 選取物件: G 輸入群組名稱: small 找到 1 個 選取物件: 指令: 指令: 3dcorbit 按下 Esc 或 Enter 結束,或按滑鼠右鍵來顯示快顯功能表。 |; ※ 引述《tn00364361 (小氵斿)》之銘言: : 小弟我查不到如何在autolisp裡面使用subtract這個功能 : 我的程式碼: : (defun c:test (/) : (command "sphere" '(0 0 0) 10) : (command "sphere" '(5 0 0) 6) : (princ) : ) : 我想用第二個小球讓第一個大球有一個空腔 : 是否有哪位高手願意幫我一下呢 >"< -- e-mail: sjgau4311@gmail.com 我的課程介紹網頁: http://www.csie.ntu.edu.tw/train/teacher_display.php?num=18 AutoCAD 台灣地區菁英講師獲選 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.193.224.204
tn00364361:多謝你!! 05/24 18:53
sjgau:請問,這個城市設計,有沒有符合您的需求? 05/24 20:05