Lisp lệnh DIMMCUR DMC trong chủ đề “Lisp lấy Dim”
Bạn dùng thử LISP này (tên lệnh DimMCur, lệnh tắt : DMC):
- Tải lisp
- 51017_dimmcur_dmc.lsp
Cách dùng
- Tải tệp 51017_dimmcur_dmc.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 DIMMCUR DMC để chạy lisp.
Mã nguồn 51017_dimmcur_dmc.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/9256-lisp-l%E1%BA%A5y-dim/
(defun C:DimMCur(/ ent StyleName)
(princ (strcat "\nCurrent dimension style: " (getvar "DIMSTYLE")))
(while
(not
(and
(setq ent (car (entsel "\nSelect object DIMENSION to be set to the current dimension style:")))
(if ent (= (cdr (assoc 0 (entget ent))) "DIMENSION") )
)
)
(princ "\nSelect Again: ")
)
(if (and ent (/= (setq StyleName (cdr (assoc 3 (entget ent)))) (getvar "DIMSTYLE")) )
(command "DIMSTYLE" "R" StyleName) )
(princ (strcat "\nCurrent dimension style: " (getvar "DIMSTYLE")))
(princ)
)
(defun C:DMC() (C:DimMCur))Thảo luận gốc
Lisp được chia sẻ trong chủ đề Lisp lấy Dim. Xem đúng bài viết #51017 để đọc hướng dẫn và trao đổi thêm.