admin管理员组文章数量:1568433
2024年4月29日发(作者:)
Download demo project - 167 Kb
Introduction
What is DXF?
Drawing Interchange Format (DXF) files enable the interchange of drawings
between AutoCAD and other programs. DXF files can be either ASCII or binary
formats. Because ASCII DXF files are more common than the binary format, CadLib
uses ASCII DXF format.
What is CadLib?
The CadLib is not a Computer Aided Design (CAD) program. It is a tool for creating
DXF files that are used in the CAD programs. It consists of two parts. One of them
is a Dynamic Link Library to create the DXF file. The other part is the programming
interface. It is a class that integrates the functions. It can be used in
Microsoft Visual C++ projects. In addition, the can be used in other Win32
programs.
Why use CadLib?
In some programs, it is needed to create a drawing output for use in other programs
such as AutoCad. For example, in a "Building Detail Sheet Generator Program", the
program needs to create a drawing output. And the most standard format for
communicating drawing data is DXF.
DXF file structure
The DXF format is a tagged data representation of all the information contained in a
drawing file. Tagged data means that each data element in the file is preceded by an
integer number that is called a group code. A group code's value indicates what type
of data element follows. This value also indicates the meaning of a data element for
a given object (or record) type. Virtually all user-specified information in a drawing
file can be represented in DXF format. (from AutoCad's DXF reference)
A DXF file consists of some sections. Each section has some drawing data in itself.
The CadLib uses the following sections:
1. HEADER
2. TABLES
3. BLOCKS
4. ENTITIES
The main reference for DXF file structure that is used for CadLib is the AutoCad's
DXF reference. You can find more information about DXF file structure here.
Classes
The classes are interfaces between and the main program. "Test" has
come with CadLib to demonstrate how to generate a DXF file with
CDxfFileWrite
and
CDrawing
classes.
CDxfFileWrite class
CDxfFileWrite
gathers all the commands needed to directly create a DXF file.
Usage of
CDxfFileWrite
is as follows:
版权声明:本文标题:DXF文件格式读取(VC例子) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1714384941a401925.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论