Download miễn phí từ https://www.lisp.vn/2022/10/cut-dimension-free-autolisp-lisp-cat.html
@autolispjustsimple Tạo mục lục tự động trong #autocad #cinemode ♬ nhạc nền - AutoLISP thật là đơn giản
Tải về
Download miễn phí từ https://www.lisp.vn/2022/10/cut-dimension-free-autolisp-lisp-cat.html
Code:
;-------------------------------------------Cat dim-----------------------------------
(DEFUN C:cd (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I
PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)
(defun sleep_osnap ()(setvar "OSMODE" (logior (getvar "OSMODE") 16384)))
(defun wake_osnap ()(setvar "OSMODE" (logand (getvar "OSMODE") -16385)))
(defun toggle_osnap ()(setvar "OSMODE" (boole 6 (getvar "OSMODE") 16384)))
(SETQ CMD (GETVAR "CMDECHO"))
(SETQ OLDERR *error*
*error* myerror)
(PRINC "Choose dimesions:")
(SETQ SS (SSGET))
(SETQ PT (GETPOINT "Select point: "))
(SETQ PT (TRANS PT 1 0))
(COMMAND "UCS" "W")
(SETQ LTH (SSLENGTH SS))
(SETQ DEM 0)
(sleep_osnap)
(WHILE (< DEM LTH)
(PROGN
(SETQ DS (ENTGET (SSNAME SS DEM)))
(SETQ KDL (CDR (ASSOC 0 DS)))
(IF (= "DIMENSION" KDL)
(PROGN
(SETQ PT10 (CDR (ASSOC 10 DS)))
(SETQ PT11 (CDR (ASSOC 11 DS)))
(SETQ PT13 (CDR (ASSOC 13 DS)))
(SETQ PT14 (CDR (ASSOC 14 DS)))
(SETQ N70 (CDR (ASSOC 70 DS)))
(IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
(PROGN
(SETQ GOCY (ANGLE PT10 PT14))
(SETQ GOCX (+ GOCY (/ PI 2)))
)
)
(SETQ PTI (POLAR PT GOCX 2))
(SETQ PT13I (POLAR PT13 GOCY 2))
(SETQ PT14I (POLAR PT14 GOCY 2))
(SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))
(SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))
(SETQ O13 (ASSOC 13 DS))
(SETQ O14 (ASSOC 14 DS))
(SETQ N13 (CONS 13 PT13N))
(SETQ N14 (CONS 14 PT14N))
(SETQ DS (SUBST N13 O13 DS))
(SETQ DS (SUBST N14 O14 DS))
(ENTMOD DS)
)
)
(SETQ DEM (+ DEM 1))
)
)
(COMMAND "UCS" "P")
(SETVAR "CMDECHO" CMD)
(wake_osnap)
(setq *error* OLDERR) ; Restore old *error* handler
(PRINC)
)
(hoặc copy nội dung sau)
Code:
;--------------------------------------dim possition------------------------------------
(DEFUN C:bd (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)
(defun sleep_osnap ()(setvar "OSMODE" (logior (getvar "OSMODE") 16384)))
(defun wake_osnap ()(setvar "OSMODE" (logand (getvar "OSMODE") -16385)))
(defun toggle_osnap ()(setvar "OSMODE" (boole 6 (getvar "OSMODE") 16384)))
(SETQ CMD (GETVAR "CMDECHO"))
(SETQ OLDERR *error*
*error* myerror)
(PRINC "Choose dimesions:")
(SETQ SS (SSGET))
(SETVAR "CMDECHO" 0)
(SETQ PT (GETPOINT "Select point: "))
(SETQ PT (TRANS PT 1 0))
(COMMAND "UCS" "W")
(SETQ LTH (SSLENGTH SS))
(SETQ DEM 0)
(sleep_osnap)
(WHILE (< DEM LTH)
(PROGN
(SETQ DS (ENTGET (SSNAME SS DEM)))
(SETQ KDL (CDR (ASSOC 0 DS)))
(IF (= "DIMENSION" KDL)
(PROGN
(SETQ PT13 (CDR (ASSOC 13 DS)))
(SETQ PT14 (CDR (ASSOC 14 DS)))
(SETQ PT10 (CDR (ASSOC 10 DS)))
(SETQ PT11 (CDR (ASSOC 11 DS)))
(SETQ N70 (CDR (ASSOC 70 DS)))
(IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
(PROGN
(SETQ GOCY (ANGLE PT10 PT14))
(SETQ GOCX (+ GOCY (/ PI 2)))
)
)
(SETVAR "OSMODE" 0)
(SETQ PTI (POLAR PT GOCX 2))
(SETQ PT10I (POLAR PT10 GOCY 2))
(SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))
(SETQ KC (DISTANCE PT10 PT10N))
(SETQ O10 (ASSOC 10 DS))
(SETQ N10 (CONS 10 PT10N))
(SETQ DS (SUBST N10 O10 DS))
(SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))
(SETQ O11 (ASSOC 11 DS))
(SETQ N11 (CONS 11 PT11N))
(SETQ DS (SUBST N11 O11 DS))
(ENTMOD DS)
)
)
(SETQ DEM (+ DEM 1))
)
)
(COMMAND "UCS" "P")
(wake_osnap)
(setq *error* OLDERR)
(PRINC)
)
Download miễn phí từ https://www.lisp.vn/2022/10/cut-dimension-free-autolisp-lisp-cat.html
--------------------------------------------------------------------------------------------------
Hướng dẫn tải
Lisp đang được chia sẻ miễn phí trong nhóm AJS trải nghiệm:
--------------------------------------------------------------------------------------------------
Giới thiệu ứng dụng in nhiều file dwg
Nguồn: AutoLISP Reviewer: Cut dimension free AutoLISP | Lisp cắt dim miễn phí trong cad | AutoLISP Reviewer
No comments:
Post a Comment