 - ;; 原点批量插图块
- (defun c:tt (/ pf path lst)
- (defun sub (path lst mode / a name)
- (foreach a lst
- (setq name (strcat path a)
- name (if (= mode 0)
- name
- (strcat "*" name)
- )
- )
- (command "insert" name "0,0" "1" "1" "")
- )
- )
- (setq dwg (getfiled "指定原文件路径中的一个图形文件:>" "*" "dwg" 8)
- path (strcat (vl-filename-directory dwg) "\")
- lst (vl-directory-files path "*.dwg" 1)
- ukw (UKWORD 1 "1 2" "1-按块插入/2-解块插入" ukw)
- )
- (prompt "\n程序正在插入图幅,请等待...")
- (cond ((= ukw "1") (sub path lst 0))
- ((= ukw "2") (sub path lst t))
- )
- (princ)
- )
- (defun ukword (bit kwd msg def / inp)
- (if (and def (/= def ""))
- (setq msg (strcat "\n" msg "<" def ">: ")
- bit (* 2 (fix (/ bit 2)))
- )
- (setq msg (strcat "\n" msg ": "))
- )
- (initget bit kwd)
- (setq inp (getkword msg))
- (if inp
- inp
- def
- )
- )
|