Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access to AutoCAD

Status
Not open for further replies.

baamold

Technical User
Feb 24, 2005
9
US
We need to tie our ACAD titleblocks to Access. The information in them is straight forward, but variable depending on the system. Excel is not an option as we need to generate simple reports.

I have seen a few threads from TCARPENTER on this and it sounds as though, "He has been there and done that".

We checked a program out in the R14, pre-2000 days called Easy Access from a programmer in WA state, but there's no contact there. I have the ARX files, but these don't function with R2004 or 2005 even with the recommended MDAC update from MS.

Anybody?

Thank you!
 
Hi baamold,

Chances are this has more to do with the version of AutoCAD than it does the MDAC updates.

Do you know any VB/VBA? If so we could probably guide you through doing this.

Let me know...
Todd

 
Hello Todd,

I'm not a VB guy and lost most of my Access skills due to the lack of need and busy times. I plan to get back on the horse though, but need a solution in between and one that we would be willing to pay for. We were hoping on a simple ARX, VB, or ? function of sorts that will allow us to simply choose the titleblock attributes we want according to the fields we have set in our database and fill in the blanks for us. The data is variable from Title info to the Drawn By and so on.

Not sure of the copyrights on Easy Access considering there is no contact with the creator, but can an ARX file be broken down?

Thank you,
Barry
 
Hi Barry,

I don't think ARX's can be broken down, somebody out there probably has but I'm not aware of them. Besides, I've got tons of code doing what you want, just tell me exactly what you need it to do and I can probably just send some code that will fill the bill, or just tweak some I've got to do what you need.

Just let me know!
Todd
 
Hi Todd,

I will try to keep this simple.

We have the need, along with several customers, to catalog drawings (more or less) even if this means going back into each individual drawing and selecting attributes in the titleblock of each and getting it into Access.

Current attribute tags from a customer read as follows:

DWGNUM
CADFILENUM
TITLEONE
TITLETWO
TITLETHREE
DATE
FLOOR
PHASE

We need to be able to select these tags from existing dwgs. and dump them into a drawing database. From Access we will create reports from this information as needed.

To speed up the selection I may simply write a script for the selection set, but don't really see another alternative at this time. We, as well as our customers, have drawing databases in place for reference. If we can reference to them great, but the links will still have to made.

Why can't this be as simple as Excel linked tables? That's something we do all the time.

This help?

Thank you,
Barry
 
Hi Barry,

Here's conceptually how I do it. I maintain in my database two tables, one of known titleblocks and a second containing known attribute names. The two tables are linked via a primary/foreign key with a one to many relationship.

Then a user presses a button, and the routine queries the known title block table, building a recordset. Then the routine queries the drawing for blocks, building either a list or recordset, and then compares the known title block recordset against the drawing blocks searching for a match. If one is found, depending on what the routine was instructed to do, either populates the title block or populates the database. Using this method, the user just has to press one button, and then doesn't have to select each attribute, yes the database has to be set up but it's a one time deal. Also, you can write a script or use script pro to batch a set of drawings.

Now, to answer your questions:

If we can reference to them great, but the links will still have to made.

No problem. Just how and what do you want and or need linked?

Why can't this be as simple as Excel linked tables?

I'm not quite sure what you mean, in your first post you mentioned Excel was out of the question, or did you just mean as in a linked OLE object? If you meant the latter, the problem is placing them consistently, and setting the right drawing to the proper record in Access. Quite frankly, I've never even considered this so I'm not sure it's feesible.

Let me know if my methodology will work for you or not, plus I'll need your database structure (the one containing the title blocks and the one you are using for your document management system).

Todd
 
Hi Todd,

I am meeting with the customer next Wednesday, 3/2, and should have a better view of this at that time. Give me until then to run through this with them.

Thank you and we will be in touch,
Barry
 
Hello Todd,

Here it is. The message is pointed towards another programmer our customer is looking at. He wants the best bang for the buck using the KISS theory. He is not pitting programmer against programmer, but thinks the other guy is getting too proprietary and needs to re-focus to a simpler level.

You make it sound alot simpler and have some stuff that may run off the bat.

Read through this reply he sent and if you need documentation, DWG or MDB files, or better explantions, let me know.

Customer Reply:

Our database has three different tables for Electrical drawings, Process flowsheet drawings, and Mechanical drawings. These are the only tables that are to be linked to the drawings. The drawing number field which is in each of the different tables is the unique number for the records. We use this field to index off of, because it does not allow duplicates. There is no primary key in our database due to issues it has had with other applications that we use at our company.

