lisp chuyển màu các thuộc tính dynamic block
Mình upload file lên mà không được, nên up lại file dynamic block cần đổi mầu
Mong các bạn giúp đỡ
http://www.mediafire.com/download/g28t84ag3dbczhw/dynamic_block.dwg
Hề hề hề,
Thử dùng cái này coi đã ưng ý chưa hè???
(defun c:dmat (/ ss tag col i a b ) (alert "\n Chon cac block chua thuoc tinh can doi mau") (setq ss (ssget (list (cons 0 "insert") (cons 66 1)))) (setq tag (getstring "\n Nhap tag name cua thuoc tinh can doi mau : ") col (getint "\n Nhap so hieu mau muon doi thanh: ") i 0) (while (setq a (ssname ss i)) (setq b (entnext a)) (while (and b (/= (cdr (assoc 0 (entget b))) "SEQEND")) (if (and (= (cdr (assoc 0 (entget b))) "ATTRIB") (= (cdr (assoc 2 (entget b))) tag)) (progn (entmod (subst (cons 62 col) (assoc 62 (entget b)) (entget b))) (entupd b) ) ) (setq b (entnext b)) ) (setq i (1+ i)) ) )
(defun c:dmat (/ ss tag col i a b )
(alert "\n Chon cac block chua thuoc tinh can doi mau")
(setq ss (ssget (list (cons 0 "insert") (cons 66 1))))
(setq tag (getstring "\n Nhap tag name cua thuoc tinh can doi mau : ")
col (getint "\n Nhap so hieu mau muon doi thanh: ")
i 0)
(while (setq a (ssname ss i))
(setq b (entnext a))
(while (and b (/= (cdr (assoc 0 (entget b))) "SEQEND"))
(if (and (= (cdr (assoc 0 (entget b))) "ATTRIB") (= (cdr (assoc 2 (entget b))) tag))
(progn
(entmod (subst (cons 62 col) (assoc 62 (entget b)) (entget b)))
(entupd b)
)
)
(setq b (entnext b))
)
(setq i (1+ i))
)
- Tải lisp
- 289361_dmat.lsp
Cách dùng
- Tải tệp 289361_dmat.lsp về máy.
- Trong AutoCAD gõ lệnh APPLOAD, chọn tệp vừa tải rồi bấm Load. Cũng có thể kéo thả tệp .lsp vào cửa sổ bản vẽ.
- Gõ lệnh DMAT để chạy lisp.
Mã nguồn 289361_dmat.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/99198-xin-lisp-chuy%E1%BB%83n-m%C3%A0u-c%C3%A1c-thu%E1%BB%99c-t%C3%ADnh-dynamic-block/
(defun c:dmat (/ ss tag col i a b )
(alert "\n Chon cac block chua thuoc tinh can doi mau")
(setq ss (ssget (list (cons 0 "insert") (cons 66 1))))
(setq tag (getstring "\n Nhap tag name cua thuoc tinh can doi mau : ")
col (getint "\n Nhap so hieu mau muon doi thanh: ")
i 0)
(while (setq a (ssname ss i))
(setq b (entnext a))
(while (and b (/= (cdr (assoc 0 (entget b))) "SEQEND"))
(if (and (= (cdr (assoc 0 (entget b))) "ATTRIB") (= (cdr (assoc 2 (entget b))) tag))
(progn
(entmod (subst (cons 62 col) (assoc 62 (entget b)) (entget b)))
(entupd b)
)
)
(setq b (entnext b))
)
(setq i (1+ i))
)
)Thảo luận gốc
Lisp được chia sẻ trong chủ đề [Xin] lisp chuyển màu các thuộc tính dynamic block. Xem đúng bài viết #289361 để đọc hướng dẫn và trao đổi thêm.