Jump to content

Global Attribute Editor & Extractor


Lee Mac

Recommended Posts

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:

 

MacAtt%20V2.6.png MacAttTagOrder.png

 

Options Dialog:

 

OptionsV2-8.png

 

 

Attribute Editor:

 

Prev.png

 

Function Syntax: MacAttEdit / MacAttExt / MacAtt

Code available here.

Edited by Lee Mac
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

I'm not following you. :huh:

 

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

Link to comment
Share on other sites

Lee,

 

I think I was the one confussed.

I just tried it the way you suggested and it works great.

 

Sorry for the confussion.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...