Jump to content

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):

Cách dùng

  1. Tải tệp 51017_dimmcur_dmc.lsp về máy.
  2. 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ẽ.
  3. 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.

Về Thư viện AutoLisp (trang 16)