Search the Community
Showing results for tags 'automate lisp'.
-
Hello, I'm an AutoLISP newbie and I need to iterate through a folder of .DWG files, running a lisp on each file one at a time with no prompts to the user. Can this be done in AutoLISP? Here is the lisp that will be run on each file: ;delete_layers_except (vl-load-com) ;(defun c:demo (/ aDoc name) (setvar 'Clayer "0") (repeat 4 (vla-purgeall (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object))))) (vlax-for itm (vla-get-layers aDoc) (if (and (not (wcmatch (setq name (vla-get-name itm)) "*|*")) (not (eq name "0")) (not (member name '("Fixture-Shapes" "CHECKLANE" ;"Arch-Wall-Interior (Construction)" ;"Arch-Wall-Interior" ;"Arch-Wall-Exterior" )))) (progn (vla-put-lock itm :vlax-false) (vl-cmdf "_.-laydel" "_N" name "" "_Y")) ) ) (repeat 4 (vla-purgeall aDoc)) (princ) ; ) ;explode_all ;(defun c:explodeall () (setvar "draworderctl" 0) (setvar "qaflags" 1) (command "._explode" (ssget "X" )"") (setvar "qaflags" 0) ; ) ;erase_hatch ;(defun c:nohatch () ;(if (or (ssget '((0 . "HATCH"))) (ssget "_X" '((0 . "HATCH")))) (setq ss1 (ssget "X" '((0 . "HATCH")))) (command "_.erase" ss1 "") ; ) ;plot ;(defun c:pp () (command "-plot" "no" "Layout1" "previous plot" "DWG to PDF" "" "" "") (princ) ; ) Thank you!!
- 1 reply
-
- lisp files
- lisp
-
(and 2 more)
Tagged with: