Thứ Ba, 3 tháng 1, 2023

Copy và Align trong AutoCAD | Free lisp Copy then Align in AutoCAD | AutoLISP Reviewer

 Lệnh Copy và Align trong cùng một lệnh CA



Tải đoạn Lisp sau đây:


Tải đoạn mã sau


1 Lệnh "CA" hoặc "COPYALIGN"

CA COPYALIGN.lsp


(hoặc copy nội dung sau, lưu lại dưới dạng file *.lsp)
Code:

(defun c:CA()(princ "\nCopyAlign")(c:copyalign)(princ))

(defun c:COPYALIGN (/ sSet P11 P12 P21 P22 1st 2nd)

;;Combines COPY and ALIGN commands

;;by Jim Smith 2002

(or(member "geom3d.arx" (arx))(arxload "geom3d" nil))

(command "_.undo" "_be")

(setq sSet (ssget))

(if sSet

(progn

(setq P11 (getpoint "Specify first source point: ")

P12 (getpoint P11 "\nSpecify first desintation point: ")

1st (cons 256 (list P11 P12)))

(grvecs 1st)

(setq P21 (getpoint "\nSpecify second source point: ")

P22 (getpoint P21 "\nSpecify second desintation point: ")

2nd (cons 256 (list P21 P22)))

(grvecs 2nd)

(command "_.COPY" sSet "" "0,0,0" "@")

(align sSet P11 P12 P21 P22 "" "")

)

)

(setq sSet nil)

(grvecs (list P11 P12))(grvecs (list P21 P22))

(command "_.undo" "_e")

(princ)

)


Nguồn tham khảo: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/combining-copy-amp-align-command/td-p/800572 

Không có nhận xét nào:

Đăng nhận xét

Lấy ngày build ứng dụng dotNet trong Visual Studio | Get build date in Visual Studio | AutoLISP Reviewer

AutoLISP Thật là đơn giản       Thông tin thêm: 👉👉👉