Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Visual Basic 6.0 and AutoCAD 2

Status
Not open for further replies.

gilberttt

Computer
Oct 16, 2001
2
I am currently working on a project where we are updating an old program that generates terrible drawings as a dxf file. I want to rewrite this process so it will generate a dxf & dwg file using variables supplied by a Database via VB. People outside the company use the dxf and inside we use dwg. I need help on where to really start and prove this is the way to go. Thanks in advance!
 
Replies continue below

Recommended for you

I assume that you want to create new drawings based on values in the database. This is real easy to do using VB for AutoCAD. Using VB, you can read the database, process necessary calculations, open AutoCAD, create completely detailed drawings, save and move on. One of my AutoCAD programs creates up to 24 detailed drawings, complete with balloons and BOMs. I am sure that you can save the drawings as dxf through automation as well. Since your question is rather generic in nature, I am not real sure what information you are looking for at this point in your investigation.

If you are using VB, or VBA in AutoCAD for that matter, you can browse the AutoCAD object library to see the objects, methods and properties available in the API. The AutoCAD help also contains some good examples. There is also a comprehensive book that I have found useful entitled AutoCAD 2000 VBA Programmers Reference by Joe Sutphin.

If you have any specific programming questions or need some sample code to get you started, please post the questions in the AutoCAD forum. I think that other members would get more use out of it there.

Hope this helps! DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
Thank you for your reply. This is partially what I need to know. I will be using VB mostly, maybe some VBA for users after the fact. Can you create the drawings without opening AutoCAD? What I mean is that with a DXF you can just write to a file and read it in later. Is this possible with a dwg? Thanks again.
 
I have never tried to create a dxf from a flat file. I assume it is possible if you know the dxf format. I would imagine that creating a dwg file this way would be significantly harder. While I am somewhat familiar with the contents of a dxf file, all of my programs create drawings in the AutoCAD application itself. DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
I've done a couple of projects in VB creating DXF files from user input (2D only). It's not hard if you've got the published DXF file format specification (which is usually in the AuotCAD help files). To make a DWG I just pass the finished DXF through "Dconvert" which is on the OpenDWG Alliance web site ( ).
 
I use a cad program at work (CADDIE 8, a South African product), and the program can export drawings as an Ascii file. I am learning to program, and would like to know if it is generally possible to manipulate such files as a data base, and then export them back to the CAD program. And if so, what are the pitfalls of such a process. Thanking you in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor