Code Red > AutoLISP (Vanilla / Visual)

How find a AutoCAD drawing with a specific layer name?

(1/5) > >>

CAD_guru:
 :idea:Looking for a solution.
Aa lisp routine to search various folders drawings (.dwg files) to a specific layer name.  The result in an excel list of the found dwg files where the specific layer is located.  For example select folder and even subdirs. Look for given layer name: .... Seach and result, only the drawings that contains layer name .....    I have a lisp routine that will scan in a folder of drawings for all layer names. I want to specify it. It must be in a atnother solution. To specify to search various folders drawings (.dwg files) for a specific layer name. The result in an excel list of the found dwg files where the specific layer is located.  You can read the current code in the topic. And that code works. I would like an extension to the existing module with function as described in the topic.

JohnK:
Why wouldn't you just use Windows search feature in Windows Explorer (It doesn't give you results in Excel but why do the results have to be in Excel)?

JohnK:
What do you mean it's not possible in Windows Explorer?

1. Open File Explorer.
2. Go to File --> Change Folder and search options
3. From the Search tab choose: Always search file and contents...

mhupp:
Ran into this a while back

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-layer-names-out-of-dwgs-batch-fastest/m-p/7787430/highlight/true#M365195

JohnK:

--- Quote from: CAD_guru on January 31, 2023, 09:57:20 AM ---Since when can Windows read in AutoCAD files for a specific layer name?
Tested your suggestion, but it's not working.

With lisp you can use getstring to specify a layer name, acet-ui-pickdir to select a folder, ObjectDBX/vla-get-layer to go inside a drawing database and then write the search results to a csv file.

--- End quote ---

I started using a computer in Windows XP days but I had one employer that used Windows NT and you could search drawings for Layer names and DText entries even in windows NT but I don't think you can search for dtext strings anymore (Autodesk updated the file format many times since then). -i.e. The fact that windows search will find the items in those files was not because of what Microsoft did; it was because of what Autodesk's dwg file format allowed (kept DTEXT strings as plain text instead of binary in the file format). I know you can search for layer names still because I just tried it (several times).

I know how I would go about solving the problem in programming terms/methods but I'm trying to ask why when/if there is already a (possible) solution for you.

Navigation

[0] Message Index

[#] Next page

Go to full version