View Full Version : Use VBA to access a database to insert Blocks

2005-02-22, 05:14 PM
Is there a way to use vb to insert blocks. We use a lot of blocks with different manufactures and attributes. Too many to put in a toolbar. I wanted to know if its possible to create something in vb to access a database so that I can filter by Manufacturer and then insert into drawing? Can someone point me in the right direction on getting started. If this is even possible.

Ed Jobe
2005-02-22, 09:10 PM
Sure its possible. Check out www.cadregister.com. But have you considered using the Design Center? Just put each manufacturer's blocks in a single drawing to sort them.

Ben Jones
2005-02-23, 06:08 AM
This is not only possible but recommended. The VBA is the easy part. The database design is hands down the hardest part. If you are going to be doing this yourself, I recommend a few books - AutoCAD Databas Connectivity (http://www.amazon.com/exec/obidos/tg/detail/-/0766816400/qid=1109138503/sr=1-1/ref=sr_1_1/103-6091524-2583034?v=glance&s=books) by Scott McFarlane for the AutoCAD side and Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design, Second Edition (http://www.amazon.com/exec/obidos/tg/detail/-/0201752840/qid=1109138673/sr=1-1/ref=sr_1_1/103-6091524-2583034?v=glance&s=books) by Michael J. Hernandez for the guide to database design.

Otherwise, I would definitely recommend putting up the bucks to get someone to design the database for you depending on how big it gets. Good Luck!

If you don't mind, keep us updated on how this is going. I am doing something similar and would mind comparing projects.



2005-02-23, 04:46 PM
Cool. Thank you. I will look into those books. I will let you know how it goes. It will be a while but I will keep you posted. Thanks again!

Ed Jobe
2005-02-23, 05:25 PM
There are also some AU handouts in the Education channel, e.g. 2002, Data & Document Management>Database Developers Workshop (http://www.augi.com/education/auhandouts/DM42-1.pdf).

2005-02-27, 08:28 AM
Use an XML file if all you need to do is filter by manufacturer --- its faster and a lot less overhead than a db