十万火急!100分求救:如果用VC程序实现dwg和dxf文件之间的相互转换

上岸の鱼 2010-09-14 12:23:33
如题。
因需要在后台根据用户选择的下载格式,实现dwg和dxf文件格式之间的转换。
所以,我想写一个简单的Dlg程序,包含两个按钮,一个是DWG TO DXF;一个是DXF TO DWG。

我知道AutoCAD软件上另存为功能包含了这两者格式间转换的功能,但我现在是为了在编写的程序中实现,如果大家知道办法,就请路见不平,拔刀相助吧,小子愿出金子百两,为。。。言归正传,

如果能通过发送消息给AutoCAD软件调用函数也可以,有代码的请多贴代码

非常期待大家的帮助了!
...全文
261 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hn_zys 2013-02-03
  • 打赏
  • 举报
回复
如果要实现dwg和dxf文件格式之间的转换,ODA的开发工具TEIGHAX 是最好选择,不用AUTOCAD支持,几行代码就可实现你所需要的功能!
上岸の鱼 2010-09-17
  • 打赏
  • 举报
回复
这两天在网上找了很多资料,发现AutoDesk提供了一个开发AutoCAD的SDK包,叫ObjectArx或Arx,后加版本号。我下了一个ObjectArx2009,但初学感觉用起来有点困难,里面有好多类,里面还有第一眼看起来不是很懂的Sample。

我用它做了一个最简单的插件HelloWorld.

感觉对于初学者,我的以下几点建议是应该要知道的:
1.在工程属性中应当包含这个SDK包,"C/C++"->"General"--> "Additional Include Directories" 项,加入这个文件路径,通常名字是一个Inc的文件夹。

2.为自己工程添加所需的库(libraries),例如在我的HelloWorld工程,仍然是属性里: "Linker"->"Input"--> "Additional Dependencies" 里添加"rxapi.lib acdb17.lib acge17.lib acad.lib acedapi.lib"。

3.初学了解不深,但个人感觉这个SDK并没有提供AutoCAD底层的代码,好像都被封装好了,我们用的这个SDK也只是在它提供的一些接口上开发。我找不到具体底层的代码。

4,我写的这个只是一个插件,但不是DLL格式的,在AutoCAD中,插件应是.arx格式的,但这两个其实是一个东西,只是你生成的时候要在工程属性里修改。

希望以后要是有朋友遇到相同的问题,我的这些见解可以简单参考一下。
上岸の鱼 2010-09-15
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 bhybhybhy2 的回复:]
Introduction



DWGdirect is a C++ library that can be used to read and write AutoCAD DWG and DXF files outside of AutoDesk AutoCAD, thus greatly improving the speed and convenience of processe……
[/Quote]

Thanks.
Sounds good. And how can I import DWGdirect library in my MFC Program?
And any information about the classes and method in it?

Waiting for reply.
悟迟 2010-09-15
  • 打赏
  • 举报
回复
帮你顶顶
  • 打赏
  • 举报
回复
Introduction



DWGdirect is a C++ library that can be used to read and write AutoCAD DWG and DXF files outside of AutoDesk AutoCAD, thus greatly improving the speed and convenience of processes utilizing information contained within AutoCAD drawings. DWGdirect can read DWG and DXF (both ASCII and binary) files, versions 2.5 through 2007. It can write DWG and DXF (both ASCII and binary) files, versions 12 through 2007. Please note that 2004, 2005, and 2006 drawings use the same binary format.

When files of different versions and types are loaded into DWGdirect, their data is normalized to a consistent format, allowing clients to access data from different versions and types of files in a consistent manner. DWGdirect is available for Windows, Macintosh, and a variety of UNIX platforms.


上岸の鱼 2010-09-14
  • 打赏
  • 举报
回复
郁闷。。怎么没个人来回答呀。。。。版主速度来救济
上岸の鱼 2010-09-14
  • 打赏
  • 举报
回复
都火烧屁股了。。请各位大侠出场捧脸解决问题了

1,451

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计/Flash/Silverlight 开发 图象工具使用
社区管理员
  • 图象工具使用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