Message 1 of 11
Not applicable
06-18-2020
09:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Experts,
I got a lisp code that can convert SINGLE lisp file to fas file, which is located in same AutoCAD drawing folder path.
But the requirement is to convert MULTIPLE lisp files to fas files, which are existed in so many subfolders in the main folder.
The code should ask user to select the main folder path. Then the code should execute all subfolders and then choose only lisp files from all subfolders and then FAS files to be created in subfolder path respectively.
Please find the code below:
(defun c:LSP2FAS-Help (/)
(alert (strcat
"\tLisp (LSP) to Fast and Secure (FAS) Help"
"\n "
"\nFile dialog begins in the current directory. "
"\nIt is suggested to place and open a drawing (DWG) "
"\ninside the input folder you wish to batch process. "
"\n "
"\nOutput file will be in the same folder as the file selected. "
"\n "
"\nThere is no provisional check for an existing FAS file of the same name. "
))
);end LSP2FAS-Help
(defun c:LSP2FAS ( / a )
(vl-load-com)
(prompt " Lisp to Fast and Secure (FAS). LSP2FAS-Help available. ")
(if (wcmatch (strcase (setq a (getfiled "Convert LSP File to FAS" (getvar "DWGPREFIX") "" 16))) "*.LSP")
(progn
(c:vlide)(vlisp-compile 'st a)
(princ (strcat "\n File " (vl-string-subst ".fas" ".lsp" a) " created. "))
);progn
(alert "File extension must be \".LSP\" ")
);if
(princ)
);end LSP2FASThanks a lot in Advance.
Solved! Go to Solution.