Warning: file_get_contents(http://mikiurl.com/api/?url=http://www.autocadhocasi.com/forum/topic/autocad-liste-fonksiyonlari-1-2) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/autocadh/public_html/forum/bb-plugins/social-it/functions.php on line 844
;entmake ile line cizen fonksiyon..
(defun line_ciz (_bas _son _layer)
(entmake (list (cons 0 “LINE”)
(cons 8 _layer)
(cons 10 _bas)
(cons 11 _son)))
)
Kullanımı :
(setq p1 (list 10.0 20.0 0.0)
p2 (list 30.0 40.0 0.0)
)
(line_ciz p1 p2 “deneme”)
Yukaridaki kod, line_ciz() fonksiyonunu kullanarak (10,20,0) noktasindan (30,40,0) noktasina ‘deneme’ isimli layer’de bir çizgi çizer. Eger çizimde ‘deneme’ isimli bir layer yoksa otomatik olarak oluşturulur. Bu fonksiyon asagidaki kodla ayni isi yapar.
(command “LAYER” “M” “deneme” “”)
(command “LINE” p1 p2 “”)
Goruldugu gibi entmake fonksiyonunu kullanan line_ciz fonksiyonu cok daha kullanisli. Ayni zamanda entmake ile cizim yaparken layer degistirmeye gerek kalmiyor. Yani mesela “0″ layer’indayken “deneme” layer’ina bir cizgi ekleyebiliyoruz. Cizgi cizmek icin “deneme” layer’ina gecip cizgiyi cizip tekrar “0″ layer’ina donmemize gerek kalmiyor ve (command) fonksiyonundan daha hizli calisan bir kod elde etmis oluyoruz. Entmake ile yapilabilecekler line cizmekten ibaret degil elbette, bu fonksiyonla autocad’deki herhangi bir objeyi olusturabiliriz (layer, block, text, point , polyline vs.). Devam edecegiz.




