close

複製BLOCK中部分物件_Y227(20131115)
(本程式2013/08/17首次發表於AutoCAD顧問論壇)

 

;;複製圖塊中部分物件
;;for AutoCAD 2013 中文版之 AutoLISP
;; 2013/11/15

(defun C:Y227 (/ scm shig sos *ERROR* obj ss)
    (setq scm  (getvar "cmdecho"))
    (setq shig (getvar "highlight"))
    (setq sos  (getvar "osmode"))
        (setvar "cmdecho"   0)
        (setvar "highlight" 1)
        (setvar "osmode"    0) ;; 無 (NON)

    (defun *ERROR* (msg)
        (setvar "clayer" "0")
        (setvar "celtype" "ByLayer")
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n*** Error: " msg " ***")))
    (princ) )

    (setq obj (entsel "\n指定圖塊: "))
    (command "._COPY" obj "" "0,0,0" "0,0,0")
    (command "._ERASE" "_L" "")
    (command "._EXPLODE" obj)
    (setq ss (ssget "P"))
    (prompt "\n  選取圖塊中要複製的物件... ")
    (command "._COPY" (ssget) "")
    (princ "\n指定基準點")
    (command pause)
    (princ "\n指定第二點")
    (command pause)
    (command "._OOPS")
    (command "._ERASE" ss "")
    (command "._REDRAW")
    (princ "\n****** End!  結束! ******")

    (setvar "cmdecho"   scm)
    (setvar "highlight" shig)
    (setvar "osmode"    sos)
(princ)
)
(prompt "\n****** Load << 複製圖塊中部分物件 >> Successful ******")
(prin1)

 

相關程式:
統計BLOCK數量(繪製表格或輸出Excel文字檔案)_Y541.LSP
http://yu0678.pixnet.net/blog/post/350160892

替換(個別選取或全部選取)BLOCK物件_Y047.LSP
http://yu0678.pixnet.net/blog/post/350160832

使用者BLOCK圖庫管理 v1.4_Y340.LSP
http://yu0678.pixnet.net/blog/post/350160904

使用者BLOCK圖庫管理_Y340.LSP
http://yu0678.pixnet.net/blog/post/350160883

 

arrow
arrow
    全站熱搜

    yu0678 (漁翁) 發表在 痞客邦 留言(0) 人氣()