MS Access data export to AutoCAD template
MS Access data export to AutoCAD template
(OP)
Dear Tek-tips,
Welcome to my first ever post. I have dabbled in VB with Access and Excel for a while, but never within AutoCAD and I am having a problem with object handling between the two.
I have read the FAQ (www.tek-tips.com/faqs.cfm?fid=5800) but I am trying to do this in reverse and I can't even get the FAQ to work, possibly due to version incompatabilities.
In MS Access 2002 I have 2000+ records that I have to export relevant data into a new AutoCAD 2002 drawing based on various templates that I've created (e.g. template1.dwt).
I have various database fields specifying drawing name, template to use etc, and drawing specific data such as cable numbers, equipment numbers etc.
Essentially, I would like a VB module in Access that would create a new drawing based on whatever template is specified in that record, and then recursively find and replace any matching occurrances of MText (e.g. $$jb_no$$ to "JB-26-801"). I would keep the variable name the same as the Field name but for simplicity I would avoid Attributes if possible to minimise the number of templates required and risk losing data if block is exploded.
In summary, processing a single record would be nice if/when the database record changes, but what I really need it to do is a full sweep of all records and in turn create a new drawing, replace all the text, save it, and move onto the next drawing until database EOF.
Can anybody help??
Welcome to my first ever post. I have dabbled in VB with Access and Excel for a while, but never within AutoCAD and I am having a problem with object handling between the two.
I have read the FAQ (www.tek-tips.com/faqs.cfm?fid=5800) but I am trying to do this in reverse and I can't even get the FAQ to work, possibly due to version incompatabilities.
In MS Access 2002 I have 2000+ records that I have to export relevant data into a new AutoCAD 2002 drawing based on various templates that I've created (e.g. template1.dwt).
I have various database fields specifying drawing name, template to use etc, and drawing specific data such as cable numbers, equipment numbers etc.
Essentially, I would like a VB module in Access that would create a new drawing based on whatever template is specified in that record, and then recursively find and replace any matching occurrances of MText (e.g. $$jb_no$$ to "JB-26-801"). I would keep the variable name the same as the Field name but for simplicity I would avoid Attributes if possible to minimise the number of templates required and risk losing data if block is exploded.
In summary, processing a single record would be nice if/when the database record changes, but what I really need it to do is a full sweep of all records and in turn create a new drawing, replace all the text, save it, and move onto the next drawing until database EOF.
Can anybody help??
RE: MS Access data export to AutoCAD template
This shouldn't be too difficult to accomplish, in a nutshell, you'll want to query the database to build the job list, then start walking the records (job list) to do what you need. You mentioned you were having trouble but you didn't mention what exactly. Post back and let us know and we can help you out.
Todd
RE: MS Access data export to AutoCAD template
Maybe this is not the right way to reply on post.
Will googling for a sollution to connect acad to access this forum was first hit.
I have studied the following thread.
How to connect AutoCAD to Access
FAQ687-5800: How to connect AutoCAD to Access
Is the any otherway to contact you and ask for you help with this
Kind Regards Martijn Fokker
RE: MS Access data export to AutoCAD template
This is probably the easiest but if you really need it, you can try tdcarpenter at wowway dot com.
Todd