I am looking for a manual operation to download our drawing title information (from our title block attributes) to our database located on the server. To accomplish this we are looking for an icon button that a drafter would push, sending the information to the database. We have three different AutoCAD menus for electrical, flowsheets and mechanical drawings. The icon button in each of the menus would be used to link this information to the proper tables in the database. (T-Electrical, T-Flowsheets, T-Mechanical). I am not looking to have information downloaded from the database to the drawing titleblock.

We are not looking for a fully automated system at this time. If we were to automate this operation at all, we would tie it into our lisp routine pldate. (saves the drawing and then updates the plot date). The goal is to update our drawing database for new drawings in a very timely manner. The risk of fully automating this operation is that we could end up with a very large amount of drawing information that we do not what to keep. (conceptual, proposal, testing, etc.) This could increase the amount of time maintaining the database system.

Our original plan is to get quotes for programming services to accomplish the manual task. I am not looking for a package that is proprietary, so that no one but the original programmer can change it. I see this as a tool that we or our supplies could use.

Todd,

There you have it. Read it and let me know what you think. We are interested in this outcome ourselves considering our system is somewhat parallel to theirs.

Thank you,
Barry
 
Hi Barry,

This is pretty easy. In fact, I've probably got about 90% of the code for this lying around. It would make it easier to do if you've got sample drawings, one of each preferably, (Electrical, Process flow sheets, and Mechanical drawings), and the database. This way I can just adapt the code I have to work with what you've already got instead of guessing. If the database has at least some information (again for each discipline) that would be extremely helpful, (I understand about proprietary information), so as long as the “format” is identical to what you would normally see, that should be fine as well.

Are you/they looking for a stand-alone app, or can this just reside in AutoCAD VBA? Either on e is okay with me, I just need to know how to interface.

If you can, send me this information I can probably help you out pretty quickly – send it to edgi3ATjunoDOTcom. Zip files are Ok but I do have a 3 meg limit.

HTH
Todd
 
Hi Todd,

I will send the examples. The same titleblock is used with all three disciplines, but tags from the T-Electrical DB work for all three. Note that any extra tags are manually manipulated or reserved for another program (e.g. Lotus Notes).

The fields in the DB should mimic the attributes in the drawing pretty much (see earlier post).

Imagine you are looking at the titleblock (I filled in dummy info. in the sample). You fill out the title information and when finished you press an icon which fires the attribute information to the DWG MASTER.mdb. It's as simple as that...for now.

Hopefully my previous post states most of the information needed.

Thank you,
Barry

P.S. Up to eight people may be using this routine and probably have the support files for this (VB function or ?) local to them.

The DB file resides on a fixed network share. The drawings will vary location. I imagine they will open a drawing and SAVEAS to its location, then press an icon that does the magic to the DB.
 
Todd,

Here is a reply to the 3/3/05 13:10 post from another group the customer is looking at. Do you see any relevance here or are they digging too deep?

Thank you,
Barry

P.S. Let's get this thing rolling!

baamold wrote:
Our database has three different tables for Electrical drawings, Process flowsheet drawings, and Mechanical drawings. These are the only tables that are to be linked to the drawings. The drawing number field which is in each of the different tables is the unique number for the records. We use this field to index off of, because it does not allow duplicates. There is no primary key in our database due to issues it has had with other applications that we use at our company.


Okay, lets start easy.

How can we tell from the titleblock information which table shall be the active table ?
Reason: A table needs to be made active before you can push or pull information from it.

None of the tables supplied have any indexed fields.
Reason: It is only possible to search an indexed field in a table using Easy Access

The titleblock (as supplied) will not work as a wblock. If you insert "Elec1test.dwg" into another drawing file it results in a "nested block" ~ you cannot edit nested blocks
Reason: You can edit them programatically but it requires much more coding and error checking than editing a standard block or wblock

The attribute Tags are different from the Table field Names
Reason: If we don't change one or the other, we shall need to write a mapping function to map the attribute values to the correct field names

Items 3 & 4 are not critical and can be dealt with programatically. We just thought Brian should be aware of these facts.
Items 1 & 2 are critical and must be resolved.


Let's answer these first then take it from there
 
Hello Todd,

I have to thank you again for all the help. This solution, once we have tested thoroughly, should do the trick. Preliminary tests have been very successful, but more data needs to be applied.

Thank you again!
Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top