Jump to content

Lisp lệnh C1 trong chủ đề “cách chọn đối tượng vừa được copy ra ?”

betnovate n skin cream price in india This morning chief economist Peter Praet is out saying rates can stay low or fall as long as inflation remains moderate, while Vice President Constancio is looking at the sluggish growth outlook and predicting that policy will have to stay loose for a “long time”.
keflex 500 mg price walgreens But recovery at Alcatel-Lucent, which has lost more than $10billion since it was created through a 2006 merger, will dependin part on whether telecom operators increase overall spendingin the coming years to build superfast mobile broadband or ifthey trim budgets elsewhere to compensate.
tetracycline medicine names Jacobs will help provide a steadying presence to the young running back corps, which also includes seventh-round pick Michael Cox. Jacobs, 31, has a general knowledge of offensive coordinator Kevin Gilbride’s playbook. He spent his first seven seasons with the Giants, and just two years ago, he teamed with Ahmad Bradshaw in the backfield as Big Blue rumbled to a surprise Super Bowl XLVI victory over the Pats.

Tệp .lsp gốc không còn trên máy chủ. Hãy chép mã nguồn bên dưới (lấy từ bài viết gốc) vào một tệp văn bản, lưu với đuôi .lsp.

Cách dùng

  1. Chép mã nguồn, lưu thành tệp 121838_c1.lsp.
  2. 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ẽ.
  3. Gõ lệnh C1 để chạy lisp.

Mã nguồn 121838_c1.lsp (trích từ bài viết gốc)

(defun C:c1 ( / ss )
 (setvar "CMDECHO" 1)
 ;;;Creat Marker
 (mip:mark)
 ;;;Preform commands
 (princ "\nSelect objects for copying... ")
 (setq ss (ssget "_:L"))
 (command "_COPY" ss "" "_M")
 (while (> (getvar "CMDACTIVE") 0)(command pause))
;;; Select all entities created after copy
 (setq ss (mip:get-last-ss))
;;; Change color new objects to red
 (if ss
   (command "_select" ss "" )
   )
 (setq ss nil)
 (princ)
 )

(defun mip:mark ( )
 ;;;* Mark data base to allow KB:catch.
;;;* [url="http://www.theswamp.org/index.php?topic=15863.0"]http://www.theswamp.org/index.php?topic=15863.0[/url]
(if (setq *mip:mark (entlast)) nil
   (progn (entmake '((0 . "point") (10 0.0 0.0 0.0)))
      (setq *mip:mark (entlast))(entdel *mip:mark)))(princ))
;;;* returns selection set of entities since last mip:mark.
(defun mip:get-last-ss (/ ss tmp val)
(setq val (getvar "cmdecho"))(setvar "cmdecho" 0)
(if *mip:mark (progn (setq ss (ssadd))
(while (setq *mip:mark (entnext *mip:mark))(ssadd *mip:mark ss))
(command "._select" ss "")(setq tmp ss ss nil));_progn
(alert "*mip:mark not set. \n run (mip:mark) before mip:get-last-ss."));_if
(setvar "cmdecho" val) tmp)

Thảo luận gốc

Lisp được chia sẻ trong chủ đề cách chọn đối tượng vừa được copy ra ?. Xem đúng bài viết #121838 để đọc hướng dẫn và trao đổi thêm.

Về Thư viện AutoLisp (trang 97)