AutoCAD ObjectARX和RealDWG的基本数据操作

.dwg文件的读取。拥有RealDWG或者ObjectARX不必多说。

安装RealDWG后RealDWG目录下的Samples看看。

新建工程配置好Inc,Lib,附加依赖等。

不必多说。

需要将AcDbHostApplicationServices实现一遍。

sample自带的即可,也可自己按照自己的来写。

  1 int Verbose = 0;
  2 int Copy = 0;
  3 int Header = 0;
  4 int Tables = 0;
  5 int doExtents = 0;
  6 int showErased = 0;
  7 int resolveXrefs = 0;
  8 
  9 class DumpDwgHostApp : public AcDbHostApplicationServices
 10 {
 11 public:
 12     ~DumpDwgHostApp();
 13     Acad::ErrorStatus findFile(TCHAR* pcFullPathOut, int nBufferLength,
 14                          const TCHAR* pcFilename, AcDbDatabase* pDb = NULL,
 15                          AcDbHostApplicationServices::FindFileHint = kDefault);
 16     // These two functions return the full path to the root folder where roamable/local 
 17     // customizable files were installed. Note that the user may have reconfigured 
 18     // the location of some the customizable files using the Options Dialog 
 19     // therefore these functions should not be used to locate customizable files. 
 20     // To locate customizable files either use the findFile function or the 
 21     // appropriate system variable for the given file type. 
 22     //
 23     Acad::ErrorStatus getRoamableRootFolder(const TCHAR*& folder);
 24     Acad::ErrorStatus getLocalRootFolder(const TCHAR*& folder);
 25 
 26     //URL related services
 27     Adesk::Boolean isURL(const TCHAR* pszURL) const;
 28     Adesk::Boolean isRemoteFile(const TCHAR* pszLocalFile, TCHAR* pszURL, size_t nUrlSize) const;
 29     Acad::ErrorStatus  getRemoteFile(const TCHAR* pszURL, TCHAR* pszLocalFile, size_t nFilePath, Adesk::Boolean bIgnoreCache) const;
 30 
 31     // make sure you implement getAlternateFontName. In case your findFile implementation
 32     // fails to find a font you should return a font name here that is guaranteed to exist.
 33     virtual TCHAR * getAlternateFontName() const
 34     {
 35         return _T("txt.shx"); //findFile will be called again with this name
 36     }
 37 private:
 38     mutable CMapStringToString m_localToUrl;
 39 };
 40 DumpDwgHostApp::~DumpDwgHostApp()
 41 {
 42     CString local,url;
 43     for (POSITION pos = m_localToUrl.GetStartPosition();pos!=NULL;)
 44     {
 45         m_localToUrl.GetNextAssoc(pos,local,url);
 46         DeleteUrlCacheEntry(url);
 47     }
 48 }
 49 // Return the Install directory for customizable files
 50 Acad::ErrorStatus 
 51 DumpDwgHost
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值