明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4470|回复: 4

[推荐]Thumbnailer.arx for objectdbx

[复制链接]
发表于 2005-10-20 11:01 | 显示全部楼层 |阅读模式

Thumbnailer.arx  Copyright 2005  www.caddzone.com

   Thumbnailer ActiveX Server Documentation

   Library:   Thumbnailer.arx

   Class:     Application

   ProgID:    "Thumbnailer.Application"

   Reference: "Thumbnailer 1.0 Type Library"

   Requirements:  AutoCAD 2004-2006

   Terms and conditions of use:

      This software may be used and freely distributed,
      provided this notice and the copyright notice
      displayed by the application when it loads, is not
      removed, altered, or concealed.

      This software is not warranted to be free of defects.
      Any and all use of this software is undertaken at the
      risk of the user. The author is not responsible for
      any loss resulting directly or indirectly from the
      use of this software.

      Your use of this software constitutes your acceptance
      of these terms and conditions.
 
  Installation:
 
      Thumbnailer.arx must be registered once when installed,
      by dragging it onto the AutoCAD window, or by loading it
      as an ARX library using any supported means. If the
      location of the Thumbnailer.arx file changes, it must
      be re-registered again.
     
      IMPORTANT: To install this library you must be logged
      in with superuser or administrator rights.
     
      IMPORTANT: Use of this library does NOT require it to be
      loaded as an ARX library, and it should never be loaded
      as such for normal use (e.g., do not add Thumbnailer.arx
      to the startup suite or the acad.rx file, and do not load
      it via the LoadArx() method or the LISP equivalent).
 
  Methods:  PreserveThumbnail
 
      obj.PreserveThumbnail(IAcadDatabase Database)
     
      Call this method and pass it the value of the
      Database property of an AxDbDocument, before
      calling the AxDbDocument's SaveAs() method, and
      the existing thumbnail preview (if there is one)
      will be preserved
     
     
   AutoLISP wrapper/example:

      Pass an AxDbDocument to the following LISP function
      to save it to a DWG file, with its existing thumbnail
      preview retained:

      (defun SaveAsEx (dbxDoc filename / app)

         (setq app
           (vla-GetInterfaceObject
              (vlax-get-acad-object)
              "Thumbnailer.Application"
           )
         )

         (vlax-invoke-method app 'PreserveThumbnail
            (vlax-get-property dbxDoc 'Database)
         )

         (vlax-release-object app)

         (vlax-invoke-method dbxDoc 'SaveAs filename)
      )
     
Source:

   The implementation of this method is fairly simple:

   STDMETHODIMP CApplication::PreserveThumbnail(IAcadDatabase* Database)
   {
      HRESULT hr = S_OK;
      CComQIPtr<IAcadBaseDatabase> pBase(Database);
      if( pBase != NULL )
      {
         AcDbDatabase* pDb = NULL;
         hr = pBase->GetDatabase(&pDb);
         if( FAILED( hr ) )
            return hr;
         pDb->setRetainOriginalThumbnailBitmap(true);
      }
      return hr;
   }

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2005-12-5 13:32 | 显示全部楼层
谢谢龙兄!请你有for R15的吗?我在那个网没有找到。
 楼主| 发表于 2005-12-8 17:04 | 显示全部楼层

注意:Requirements:  AutoCAD 2004-2006

它for r15!   我在r2005~r2006测试通过! r2004未试!

发表于 2006-12-6 08:22 | 显示全部楼层
怎么测试?
 楼主| 发表于 2007-1-18 09:17 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-27 03:47 , Processed in 0.247285 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表