Jump to content

Lisp lệnh FAKEDIMS trong chủ đề “lisp fake dim”

;;; Find Dimension Overrides
;;; Lucas3
;;; http://www.cadtutor.net/forum/showthread.php?83532-How-to-filter-Edited-Dimensions
;;; Will turn dim overrides Red. If there are no overrides, an alert box will display saying that no overrides were found.
;;; I edited the alert text for grammar
(defun C:FakeDims(/ i ss)
  (vl-load-com)
  (setvar "cmdecho" 0)
  (if (setq ss (ssget "X" '((0 . "DIMENSION") (-3 ("ACAD")))))
    (repeat (setq i (sslength ss))
      (entmod (list (cons -1 (ssname ss (setq i (1- i)))) (list -3 (list "ACAD"))))
    )
    (if (setq ss (ssget "X" '((0 . "DIMENSION") (-4 . "<AND")(-4 . "<NOT")(1 . "")(-4 . "NOT>")(-4 . "<NOT")(1 . "*<>*")(-4 . "NOT>")(-4 . "AND>"))))
      (repeat (setq i (sslength ss))
          (vlax-put-property (vlax-ename->vla-object (ssname ss (setq i (1- i)))) "textcolor" 1) 
      )
      (alert "No Edited Dimensions Found!")
    )
  )
  (princ)
)

 

Cách dùng

  1. Tải tệp 453388_fakedims.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 FAKEDIMS để chạy lisp.

Mã nguồn 453388_fakedims.lsp

;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/183591-lisp-fake-dim/
;;; Find Dimension Overrides
;;; Lucas3
;;; http://www.cadtutor.net/forum/showthread.php?83532-How-to-filter-Edited-Dimensions
;;; Will turn dim overrides Red. If there are no overrides, an alert box will display saying that no overrides were found.
;;; I edited the alert text for grammar
(defun C:FakeDims(/ i ss)
  (vl-load-com)
  (setvar "cmdecho" 0)
  (if (setq ss (ssget "X" '((0 . "DIMENSION") (-3 ("ACAD")))))
    (repeat (setq i (sslength ss))
      (entmod (list (cons -1 (ssname ss (setq i (1- i)))) (list -3 (list "ACAD"))))
    )
    (if (setq ss (ssget "X" '((0 . "DIMENSION") (-4 . "<AND")(-4 . "<NOT")(1 . "")(-4 . "NOT>")(-4 . "<NOT")(1 . "*<>*")(-4 . "NOT>")(-4 . "AND>"))))
      (repeat (setq i (sslength ss))
          (vlax-put-property (vlax-ename->vla-object (ssname ss (setq i (1- i)))) "textcolor" 1) 
      )
      (alert "No Edited Dimensions Found!")
    )
  )
  (princ)
)

Thảo luận gốc

Lisp được chia sẻ trong chủ đề lisp fake dim. Xem đúng bài viết #453388 để đọc hướng dẫn và trao đổi thêm.

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