xperia Posted November 14 Share Posted November 14 What I want to do is to extract all the attributes of a "Cable" block that contains a cable number as an attribute. By extracting, I would be able to get a drawing cable list. I have tried "Global Attribute Extractor & Editor" from Lee Mac, but unfortunately, it's not working. The LISP "Batch Attribute Editor" seems to extract the attributes, but only one at a time. I have been able to do it via ATTEXT command and then copy .txt to Excel but is there any LISP that can do it automatically to Excel? Quote Link to comment Share on other sites More sharing options...
pkenewell Posted November 14 Share Posted November 14 Have you tried using the Express Tools "ATTOUT" command? It exports to a tab delimited text file, but could easily be imported into Excel using the "From TXT/CSV" button on the "Data" tab. Quote Link to comment Share on other sites More sharing options...
pkenewell Posted November 14 Share Posted November 14 @xperia BTW You can also use the "DATAEXTRACTION" command. The Wizard will walk you through getting the blocks and attributes you want, and can export to an excel or csv. Quote Link to comment Share on other sites More sharing options...
xperia Posted November 14 Author Share Posted November 14 As far as I know, this is not available in LT version.. I can check later if they made it available in 2024. Quote Link to comment Share on other sites More sharing options...
pkenewell Posted November 14 Share Posted November 14 Sorry - yes you are correct - DATAEXTRACTION command is not available in LT, and neither is ATTOUT. not sure if possible with the reduced AutoLISP in LT. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 14 Share Posted November 14 4 hours ago, xperia said: What I want to do is to extract all the attributes of a "Cable" block that contains a cable number as an attribute. By extracting, I would be able to get a drawing cable list. I have tried "Global Attribute Extractor & Editor" from Lee Mac, but unfortunately, it's not working. The LISP "Batch Attribute Editor" seems to extract the attributes, but only one at a time. I have been able to do it via ATTEXT command and then copy .txt to Excel but is there any LISP that can do it automatically to Excel? Unfortunately many of my programs will not be compatible with AutoCAD LT, as the LISP API in LT does not support interfacing with ActiveX objects outside of the AutoCAD Object Model. Quote Link to comment Share on other sites More sharing options...
xperia Posted November 14 Author Share Posted November 14 Well that is really unfortunate. You have some really amazing LISPs on your website! I was so happy when they introduced LISPs but obviously I will not be able to use half of the scripts I find... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 15 Share Posted November 15 (edited) Big problem with write direct to Excel my preferred way, is that open an "Application" is not supported in LT 2024, but write to a csv is. Which you can open in Excel. This is some test code should see all the attribute text in 1 block. (defun c:test ( / ) (setq obj (vlax-ename->vla-object (car (entsel "Pick block obj")))) (setq atts (vlax-invoke obj 'Getattributes)) (foreach att atts (setq txt (vlax-get att 'Textstring)) (princ (strcat "\n" txt)) ) (princ) ) (c:test) Let us know if it works in your 2024 LT. The more we know about what works the better for LT lisp. Edited November 15 by BIGAL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.