为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

DXF文件格式读取(VC例子)

2017-09-30 15页 doc 60KB 45阅读

用户头像

is_589748

暂无简介

举报
DXF文件格式读取(VC例子)DXF文件格式读取(VC例子) , 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...
DXF文件格式读取(VC例子)
DXF文件格式读取(VC例子) , 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 cadio.dll functions. It can be used in Microsoft Visual C++ projects. In addition, the cadio.dll 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 CadIO.dll 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: 1. Create the DXF file Collapse | Copy Code CDxfFileWrite dxffile; dxffile.Create( "d:\\test.dxf" ); 2. Begin and end the HEADER section. It's here for compatibility with some CAD programs. Others work without having HEADER section. Collapse | Copy Code // Header Section ------------------------------------------ dxffile.BeginSection(SEC_HEADER); dxffile.EndSection(); // close HEADER section ------------------------------------ 3. Begin the TABLES section and put the LAYER, LTYPE, STYLE, DIMSTYLE table-types as many as you want and then close the section Collapse | Copy Code // Tables Section ------------------------------------------ dxffile.BeginSection(SEC_TABLES); // LTYPE table type ------------------------- dxffile.BeginTableType(TAB_LTYPE); DXFLTYPE ltype; double elem[4]; // Continuous ZeroMemory(
/
本文档为【DXF文件格式读取(VC例子)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索