Chuyển đến nội dung
Diễn đàn CADViet
Đăng nhập để thực hiện theo  
nghau90

"yêu cầu" Lisp thay đổi font dim hàng loạt

Các bài được khuyến nghị

E hay phải tập hợp các bản vẽ , rất nhiều loại dim cùng tỉ lệ khác nhau. các bác giúp e 1 lisp thay đổi tất cả font dim về 1 font mong muốn. kiểu như,  chọn tất cả đánh lệnh => chọn kiểu font muốn thay=> ok.

xin cảm ơn 

  • Vote giảm 1

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Dựa theo lisp của Ketxu trong bài này: http://www.cadviet.com/forum/topic/53208-yeu-cau-lisp-thay-doi-chieu-cao-text-cua-dimstyle-cuc-nhanh/

Xin phép  Ketxu sửa lại giúp chủ thớt:


;;; 1. Change cho toan bo DimStyle trong ban ve :

(defun c:fdima (/ table ts)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(defun table (s / d r)

(while (setq d (tblnext s (null d)))

(setq r (cons (cdr (assoc 2 d)) r))))

(setq ts (getstring "\nText Style: "))

(setvar "cmdecho" 0)

(mapcar '(lambda(x)(command "-DIMSTYLE" "R" x)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" x "Y")) (table "DIMSTYLE"))

(command "undo" "en")(princ))

 

;;; 2. Pick den dau change den do:

(defun c:fdimb (/ lstDstyle ts ent dstyle)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(setvar "cmdecho" 0)

(setq ts (getstring "\nText Style: "))

(while (setq ent (car (entsel "\n Pick dim :")))

(if (setq dstyle (cdr (assoc 3 (entget ent))))

(if (not (vl-position dstyle lstDstyle))

(progn

(setq lstDstyle (cons dstyle lstDstyle))

(command "-DIMSTYLE" "R" dstyle)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" dstyle "Y")

)

(princ "\nAlready Dimension Style Picked")

)

)

)

(command "undo" "en")

(princ))

;;;; 3. Chon 1 loat roi change:

(defun c:fdimc (/ lstDstyle ts i ss ent dstyle)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(setvar "cmdecho" 0)

(setq ts (getstring "\nText Style: ") i 0 ss (ssget (list (cons 0 "DIMENSION"))))

(while (setq ent (ssname ss i))

(if (setq dstyle (cdr (assoc 3 (entget ent))))

(if (not (vl-position dstyle lstDstyle))

(progn

(setq lstDstyle (cons dstyle lstDstyle))

(command "-DIMSTYLE" "R" dstyle)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" dstyle "Y")

)

)

)

(setq i (1+ i))

)

(command "undo" "en")

(princ))

  • Vote tăng 2

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Dựa theo lisp của Ketxu trong bài này: http://www.cadviet.com/forum/topic/53208-yeu-cau-lisp-thay-doi-chieu-cao-text-cua-dimstyle-cuc-nhanh/

Xin phép  Ketxu sửa lại giúp chủ thớt:


;;; 1. Change cho toan bo DimStyle trong ban ve :

(defun c:fdima (/ table ts)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(defun table (s / d r)

(while (setq d (tblnext s (null d)))

(setq r (cons (cdr (assoc 2 d)) r))))

(setq ts (getstring "\nText Style: "))

(setvar "cmdecho" 0)

(mapcar '(lambda(x)(command "-DIMSTYLE" "R" x)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" x "Y")) (table "DIMSTYLE"))

(command "undo" "en")(princ))

 

;;; 2. Pick den dau change den do:

(defun c:fdimb (/ lstDstyle ts ent dstyle)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(setvar "cmdecho" 0)

(setq ts (getstring "\nText Style: "))

(while (setq ent (car (entsel "\n Pick dim :")))

(if (setq dstyle (cdr (assoc 3 (entget ent))))

(if (not (vl-position dstyle lstDstyle))

(progn

(setq lstDstyle (cons dstyle lstDstyle))

(command "-DIMSTYLE" "R" dstyle)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" dstyle "Y")

)

(princ "\nAlready Dimension Style Picked")

)

)

)

(command "undo" "en")

(princ))

;;;; 3. Chon 1 loat roi change:

(defun c:fdimc (/ lstDstyle ts i ss ent dstyle)

(grtext -1 "Free lisp from Cadviet @Ketxu")

(command "undo" "be")

(setvar "cmdecho" 0)

(setq ts (getstring "\nText Style: ") i 0 ss (ssget (list (cons 0 "DIMENSION"))))

(while (setq ent (ssname ss i))

(if (setq dstyle (cdr (assoc 3 (entget ent))))

(if (not (vl-position dstyle lstDstyle))

(progn

(setq lstDstyle (cons dstyle lstDstyle))

(command "-DIMSTYLE" "R" dstyle)(setvar "DIMTXSTY" ts)(command "-DIMSTYLE" "S" dstyle "Y")

)

)

)

(setq i (1+ i))

)

(command "undo" "en")

(princ))

em tải lisp của bác về nhưng vẫn không sử dụng được mong bác giúp ehttp://www.cadviet.com/upfiles/6/155204_hc.dwg

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Tạo một tài khoản hoặc đăng nhập để nhận xét

Bạn cần phải là một thành viên để lại một bình luận

Tạo tài khoản

Đăng ký một tài khoản mới trong cộng đồng của chúng tôi. Điều đó dễ mà.

Đăng ký tài khoản mới

Đăng nhập

Bạn có sẵn sàng để tạo một tài khoản ? Đăng nhập tại đây.

Đăng nhập ngay
Đăng nhập để thực hiện theo  

×