Command ini untuk membuat potongan dinding. Berikut program autolispnya :
(defun c:wall (/ pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 len ang angt)
(setvar "cmdecho" 0)
(command "undo" "be")
(initget 1)
(setq pt1 (getpoint "\nStarting Wall: "))
(initget 1)
(setq pt2 (getpoint pt1 "\nLengh: "))
(setq lama (getvar "osmode"))
(setvar "osmode" 0)
(setq ang (angle pt1 pt2))
(setq len (distance pt1 pt2))
(setq angt (angtos ang 4 4))
(if (<= (* pi 250) ang)(setq angt (angtos (- ang (/ pi 2)) 4 4)))
(setq pt3 (polar pt2 (+ (/ pi 2) ang) 150))
(setq pt4 (polar pt3 (+ pi ang) len))
(setq pt5 (polar pt1 (+ (/ pi 2) ang) 25))
(setq pt6 (polar pt5 ang len))
(setq pt7 (polar pt6 (+ (/ pi 2) ang) 100))
(setq pt8 (polar pt7 (+ pi ang) len))
(command "PLINE" pt1 pt2 pt3 pt4 "C")
(command "PLINE" pt5 pt6 pt7 pt8 "C")
(command "-HATCH" "P" "ansi32" "250" "0" "A" "A" "Y" "" "S" "last" "" "")
(setvar "osmode" lama)
(command "undo" "e")
)
(setvar "cmdecho" 0)
(command "undo" "be")
(initget 1)
(setq pt1 (getpoint "\nStarting Wall: "))
(initget 1)
(setq pt2 (getpoint pt1 "\nLengh: "))
(setq lama (getvar "osmode"))
(setvar "osmode" 0)
(setq ang (angle pt1 pt2))
(setq len (distance pt1 pt2))
(setq angt (angtos ang 4 4))
(if (<= (* pi 250) ang)(setq angt (angtos (- ang (/ pi 2)) 4 4)))
(setq pt3 (polar pt2 (+ (/ pi 2) ang) 150))
(setq pt4 (polar pt3 (+ pi ang) len))
(setq pt5 (polar pt1 (+ (/ pi 2) ang) 25))
(setq pt6 (polar pt5 ang len))
(setq pt7 (polar pt6 (+ (/ pi 2) ang) 100))
(setq pt8 (polar pt7 (+ pi ang) len))
(command "PLINE" pt1 pt2 pt3 pt4 "C")
(command "PLINE" pt5 pt6 pt7 pt8 "C")
(command "-HATCH" "P" "ansi32" "250" "0" "A" "A" "Y" "" "S" "last" "" "")
(setvar "osmode" lama)
(command "undo" "e")
)
Cara menggunakan program ini :
1. Copy dan paste program tsb ke dalam notepad
2. lalu save file tsb dengan extension .lsp
3. dari dalam program Autocad anda ketikan command / perintah APPLOAD
4. Pilih file lsp anda yg tadi kemudian klik tombol "load"
5. Setelah itu tutup dialog box dengan meng-klik tombol "close"
6. Pada command bar anda bisa masukan perintah wall
Silahkan dicoba.. :D