[推荐]Thumbnailer.arx for objectdbx
<P>Thumbnailer.arx Copyright 2005 <A href="http://www.caddzone.com/" target="_blank" >www.caddzone.com</A></P><P> Thumbnailer ActiveX Server Documentation</P>
<P> Library: Thumbnailer.arx</P>
<P> Class: Application</P>
<P> ProgID: "Thumbnailer.Application"</P>
<P> Reference: "Thumbnailer 1.0 Type Library"</P>
<P> Requirements: AutoCAD 2004-2006</P>
<P> Terms and conditions of use:</P>
<P> This software may be used and freely distributed, <BR> provided this notice and the copyright notice <BR> displayed by the application when it loads, is not <BR> removed, altered, or concealed.</P>
<P> This software is not warranted to be free of defects.<BR> Any and all use of this software is undertaken at the <BR> risk of the user. The author is not responsible for<BR> any loss resulting directly or indirectly from the <BR> use of this software.</P>
<P> Your use of this software constitutes your acceptance<BR> of these terms and conditions.<BR> <BR> Installation:<BR> <BR> Thumbnailer.arx must be registered once when installed,<BR> by dragging it onto the AutoCAD window, or by loading it<BR> as an ARX library using any supported means. If the<BR> location of the Thumbnailer.arx file changes, it must<BR> be re-registered again.<BR> <BR> IMPORTANT: To install this library you must be logged<BR> in with superuser or administrator rights.<BR> <BR> IMPORTANT: Use of this library does NOT require it to be<BR> loaded as an ARX library, and it should never be loaded<BR> as such for normal use (e.g., do not add Thumbnailer.arx <BR> to the startup suite or the acad.rx file, and do not load <BR> it via the LoadArx() method or the LISP equivalent).<BR> <BR> Methods: PreserveThumbnail<BR> <BR> obj.PreserveThumbnail(IAcadDatabase Database)<BR> <BR> Call this method and pass it the value of the<BR> Database property of an AxDbDocument, before<BR> calling the AxDbDocument's SaveAs() method, and<BR> the existing thumbnail preview (if there is one)<BR> will be preserved<BR> <BR> <BR> AutoLISP wrapper/example:</P>
<P> Pass an AxDbDocument to the following LISP function<BR> to save it to a DWG file, with its existing thumbnail <BR> preview retained:</P>
<P> (defun SaveAsEx (dbxDoc filename / app)</P>
<P> (setq app <BR> (vla-GetInterfaceObject <BR> (vlax-get-acad-object)<BR> "Thumbnailer.Application"<BR> )<BR> )</P>
<P> (vlax-invoke-method app 'PreserveThumbnail<BR> (vlax-get-property dbxDoc 'Database)<BR> )</P>
<P> (vlax-release-object app)</P>
<P> (vlax-invoke-method dbxDoc 'SaveAs filename)<BR> )<BR> <BR>Source:</P>
<P> The implementation of this method is fairly simple:</P>
<P> STDMETHODIMP CApplication::PreserveThumbnail(IAcadDatabase* Database)<BR> {<BR> HRESULT hr = S_OK;<BR> CComQIPtr<IAcadBaseDatabase> pBase(Database);<BR> if( pBase != NULL )<BR> {<BR> AcDbDatabase* pDb = NULL;<BR> hr = pBase->GetDatabase(&pDb);<BR> if( FAILED( hr ) )<BR> return hr;<BR> pDb->setRetainOriginalThumbnailBitmap(true);<BR> }<BR> return hr;<BR> }<BR></P>
<P></P> 谢谢龙兄!请你有for R15的吗?我在那个网没有找到。 <P>注意:Requirements: AutoCAD 2004-2006</P>
<P>它for r15! 我在r2005~r2006测试通过! r2004未试!</P> 怎么测试? <p>例子:</p><p><a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=57315">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=57315</a></p>
页:
[1]