admin管理员组

文章数量:1531667

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:

本文标签: 读取例子