如何将上述例程附加到此lisp中
- (defun c:iab () (c:insertalldirectory))
- (defun c:insertalldirectory (/ DirPath filens)
- (setq DirPath (acet-ui-pickdir))
- (VL-LOAD-COM)
- (SETQ ACADOBJ (VLAX-GET-ACAD-OBJECT))
- (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ACADOBJ)))
- (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES))
- (SETQ NEWPATH (STRCAT OLDSUPPORT ";" DirPath ";"))
- (VLA-PUT-SUPPORTPATH FILES NEWPATH)
- (setq filens (vl-directory-files DirPath "*.dwg"))
- (foreach file filens
- (command "-INSERT" file '(0 0 0) "" "" "")
- )
- (command "Zoom" "e" "")
- (setvar "qaflags" 1)
- (command "explode" "all" "")
- (setvar "qaflags" 0)
- (command "_.saveas" "" DirPath (getvar 'dwgprefix) "dwg" 1))
- (command "filedia" "1")
- (command "cmddia" "1")
- (princ)
|