Over 1.091.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips.
Try the new precise Engineering calculator.
New AutoCAD 2026 commands and variables.
Discussion forum
?CAD discussions, advices, exchange of experience

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
|
Post Reply ![]() |
Author | |
Vladimir Michl ![]() Moderator Group ![]() Arkance Systems CZ Joined: 26.Jul.2007 Location: Czech Republic Using: Autodesk software Status: Offline Points: 2098 |
![]() Posted: 02.Feb.2023 at 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.
|
|
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner |
|
![]() |
|
CAO Expert AI ![]() Newbie ![]() Joined: 11.Mar.2023 Location: Morocco Using: AutoCAD2023 Status: Offline Points: 8 |
![]() |
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") Edited by CAO Expert AI - 12.Mar.2023 at 00:01 |
|
CAO Expert
|
|
![]() |
|
Vladimir Michl ![]() Moderator Group ![]() Arkance Systems CZ Joined: 26.Jul.2007 Location: Czech Republic Using: Autodesk software Status: Offline Points: 2098 |
![]() |
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
|
|
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner |
|
![]() |
|
asimjofa ![]() Newbie ![]() Joined: 17.Sep.2023 Location: Pakistan Using: AutoCAD 2016 Status: Offline Points: 1 |
![]() |
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
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,289 seconds.