• 大小: 126KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: 其他
  • 标签: CAD  dxf  cadlib  dxflib  

资源简介

国外下载的CADLib字码的问题已解决,生成工程,vs2010,添加了视窗中心点,添加点的生成,两个例子,一个是自带的,另一个是自己写的,解决方案里面包含两个项目,建议用第一个项目,第二个项目没有实现Text,如有什么问题可以交流cntigercn@qq.com,我也是在做一个工程时用到的,对CAD不是太了解

资源截图

代码片段和文件信息

#include “DxfFileWriter.h“
#include “DXFFile/Write/DXFWrite.h“

DxfFileWriter::DxfFileWriter(void)
{
}


DxfFileWriter::~DxfFileWriter(void)
{
}

BOOL DxfFileWriter::Create( char* filename bool overwrite/* =false */ )
{
if( (m_hDxf=dxfCreateFile( filename ))==NULL )
{
// Cannot create new dxf file
return FALSE;
}

isFileOpen = true;

return TRUE;
}


BOOL DxfFileWriter::Close()
{
if(dxfCloseFile( m_hDxf ))
{
isFileOpen = false;
return TRUE;
}
else
return FALSE;
}

BOOL DxfFileWriter::SetCurrentColor( int Color )
{
return dxfSetCurrentColor( m_hDxf Color );
}

BOOL DxfFileWriter::BeginSection( DWORD dwSection )
{
return dxfSectionBegin( m_hDxf dwSection );
}

BOOL DxfFileWriter::EndSection()
{
return dxfSectionEnd( m_hDxf );
}

// TABLES section --------------------------------------------------
BOOL DxfFileWriter::BeginTableType( DWORD dwTableType )
{
return dxfTableTypeBegin( m_hDxf dwTableType );
}

BOOL DxfFileWriter::EndTableType( )
{
return dxfTableTypeEnd( m_hDxf );
}

BOOL DxfFileWriter::Addlayer( char* Name int Color char* Linetype )
{
return dxfAddlayer( m_hDxf Name Color Linetype );
}

BOOL DxfFileWriter::SetCurrentlayer( char* Name char* LineType )
{
return dxfSetCurrentlayer( m_hDxf Name LineType );
}

BOOL DxfFileWriter::AddLinetype( PDXFLTYPE pLineType )
{
return dxfAddLinetype( m_hDxf pLineType );
}

BOOL DxfFileWriter::SetCurrentLinetype( char* Name )
{
return dxfSetCurrentLinetype( m_hDxf Name );
}

BOOL DxfFileWriter::AddTextstyle( PDXFstyle pTextstyle )
{
return dxfAddTextstyle( m_hDxf pTextstyle );
}

BOOL DxfFileWriter::SetCurrentTextstyle( char* Name )
{
return dxfSetCurrentTextstyle( m_hDxf Name );
}

BOOL DxfFileWriter::AddDimstyle( PDXFDIMstyle pDimstyle )
{
return dxfAddDimstyle( m_hDxf pDimstyle );
}

BOOL DxfFileWriter::SetCurrentDimstyle( LPCTSTR Name )
{
return dxfSetCurrentDimstyle( m_hDxf Name );
}

BOOL DxfFileWriter::SetViewportCenter(double x double y)
{
BOOL result = TRUE;

result &= WriteParameter(5 “8“);
result &= WriteParameter(100 “AcDbSymbolTable“);
result &= WriteParameter(70 1);
result &= WriteParameter(0 “VPORT“);
result &= WriteParameter(5 “30“);
result &= WriteParameter(100 “AcDbSymbolTableRecord“);
result &= WriteParameter(100 “AcDbViewportTableRecord“);
result &= WriteParameter(2 “*Active“);
result &= WriteParameter(70 0);
result &= WriteParameter( 10 0.0);
result &= WriteParameter( 20 0.0);
result &= WriteParameter( 11 1.0);
result &= WriteParameter( 21 1.0);
result &= WriteParameter(12 x);
result &= WriteParameter(22 y);
result &= WriteParameter( 13 0.0);
result &= WriteParameter( 23 0.0);
result &= WriteParameter( 14 10.0);
result &= WriteParameter( 24 10.0);
result &= WriteParameter( 15 10.0);
result &= WriteParameter( 25 10.0);
result &= WriteParameter( 16 0.0);
result &= 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7764  2010-10-13 19:03  FileConvertor\DXFLIB\DXFDef.h

     文件      13858  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\base\DXFbase.cpp

     文件       3978  2010-10-13 20:21  FileConvertor\DXFLIB\DXFFile\base\DXFbase.h

     文件       2003  2003-10-26 05:05  FileConvertor\DXFLIB\DXFFile\base\SimpleList.h

     文件       6090  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\Read\DRBlocks.cpp

     文件       1630  2004-08-24 10:24  FileConvertor\DXFLIB\DXFFile\Read\DRBlocks.h

     文件      30046  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\Read\DREntities.cpp

     文件       1694  2004-08-24 10:24  FileConvertor\DXFLIB\DXFFile\Read\DREntities.h

     文件      14306  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\Read\DRTables.cpp

     文件       1646  2004-08-24 10:24  FileConvertor\DXFLIB\DXFFile\Read\DRTables.h

     文件       4969  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\Read\DXFRead.cpp

     文件       1606  2004-08-24 10:24  FileConvertor\DXFLIB\DXFFile\Read\DXFRead.h

     文件       4254  2010-10-13 19:04  FileConvertor\DXFLIB\DXFFile\Write\DWBlocks.cpp

     文件       1596  2010-10-13 18:54  FileConvertor\DXFLIB\DXFFile\Write\DWBlocks.h

     文件      32770  2010-10-13 19:04  FileConvertor\DXFLIB\DXFFile\Write\DWEntities.cpp

     文件       4711  2010-10-13 18:52  FileConvertor\DXFLIB\DXFFile\Write\DWEntities.h

     文件      19213  2010-10-13 20:54  FileConvertor\DXFLIB\DXFFile\Write\DWTables.cpp

     文件       2860  2010-10-13 20:46  FileConvertor\DXFLIB\DXFFile\Write\DWTables.h

     文件       9041  2010-10-13 18:59  FileConvertor\DXFLIB\DXFFile\Write\DXFWrite.cpp

     文件       1950  2010-10-13 19:35  FileConvertor\DXFLIB\DXFFile\Write\DXFWrite.h

     文件       6920  2010-10-13 21:54  FileConvertor\DXFLIB\DxfFileWriter.cpp

     文件       2189  2010-10-13 21:54  FileConvertor\DXFLIB\DxfFileWriter.h

     文件       4464  2010-10-13 21:33  FileConvertor\DXFLIB\DXFLIB.vcxproj

     文件       2590  2010-10-13 21:33  FileConvertor\DXFLIB\DXFLIB.vcxproj.filters

     文件        143  2010-10-13 18:55  FileConvertor\DXFLIB\DXFLIB.vcxproj.user

     文件        386  2010-10-13 21:36  FileConvertor\DXFLIB\Envelope.cpp

     文件        182  2010-10-13 21:36  FileConvertor\DXFLIB\Envelope.h

     文件      11166  2010-10-13 19:18  FileConvertor\DXFLIB\Interface\VC\CadLib.h

     文件       9574  2010-10-13 19:18  FileConvertor\DXFLIB\Interface\VC\DrawingDef.h

     文件       9603  2010-10-13 22:40  FileConvertor\DXFLIB\Main.cpp

............此处省略38个文件信息

评论

共有 条评论