Lisp tính cao độ
------------------------do khoang cach giua 2 diem va ghi ra text ------ghi ra text------cach 2---------
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/index.php?showtopic=61450&pid=187391&st=0&#entry187391
(defun C:4( / ss L te p1 p2 textmau P)
(while (and (setq p1 (getpoint "\n Chon diem thu nhat :"))
(setq p2 (getpoint p1 "\n Chon diem thu hai :"))
)
(setq L (distance p1 p2))
(initget "T")
(setq p (getpoint "\nPick diem chen hoac go T de chon Text :"))
(if (/= p "T")
(progn
(if (not textmau) (setq textmau (car(entsel "\nChon Text mau:"))))
(entmake (list (cons 0 "TEXT") (cons 1 (rtos L 2 2)) (assoc 40 (entget textmau))
(cons 10 p) (cons 11 p) (assoc 7 (entget textmau))
))
)
(progn
(setq te (entget(car(entsel"\n Chon Text de gan ket qua :")))
te (subst (cons 1 (rtos L 2 2)) (assoc 1 te) te))
(entmod te)
)
)
)
)
Đây là lisp đo khoảng cách. Các bác sửa giúp em như trên với :
Ở bước : Pick diem chen hoac go T de chon Text , giúp em bỏ đi lựa chọn Pick điểm chèn, em muốn Chọn Text để gán kết quả luôn
Thank !
- Tải lisp
- 242826_4.lsp
Cách dùng
- Tải tệp 242826_4.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 4 để chạy lisp.
Mã nguồn 242826_4.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/74384-nh%E1%BB%9D-ch%E1%BB%89nh-s%E1%BB%ADa-lisp-t%C3%ADnh-cao-%C4%91%E1%BB%99/
------------------------do khoang cach giua 2 diem va ghi ra text ------ghi ra text------cach 2---------;; free lisp from cadviet.com;;; this lisp was downloaded from https://www.cadviet.com/forum/index.php?showtopic=61450&pid=187391&st=0&&do=findComment&comment=187391(defun C:4( / ss L te p1 p2 textmau P)(while (and (setq p1 (getpoint "\n Chon diem thu nhat :"))(setq p2 (getpoint p1 "\n Chon diem thu hai :")))(setq L (distance p1 p2))(initget "T")(setq p (getpoint "\nPick diem chen hoac go T de chon Text :"))(if (/= p "T")(progn(if (not textmau) (setq textmau (car(entsel "\nChon Text mau:"))))(entmake (list (cons 0 "TEXT") (cons 1 (rtos L 2 2)) (assoc 40 (entget textmau))(cons 10 p) (cons 11 p) (assoc 7 (entget textmau)))))(progn(setq te (entget(car(entsel"\n Chon Text de gan ket qua :")))te (subst (cons 1 (rtos L 2 2)) (assoc 1 te) te))(entmod te)))))
Thảo luận gốc
Lisp được chia sẻ trong chủ đề [Nhờ chỉnh sửa] Lisp tính cao độ. Xem đúng bài viết #242826 để đọc hướng dẫn và trao đổi thêm.