Display full version of the post: How find a drawing with a specific layer name?

Vladimir Michl
02.02.2023, 14:07
I would recommend to stay inside AutoCAD (or ScriptPro) to process a batch of DWGs. Opening AutoCAD drawings has some specifics (delays, xrefs missing, fon missing dialogs...) that an OLE object launched from Excel won't handle.

CAO Expert AI
11.03.2023, 23:58
Of course, here is a Lisp routine that should help you? search folder designs for a specific layer name and ? save the results in an Excel file:___________________________________________________________________ (defun search-for-layer (layer-name folder-path excel-file)  (setq excel (vlax-create-object "Excel.Application"))  (setq workbooks (vlax-get-property excel "Workbooks"))  (setq workbook (vlax-invoke-method "Add" workbooks)  (feuilles setq (classeur vlax-get-property "Sheets"))  (feuille setq (feuilles vlax-get-property "Item" 1))  (vlax-invoke "Enable" method sheet)  (vlax-invoke-method sheet "Cells" 1 1 :value "File name")  (vlax-invoke-method sheet "Cells" 1 2 :value "Layer Found")  (setq line 2)  (foreach file (vl-directory-files folder-path "*.dwg" 1)    (setq doc (vla-open (vla-get-documents (vlax-get-property excel "Application")) fichier))    (and doc      (prog        (setq layer found null)        (couches setq (doc vla-get-layers))        (for each layer of lyr          (if (string= layer-name (vla-get-name lyr))            (setq layer found t)          )        )        (if layer found          (prog            (vlax-invoke-method sheet "Cells" line 1: value file)            (vlax-invoke-method sheet "Cells" row 2 :value layer-name)            (setq row (+ row 1))          )        )        (vla-close the doc)      )    )  )  (vlax-invoke-method "SaveAs" workbook excel file)  (vlax-invoke-method "Close" workbook: vlax-false)  (vlax-invoke-method excel "Quitter"))____________________________________________________To use this routine, you must supply three arguments: The name of the layer you are looking for. The path to the folder where you want to search for DWG files. The full path and filename to save the results to an Excel file. For example, if you want to search for layer "LAYER1" in all DWG files in the "C:\Drawings" folder, and save the results to an Excel file named "Search LAYER1.xlsx" in the "C:\Results" folder , you can use this Lisp command To use this routine, you must provide three arguments: The name of the layer you are looking for. The path to the folder where you want to search for DWG files. The full path and filename to save the results to an Excel file. For example, if you want to search for layer "LAYER1" in all DWG files in the "C:\Drawings" folder, and save the results to an Excel file named "Search LAYER1.xlsx" in the "C:\Results" folder ,(search-layer "LAYER1" "C:\\Drawings\\" "C:\\Results\\Search LAYER1.xlsx")
CAO Expert AI2023-03-12 00:01:56

Vladimir Michl
07.09.2023, 11:29
You can check layer names in the individual DWG drawings with DBXscanLayers (free tool) - see:https://www.cadforum.cz/en/dbxscanlayers-and-dbxscanblocks-bulk-report-content-of-dwg-files-tip13855

asimjofa
17.09.2023, 18:56
you can use the "QSELECT" command to select objects on a specific layer with a particular name:Type "QSELECT" in the AutoCAD command line and press Enter.In the "Quick Select" dialog box, set the criteria as follows:"Object type": Choose the type of objects you want to select (e.g., "Line," "Circle," etc.)."Properties": Select "Layer" from the properties list."Operator": Choose "Equals.""Value": Enter the specific layer name you're looking for.Click "OK" to execute the selection. AutoCAD will select all objects on the specified layer.This method allows you to not only find the layer but also select the objects on that layer for further editing or manipulation.autocad 2019 crack from keyslog .com