(command "FILEDIA" 0) ;Set open dialog to be command line only
(setq DXFFilesArray (vl-directory-files writewithincurvedirectory "*.dxf")) ;Find all .dxf files in current folder.
(princ DXFFilesArray) ;display contents of current target directory
(princ "\n") ;newline for aesthetic purposes
(setq LoopIndex 0) ;initialize loop index
(repeat (length DXFFilesArray) ;repeat once for each .dxf file in DXFFilesArray
; (repeat (3) ;repeat once for each .dxf file in DXFFilesArray
(setq FileToOpenFullPath (strcat writewithincurvedirectory (nth LoopIndex DXFFilesArray))) ;get current folder to write file to and add the .dxf name to it
(princ (strcat "\nFile to open is: " FileToOpenFullPath "\n")) ;display filename
(setq LoopIndex (1+ LoopIndex))
(command "_.OPEN" "_Y" FileToOpenFullPath)
; (OpenDwgFile FileToOpenFullPath)
(C:ty) ;Trim Yellow
)
(setvar "filedia" 1) ;Restore open dialogue to have a visual interface