-------------------------------------------------
Printable View
-------------------------------------------------
Are you needing work on this solution? If so, where is the current code you have posted fail? That is a lot to review to help you diagnose your code.
If you're already using VBA, why do you need it in lisp? VBA manages ObjectDBX just fine, as your sample shows.
So, if you're getting thousands of layer names, what else do you need?
You state the code you posted extracts layers from a folder of drawings and places the layer properties and drawing name to a CSV file.
This routine does use ObjectDBX to open drawings without displaying the graphics. Since the graphics are not being displayed, the routine should be fairly quick.
I believe you are wanting a similar routine that would prompt the user for a layer name and folder to search. You want the results to output to a shell-window, but I am not certain what that is, instead of a CSV.
You will need to modify your c:CheckLayers routine to prompt the user with the layer name. You would still want to prompt for the folder to search. After those two things are known, you would still use ObjectDBX to open all of the files (one at a time) found in the specified folder. From there, you would process the layers for each found file to see if the user specified layer is found. If the layer is found, add the drawing name to a list. After all drawings are processed, you can decide how to display the drawings that contain the specified layer. I would still recommend exporting to CSV, but that is not what you want.
It also appears the posted code is cobbled together with code posted by other people. Please leave a note of the original author and a link back to where those parts of the code can be found again. There may be updates due to bugs that may need to be incorporated in the future.
Also, if you are using Excel as the controlling code, I believe VBA is included in the installation of Excel. I could be wrong as I do not currently have access to the latest version of Excel to verify.