PDA

View Full Version : Automatic BOM Generation



slayer913
2004-08-25, 07:31 PM
Hello all -

Who can point me in the right direction on the following:

I'm looking to set up a system in which I can automatically create a BOM in Excel or Access based on unique block names in drawings (that I have already established).

Really what I'm looking for here are links to web resources that I can dig through to decide which is the best way to accomplish this. I'm sure LISP, macros, or even vanilla report creation could be used, or a combination of these methods, but I'd like to know what works best. Anyone already have this set up for themselves? Please give feedback.

Thank you,
Albert

Mike.Perry
2004-08-25, 09:30 PM
Hi

Give the following threads a browse -

dbconnect (http://forums.augi.com/showthread.php?t=4827&highlight=Excel)

tracking drawings (http://forums.augi.com/showthread.php?t=4907)

Connecting to an external database (http://forums.augi.com/showthread.php?t=5215&highlight=Excel)

+

Have you looked at the ATP courses starting September (ATP 046 Utilizing an Access Database with AutoCAD through VBA programming) -

Current ATP Courses (http://www.augi.com/education/schedule.asp?page=292)

Have a good one, Mike

slayer913
2004-08-25, 11:51 PM
Ok that all helps; thank you Mike.

My next question is this then (I may have overlooked this whilst reading away) =

Can Access or Excel support Bi-directional associativity without having to program anything? Simply, I am not yet well versed enough in LISP or VBA or Pyrotechnics to create any third party program to control the associations.

My goal: to have attributes in CAD that can be edited in CAD and updated in Access, and visa versa.

Any thoughts? Or am I asking too much?

Thanks so much,
Albert

Mike.Perry
2004-08-26, 07:10 AM
Can Access or Excel support Bi-directional associativity without having to program anything? Simply, I am not yet well versed enough in LISP or VBA or Pyrotechnics to create any third party program to control the associations.
Hi

Simple answer "No".

Might want to check out the following Submission # EX001302 by Karl Browning on the AUGI Exchange Page -

AUGI Exchange Search Page (http://www.augi.com/exchange/search.asp?page=415)

Have a good one, Mike

slayer913
2004-08-26, 07:06 PM
Thank you for the continual help -

So I've established that I will need to program some type of in-between program in VBA, with the data stored in an Access Database. Right now I'm learning how to build this database for all of my 3D blocks, also. Basically, looks like this is what I should have happen:

CAD Block will have the name: T-90-S-3-W

Export to comma seperated file with Attribute Extraction

I want Access to read this information and decode it into 5 or so fields, for example:
Type: Tube
Fitting: 90 Elbow
Style: Short
Size: 3"
Conn.: Weld

Am I thinking too hard on this?

I appreciate any input,
Albert

Mike.Perry
2004-08-26, 09:23 PM
Hi Albert

Tell the truth you are probably better offer asking and receiving this kind of information within the VBA (http://forums.augi.com/forumdisplay.php?f=92) Forum. The people that generally hang out there I'm sure will be able to help out a lot more on this particular subject (please note I'm not trying to do anyone a disservice here).

Would you like me to *move* this thread to the VBA (http://forums.augi.com/forumdisplay.php?f=92) Forum?

:beer: Mike

slayer913
2004-08-26, 10:04 PM
Mike -

That would be great. Use your powers!

Take care,
Albert

Mike.Perry
2004-08-26, 10:17 PM
Hi Albert

Done.

Please note this thread has be *moved* from the AutoCAD General (http://forums.augi.com/forumdisplay.php?f=120) Forum to this one.

Hopefully you will get the assistance and help you require here.

Thanks, Mike

Forum Moderator

richard.binning
2004-08-27, 02:02 PM
Thank you for the continual help -

So I've established that I will need to program some type of in-between program in VBA, with the data stored in an Access Database. Right now I'm learning how to build this database for all of my 3D blocks, also. Basically, looks like this is what I should have happen:

CAD Block will have the name: T-90-S-3-W

Export to comma seperated file with Attribute Extraction

I want Access to read this information and decode it into 5 or so fields, for example:
Type: Tube
Fitting: 90 Elbow
Style: Short
Size: 3"
Conn.: Weld

Am I thinking too hard on this?

I appreciate any input,
Albert
Hi Albert,

I would take advantage of AutoCAD's built in capabilities and try to take advantage of the dbconnect methods first. You will still be connecting your file to an Access database, but will allow dbconnect to manage the connection.

Take a gander at the following handout from a previous AU on this subject. Scott McFarlane taught this class and is probably the resident expert on all things database related. Here is some reading/homework material for you:

AutoCAD Database Connectivity by Scott McFarlane (http://www.amazon.com/exec/obidos/tg/detail/-/0766816400/104-5885715-5206341?v=glance)

P.S. Autodesk University is by far the best place to receive some of this type of training.

jwanstaett
2004-08-27, 04:33 PM
Take a lokk at the Facility sample that comes with AutoCad

jwanstaett
2004-08-31, 04:24 PM
Check out Autodesk Sample attExt.xls it a Excel file That get all the block with Attribute in then and load then in the the Excel file.

or try the attach Excel I make some changes to Autodesk Sample file
you can select the blocks you need and change make in the Excel file can be update in the Autocad file



Editing 10/26/20007
If you use this on rev other then 2000 you need to change the Refernces to the Autocad 2000 Type Library to your rev of auotcad

slayer913
2004-09-01, 07:23 PM
Thanks for your input. I've opened up the Excel file, but I'm a little lost on what to attach where next. Is there a readme or some other documentation on the process you've described?

Thank you,
Albert

jwanstaett
2004-09-02, 01:14 PM
Thanks for your input. I've opened up the Excel file, but I'm a little lost on what to attach where next. Is there a readme or some other documentation on the process you've described?

Thank you,
Albert
If you load autocad Sample when you load there a readme.txt file in yourAutocadPath\Sample\ActiveX\ExtAttr\readme.txt

my program work in the same way but ask you for a block name and as a macro UpdateAttr to up data the attributes


Texts from the readme file

ExtrAttributes
----------------
In this sample, AutoCAD block attribute information is extracted from block references and put into
an excel spreadsheet.
Open the Attrib.dwg drawing in AutoCAD, then start excel file by double clicking it.

Note that this sample expects the drawing for which you want to extract attributes to be currently open.

From the Excel Tools menu, pick Macro -> Macros.

In the Macro list, select Extract, then AutoCAD will be accessed, the spread sheet with fill with attribute data.

When done, close the Excel spreadsheet first.


This sample may not run on a minimally configured computer due to the overhead required when running both AutoCAD
and MS Execl at the same time.

slayer913
2004-09-22, 10:28 PM
Here's another fun one>>

So far, I've figured out how to assemble a bunch of blocks together, link them to a database in the drawing via dbconnect, and then query for an inventory. Piece of cake (only took 3 weeks). The next part is a bit of a challenege, so any help would be great:

How do I maintain links to blocks for all drawings to come? Can I simply link a block to the database in it's wblock file, then expect the link to remain as I insert the block into other drawings?

Or do I need to turn my system around and do this: hyperlink the database entries to the drawing files and insert them from the database, not from CAD?

End Result (hopefully): To pull blocks into a drawing with information associated with a master database. Then, we'd like to query / list the used blocks into a seperate table / sheet / group so that we can edit individual fields for project-specific needs.

Thank you much,
Albert

Mike.Perry
2004-09-22, 10:37 PM
Hi Albert

I honestly think you might be better offer carrying on with your original thread and adding/ building on that -

Automatic BOM Generation (http://forums.augi.com/showthread.php?t=7456)

If you agree, I will happily merge the two threads together.

Thanks, Mike

Forum Moderator

slayer913
2004-09-22, 10:42 PM
Forgot about that one - please do.

Thank you

Mike.Perry
2004-09-22, 10:45 PM
Hi Albert

Done, two threads merged into one.

:beer: Mike

clint.sowers
2004-09-28, 01:56 PM
I have cute little program I am working on that may be of some help to you. Right now I can insert blocks w/ attributes into a drawing (manually) then run the program which opens Excel then extracts all the attributes and drops them neatly into cells. It then Copies the cells to be placed back into ACAD, but this is where I am having trouble. I need to paste (what's on the excel clipboard) into ACAD as a %PRODUCT Entity which is under EDIT--> Paste Special. Let me know if there is anything I can do.

asvsatheesh.90572
2005-08-04, 06:04 AM
You can use Tool Menu->Attribute Extraction..
or command "eattext" if You use AutoCAD 2005 or higher

For this, NO VBA Knowledge is needed.
But this is not Bi-directional.

Thanks,
Satheesh