本帖最后由 Gu_xl 于 2013-4-23 16:16 编辑
 - (defun c:tt (/ *error* cmdecho filename name path i)
- (defun *error* (s)
- (princ s)
- (setvar 'cmdecho cmdecho)
- )
- (setq cmdecho (getvar 'cmdecho))
- (setvar 'cmdecho 0)
- (cond
- ((not (setq filename (getfiled "保存文件名" "" "dwg" 1))))
- (t
- (setq name (VL-FILENAME-BASE filename)
- path (strcat (VL-STRING-RIGHT-TRIM
- "\\"
- (VL-FILENAME-DIRECTORY filename)
- )
- "\\"
- )
- i 0
- )
- (princ "\n选择写块物体:")
- (while (setq ss (ssget))
- (command "wblock"
- (strcat path name (itoa (setq i (1+ i))) ".dwg")
- ""
- "0,0,0"
- ss
- ""
- )
- (command "oops")
- (princ "\n继续选择写块物体<右键结束>:")
- )
- )
- )
- (setvar 'cmdecho cmdecho)
- (princ)
- )
|