-
May 14th, 2004, 02:33 AM
#1
AutoCAD dwg file format and read and use HOW TO?
Hi
Well as in subject can anybody tell me or help me in How to read the DWG file prepared in AutoCAD and use into MFC project?
Tasks are:
1.0 Know the format fo DWG file
2.0 Based on this read the input DWG file
3.0 Plot the circles and map to the scale in the MFC application
Any help/suggestions/guidelines
Sandeep
-
May 14th, 2004, 02:59 AM
#2
Hi,
I took a tool from
http://www.vdraw.com
it works fine an you have a whole CAD application included.
-
May 14th, 2004, 09:20 AM
#3
I suggest you to use DXF files rather that DWG. It is quite easy to convert DWG files to DXF files in AutoCAD. These are ASCII coded files and reading and writing outside the AutoCAD is easy.
Take it easy.
-
May 14th, 2004, 09:43 AM
#4
In addition the DXF file format is a part of the documentation that provides AutoCad. (At least in the 2002 version)
-
May 14th, 2004, 10:56 AM
#5
The DWG file format...
...is proprietary to Autodesk, and they are not talking. DXF's are definitely easier. If DWG's are a requirement for you, you'll probably want to spend some bucks on a third-party library. I've seen several graphics packages that support them, plus there is OpenDWG.org, which is a consortium of just about every cad vendor BUT Autodesk, who make it their job to reverse engineer the DWG format. It costs $$ to join and have access to their code libraries, but it is high-quality stuff.
-
May 15th, 2004, 03:11 AM
#6
Thanks
Hi
thanks for your prompt replies
Well it is not necessary that only DWG to read from. I hope we can get the DWG file converted to DXF in AutoCAD then i can work on DXF too.
Well now can you help me in how to work on reading teh contents of teh DXF files and to draw it in MFC view
-
May 16th, 2004, 05:47 PM
#7
I'd start at the Autodesk website
They have, among other things, a set of help files on the DXF format.
-
May 16th, 2004, 08:25 PM
#8
Use openDwg toolkit. They have reverse engineered the dwg file format and provide tools to read and write dwg files. I have used it and it worked great. Kind of difficult at first but....
http://www.opendwg.org/
Good luck!
Mike B
-
May 16th, 2004, 10:06 PM
#9
I agree, the OpenDWG library was a pain
But it did the job. Their new C++ version, DWGDirect, is much easier to use.
-
May 17th, 2004, 01:27 AM
#10
How to read and write DXF
Simply draw a line, a circle, a rectangle on a new ACAD page. Then, open "File" menu and "Save As" option. Through the alternatives choose "ACAD R12/LT2 DXF (*.DXF)" (This is the simplest form of DXFs). Give a file name and have your DXF extended file. Now, you can open the file with WordPad or NotePad since it is ASCII coded. Find ENTITIES section and see the definitions of the entities that you have drawn. Try to understand the entity definitions and DXF writing. While writing a DXF file, ENTITIES section is enough. So, you have not to deciphere other sections.
Take it easy.
-
May 17th, 2004, 07:14 AM
#11
Re: I agree, the OpenDWG library was a pain
Originally posted by JackW
But it did the job. Their new C++ version, DWGDirect, is much easier to use.
Yeah, well hopefully I will see that for myself. I just sent them a signed contract so I can download it!. Did you sign the contract? How long before you were able to download the libraries?
Mike B
-
May 17th, 2004, 10:26 AM
#12
I could not tell you...
We've been using OpenDWG for years, so we had no wait for the new libraries, and I don't recall how long it took to get access when we originally signed up. I shouldn't think it would be more than a day or so.
-
June 16th, 2015, 02:07 AM
#13
Re: AutoCAD dwg file format and read and use HOW TO?
[QUOTE=d0153030;947424]Hi
i have the same problem:
1.0 Know the format fo DWG file
2.0 Based on this read the input DWG file
3.0 Plot the circles and map to the scale in the MFC application
if you can solve problem could you please help me?
Any help/suggestions/guidelines
Roushanak
-
July 8th, 2015, 04:41 AM
#14
Re: AutoCAD dwg file format and read and use HOW TO?
For the first part, which is knowing DWG format (and its version), you can read the first few bytes of the file and search for the DWG version marker. For example, DWG 2004 files will have the string "AC1018" in the file's header.
For a list of versions and their signature strings, see the Version history section in the following Wikipedia article:
https://en.wikipedia.org/wiki/.dwg
About the other parts, which are reading the DWG, parsing it and displaying circles in MFC application, this is not easy to do on your own because the DWG format is so complex. You will be better off using a library like OpenDWG mentioned above or LEADTools.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|