Lee Mac Posted June 11, 2009 Posted June 11, 2009 (edited) This program will allow the user to extract all attributes from multiple blocks in multiple drawings, and will write all data to an Excel spreadsheet. The user is prompted to create a list of block names from which attributes will be extracted. The user is then prompted to select a directory of drawing files to process, and also provided with the option to process sub-directories of the selected directory. Results will then be written to an Excel Spreadsheet, to be saved as the user wishes. Among many other uses, this program may be used to create a Drawing List, by inputting the name of the titleblock, and the attributes that you want to extract from it, and setting the mode to 'Drawing List Mode' (within the 'Options' Dialog), so that the data is grouped in one list. (See the Header for more info). Your feedback, comments and suggestions are welcome Lee Preview: Attribute Extractor: Options Dialog: Attribute Editor: Function Syntax: MacAttEdit / MacAttExt / MacAtt Code available here. Edited November 10, 2010 by Lee Mac Quote
stevesfr Posted June 11, 2009 Posted June 11, 2009 LM... neat, neat, slick. It takes into account endless blocks, whereas I was interested in only ONE unique block on the one you wrote for me. Users should love this one. Dare I say "bottoms up" again? Steve Quote
Lee Mac Posted June 11, 2009 Author Posted June 11, 2009 LM... neat, neat, slick. It takes into account endless blocks, whereas I was interested in only ONE unique block on the one you wrote for me. Users should love this one. Dare I say "bottoms up" again?Steve Thanks Steve - I hope that it'll benefit many users Quote
Lee Mac Posted June 12, 2009 Author Posted June 12, 2009 The above code has been updated to include suggestions from users both here and at TheSwamp.org. My thanks go out to those users for taking the time to test and comment on my code. Thanks, Lee Quote
cabltv1 Posted July 20, 2009 Posted July 20, 2009 Lee, Nice as usual. I tried it on a drawing. It works well except for a couple of things (see bleow)... Quote
Lee Mac Posted July 20, 2009 Author Posted July 20, 2009 Hmm.. it shouldn't be putting the tags into columns at all, rather, each tag to a row.. Quote
cabltv1 Posted July 20, 2009 Posted July 20, 2009 Lee, I just double clicked on the file and it opened in Excel. Doing so automatically placed the info into Rows and Columns. I didn't think of opening it as a Text file. I will try that and get back to you. That may also be why the Coordinates were different than what appears in the block. They may have been converted somehow while opening in Excel. Quote
Lee Mac Posted July 20, 2009 Author Posted July 20, 2009 I'm not following you. The way you should be using this LISP is to open any new drawing and run the LISP by typing MacAtt. You can then add block names to a list. Once you have finished adding the block names for which the attributes will be extracted, hit enter and a dialog appears asking you to select a directory. Upon selecting a directory, the LISP will use ObjectDBX to iterate through every single drawing in that directory, and extract all the attributes in all the blocks in the list to Excel. The Excel file should be opened automatically and left open so that you can save/edit it as you wish. Lee Quote
cabltv1 Posted July 20, 2009 Posted July 20, 2009 Lee, I think I was the one confussed. I just tried it the way you suggested and it works great. Sorry for the confussion. Quote
wkplan Posted July 21, 2009 Posted July 21, 2009 Lee, this is a beautyfull programm. Playing with it, it seems that if a drawing is open in autocad, than it will not be processed in attributs extraction. This might be no error, because it can run from a blank dwg. Is it correct? Subdirectorys are not processed, ore ist there a hint? regards Wolfgang Quote
Lee Mac Posted July 21, 2009 Author Posted July 21, 2009 Thanks Wkplan No, sub-directories are not processed - but I don't think this is a major inconvenience to the program on the whole. I would recommend that you close the drawings that you want processed. - I have incorporated code to account for open drawings, but it won't work if those drawings are active. But glad you like it! Lee Quote
wkplan Posted July 22, 2009 Posted July 22, 2009 Lee, I don't think there are any inconveniences at all to youre program. :-) Just something to bear in mind, when runnig it. Thanks Wolfgang Quote
Lee Mac Posted January 19, 2010 Author Posted January 19, 2010 I have spent a bit of time updating this program, and have upgraded the code in the first post to make the program much more reliable, and also write the Attribute data to Excel in a more legible format. Sub-directories may now also be processed. Your comments, suggestions and feedback are welcome. Lee Quote
stevesfr Posted January 19, 2010 Posted January 19, 2010 I have spent a bit of time updating this program, and have upgraded the code in the first post to make the program much more reliable, and also write the Attribute data to Excel in a more legible format. Sub-directories may now also be processed. Your comments, suggestions and feedback are welcome. Lee Suggestion: presently if there is a block called Vehicle with tags of Item and Quantity, then the program reports the following (for an individual drawing): Vehicle Quantity Item 1 Car 1 Car 1 Truck 2 Truck Is it possible to report the sum of the tags as follows ? Vehicle Quantity Item 2 Car 3 Truck Just a thought to really reduce the number of lines in the spreadsheet and eliminate one step of totaling in the spreadsheet. The above oversimplified for illustrative purpose only. Quote
Lee Mac Posted January 19, 2010 Author Posted January 19, 2010 Thanks for the suggestion Steve, But I would like to keep the program as generic as possible, to benefit the most users. And, in your scenario, that would only apply if the user had two specific attributes of a quantity and item. And so, even if this was the case, the user would have to specify which attributes to apply the "formula" to etc, and the program would become very specific indeed. But thank you for your interest, Lee Quote
wkplan Posted January 19, 2010 Posted January 19, 2010 Hi all, i believe it is easyer do this in two steps: First, do the attribute-extraction with Lee's program Second, analyze the data with excel, and use the pivot-function to sort the data. regards Wolfgang Quote
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.