Monday, February 15, 2010

How to sync block attribute values with a database using ACAD_db

This tutorial will guide you through the steps on how to use ACAD_db to synchronize AutoCAD attribute values in a title block with a database. Use this tutorial together with the ACAD_db documentation. Download ACAD_db_example.zip to follow along and test for yourself.

Contact us to get a time limited license of ACAD_db for free.

List the title block to find the following information that needed.

Block Name: "ISO A1 title block"
Attribute tags:
CHECKED_BY
OWNER
DESIGNED_BY
FILENAME
DRAWING_NUMBER
APPROVED_BY_DATE
TITLE
DATE
EDITION
SHEET
SCALE

Copy the Access database template ACAD_db_EmptyTemplate.mdb that is included with ACAD_db and name it ACAD_db_Sheets.mdb. Because read and write access is needed for the MDB file it can be a good idea to not save it in the Program Files folder structure as it is often restricted to read-only.

Copy ACAD_db_samples.UDL and name it ACAD_db_Sheets.UDL and place it in AutoCAD’s Data Sources Location (Options>Files). Double click on the file and edit the path to the location of ACAD_db_Sheets.mdb.

Open ACAD_db_Sheets.mdb and then table JTBW_AttSync.

Add the information about the title block. The attribute DRAWING_NUMBER contains a field so SyncDir is set to DWGtoDB while other fields can be synchronized both ways.

 
In the column DBConnection there is the name of the data source followed by the table name followed by the field name separated with an exclamation character.

Here is what the table TitleBlock look like in the included in  ACAD_db_example.zip. Notice the mandatory fields DBID, DWG, Handle and BlockName.

In AutoCAD make sure JTB.ACADdbMgd.dll is loaded using one of the options specified in the documentation.

Run the AcDbSettings command and specify the name of the data source to be used. This should match the name of the UDL file that should be located in the Data Sources Location found running OPTIONS.

For each drawing that should be synchronized with the database run the command AcDbMake to make the connection. This needs only to be done once per drawing.

Make changes to the title block.

Save and Close the drawing. Open the database and verify that the table TitleBlock is populated with the attribute values.

Make a change in the database on one or many values.

The changes are seen when the drawing is opened.

Any type of block with attribute can be synchronized with ACAD_db in this same manner. There can be for example one title block on multiple layouts in one drawing or it can be blocks that represent building elements or schematic symbols. The choice is yours.

Contact us to get a time limited license file for free.

No comments:

Post a Comment

Subscribe to the comments feed

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Subscribe to this blog
JTB World's website | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.