Lệnh QB
Tạo nhanh block mới mà không cần đặt tên. Chỉ cần chọn đối tượng và xác định basepoint
1 Thêm class QB.lsp
Lưu mã sau dưới dạng tệp tin QB_.lsp
Code:
(defun c:QB ( / ss pt)
(princ "\nSelect objects for Quick Block...")
(if (and (setq ss (ssget))
(setq pt (getpoint "\nSpecify insertion base point: ")))
(progn
;; Initialize loop or standard naming
(if (not g:qbCount) (setq g:qbCount 1))
(setq blkName (strcat "MyBlock" (itoa g:qbCount)))
;; Create the block and delete original geometry (or use 'retain')
(command "-block" blkName pt ss "")
;; Insert the newly created block back at the point
(command "-insert" blkName pt 1 1 0)
(setq g:qbCount (1+ g:qbCount))
(princ (strcat "\nBlock " blkName " created and inserted successfully."))
)
)
(princ "Create by lisp.vn")
(princ)
)Link tải (MediaFire)
---------------------------------------------------------------------------------------------
Mọi thông tin xin liên hệ Fanpage AutoLISP Thật là đơn giản!
Cảm ơn bạn đã theo dõi!

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