Lisp lệnh PPP trong chủ đề “Nhờ viết hộ lisp vẽ composite panel”
Phù....!!!!Vẽ nhiều composite panel mệt quá, mà vẫn chưa tìm ra giải pháp. Rất mong các bác giúp.
Đây là em sưu tầm được trên mạng. Nhưng vẫn chưa theo ý của em.Cái khó nhất là chỗ góc lượn.
Em muốn thực hiện vẽ được như theo bản vẽ bên dưới.
File Composite panel.dwg
https://www.cadviet.com/upfiles/3/1_20.jpg
https://www.cadviet.com/upfiles/3/2_11.jpg
Đây là em sưu tầm được trên mạng. Nhưng vẫn chưa theo ý của em.Cái khó nhất là chỗ góc lượn.
Em muốn thực hiện vẽ được như theo bản vẽ bên dưới.
File Composite panel.dwg
https://www.cadviet.com/upfiles/3/1_20.jpg
https://www.cadviet.com/upfiles/3/2_11.jpg
- Tải lisp
- 113339_ppp.lsp
Cách dùng
- Tải tệp 113339_ppp.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 PPP để chạy lisp.
Mã nguồn 113339_ppp.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/24766-nh%E1%BB%9D-vi%E1%BA%BFt-h%E1%BB%99-lisp-v%E1%BA%BD-composite-panel/
(defun c:ppp (/ e1 a th ir e2 e3 e4 e5 e6 p1 p2 p3 p4 osn ofr oecho oerr)
(vl-load-com)
(setq oerr *error*)
(defun *error* (msg)
(princ "\n ERROR!
")
(setvar "filletrad" ofr)
(setvar "cmdecho" oecho)
(setvar "osmode" osn)
(setq *error* oerr)
(command)
(princ)
)
(princ "\n Draw Face Of Panel Profile : ")
(command "._pline")
(while (= 1 (getvar "CMDACTIVE"))
(command PAUSE)
)
(setq e1 (entlast)
a (getpoint "\n Pick A Point On The Interior Side Of The Panel : ")
th (/ (getdist "\n Input The Panel Thickness: ") 2)
ir (+ th 0.03125)
osn (getvar "osmode")
ofr (getvar "filletrad")
oecho (getvar "cmdecho")
)
(setvar "filletrad" (+ th 0.03125))
(setvar "osmode" 8)
(setvar "cmdecho" 0)
(command "offset" th e1 a "")
(setq e2 (entlast))
(command "erase" e1 "")
(command "fillet" "p" "l")
(princ "\n Pick A Point On The Exterior Side Of The Panel: ")
(command "offset" th e2 pause "")
(setq e3 (entlast))
(princ "\n Pick A Point On The Interior Side Of The Panel: ")
(command "offset" th e2 pause "")
(setq e4 (entlast))
(command "erase" e2 "")
(setq p1 (vlax-curve-getStartPoint e3)
p2 (vlax-curve-getStartPoint e4)
p3 (vlax-curve-getEndPoint e3)
p4 (vlax-curve-getEndPoint e4))
(command "line" p1 p2 "")
(setq e5 (entlast))
(command "line" p3 p4 "")
(setq e6 (entlast))
(command "pedit" e3 "j" e4 e5 e6 "" "")
(setvar "osmode" osn)
(setvar "filletrad" ofr)
(setvar "cmdecho" oecho)
(princ)
)Thảo luận gốc
Lisp được chia sẻ trong chủ đề Nhờ viết hộ lisp vẽ composite panel. Xem đúng bài viết #113339 để đọc hướng dẫn và trao đổi thêm.