Trong thư viện AutoCAD có rất nhiều mẫu Hatch mà không phải lúc nào người dùng cũng sử dụng hết. Bài viết này xin gửi đến các bạn một cái nhìn (theo đúng nghĩa đen) về các mẫu Hatch.
Album tổng hợp các Hatch Pattern của AutoCAD 2008
Dưới đây là các mẫu Hatch sẵn có trong AutoCAD phiên bản 2008:
Đoạn mã do
Lee Mac giới thiệu, có tác dụng liệt kê tất cả mẫu Hatch có trong bản vẽ:
(defun hatchpatternlist ( / lst )
(foreach dir (cons (getvar 'dwgprefix) (parsesupportpaths (getenv "ACAD")))
(foreach pat (vl-directory-files dir "*.pat" 1)
(setq lst (cons (parsepatfile (strcat (fixdir dir) "\\" pat)) lst))
)
)
(vl-sort (unique (apply 'append lst)) '<)
)
(defun unique ( lst )
(if lst (cons (car lst) (unique (vl-remove (car lst) (cdr lst)))))
)
(defun fixdir ( str )
(vl-string-right-trim "\\" (vl-string-translate "/" "\\" str))
)
(defun parsesupportpaths ( str / pos )
(if (setq pos (vl-string-position 59 str))
(vl-remove "" (cons (substr str 1 pos) (parsesupportpaths (substr str (+ pos 2)))))
(list str)
)
)
(defun parsepatfile ( fn / fd hp ln )
(if
(and
(setq fn (findfile fn))
(setq fd (open fn "r"))
)
(progn
(while (setq ln (read-line fd))
(if (wcmatch ln "`**`,*")
(setq hp (cons (strcase (substr ln 2 (1- (vl-string-position 44 ln)))) hp))
)
)
(close fd)
(reverse hp)
)
)
)
Cách sử dụng:
(hatchpatternlist)
Album tổng hợp các Hatch Pattern của HS Harmony
Các mẫu Hatch có trong thư viện của HS Harmorny đi kèm với bộ cài của HS (TOPO, San nền HS, ...), trong thư mục "
C:\\Harmony Software\\FcodeTable\\Pattern". Trong đó có các mẫu như: Hatch ruộng lúa, Hatch rừng cây các loại, Hatch đồng cỏ, Hatch các loại mặt cắt địa chất, Hatch ao cá, ...
Các bạn không sử dụng TOPO, HS, có thể
download tại đây.
Khi đã tải về máy, giải nén vào một trong các đường dẫn sau:
1. C:\Program Files\AutoCAD 2008\Support
2. C:\Documents and Settings\Nguyen Van A*\Application Data\Autodesk\AutoCAD 2008(**)\R17.1\enu\Support
(*) Tên Username trong máy tính
(**) Phiên bản AutoCAD làm việc
3. Hoặc tạo một thư mục riêng và cài đặt thêm đường dẫn trong Options
 |
Thêm đường dẫn đến thư mục Support |
Các mẫu Hatch
Tên mẫu Hatch trùng với tên tệp tin .PAT có trong thư mục.
 |
Đồng cỏ |
 |
Diện tích nuôi thủy sản |
 |
Rừng cây lá kim |
 |
Rừng cây |
 |
Rừng cây xen kẽ |
 |
Dừng dừa, lá cọ |
 |
Rừng cây xen kẽ lá kim |
 |
Rừng cây lá kim |
 |
Rừng cây |
 |
Hàng cây xen kẽ cây bụi |
 |
Hàng cây bụi |
 |
Diện tích trồng lúa |
 |
Rừng cây |
 |
Cây dừa |
 |
Cuội kết |
 |
Bột kết |
 |
Cát kết |
 |
Sạn kết |
 |
Rừng cây |
 |
Sét kết |
 |
Sét than |
This comment has been removed by a blog administrator.
ReplyDelete