Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My goal is to have a lisp that will create a variable of a directory. It will start with getting the current drawing directory and then remove the last subfolder and add a new subfolder. I’m getting “; error: too many arguments”
Anyone see where I’ve strayed?
(defun c:ModifyDirectory ()
(setq currentPath (getvar "DWGPREFIX")) ; Get the path of the current drawing
(setq pathList (vl-string->list currentPath "\\")) ; Convert path to a list of subfolders
(setq newPath (vl-list->string (reverse (cdr (reverse pathList))) "\\")) ; Remove the last subfolder
(setq newSubfolder "01_Basefiles") ; Define the new subfolder name
(setq modifiedPath (strcat newPath "\\" newSubfolder "\\")) ; Add the new subfolder
(princ (strcat "\nModified Path: " modifiedPath)) ; Print the modified path
(princ)
)
Solved! Go to Solution.