Lisp lệnh TT trong chủ đề “Nhờ Tư Vấn Lisp Chuyển Polyline Sang Arc”
Tham gia 1 cái (có vẻ góc cong ổn hơn)
*** Nếu muốn để pline thì xóa dòng Explode pline->Arc
(defun c:tt (/ vertices-pl lsp lst pl)
(defun vertices-pl (e)
(if (setq e (member (assoc 10 e) e))
(cons (cdr (assoc 10 e)) (vertices-pl (cdr e)))))
(if (setq pl (car (entsel "\Pick PL")))
(progn (setq lsp (mapcar '(lambda (p) (trans p 0 1)) (vertices-pl (entget pl)))
lst (cdddr lsp))
(command "_.pline" "_none" (car lsp) "a" "s" "_none" (cadr lsp) "_none" (caddr lsp))
(while lst (command "_none" (car lst)) (setq lst (cdr lst)))
(command "")
(command "_.explode" (ssget "L")) ;Explode Pline->Arc
))
(princ))
*** Nếu muốn để pline thì xóa dòng Explode pline->Arc
(defun c:tt (/ vertices-pl lsp lst pl)
(defun vertices-pl (e)
(if (setq e (member (assoc 10 e) e))
(cons (cdr (assoc 10 e)) (vertices-pl (cdr e)))))
(if (setq pl (car (entsel "\Pick PL")))
(progn (setq lsp (mapcar '(lambda (p) (trans p 0 1)) (vertices-pl (entget pl)))
lst (cdddr lsp))
(command "_.pline" "_none" (car lsp) "a" "s" "_none" (cadr lsp) "_none" (caddr lsp))
(while lst (command "_none" (car lst)) (setq lst (cdr lst)))
(command "")
(command "_.explode" (ssget "L")) ;Explode Pline->Arc
))
(princ))
- Tải lisp
- 408921_tt.lsp
Cách dùng
- Tải tệp 408921_tt.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 TT để chạy lisp.
Mã nguồn 408921_tt.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/166263-nh%E1%BB%9D-t%C6%B0-v%E1%BA%A5n-lisp-chuy%E1%BB%83n-polyline-sang-arc/
(defun c:tt (/ vertices-pl lsp lst pl)Thảo luận gốc
Lisp được chia sẻ trong chủ đề Nhờ Tư Vấn Lisp Chuyển Polyline Sang Arc. Xem đúng bài viết #408921 để đọc hướng dẫn và trao đổi thêm.