这是一个利用AutoCAD类型库调用AutoCAD DWF Viewer的例子。能够浏览DWF 文件。
还是上传不了。
只好贴上。
unit Unit1;
{ Delphi利用AutoCAD类型库调用DWF Viewer 的例子 }
{ 作者:钏裕民 2006年6月10日于昆明 }
{ Email : chuanyumin@126.com.cn }
{ qq : 670856630 }
{ 说明: }
{ 实际上AutoCAD中有许多类型库,不仅是扩展名是.tlb的是类型库 }
{ 许多AutoCAD安装目录下的.dll文件也是类型库,也可导入,可在编程中利用 }
{ 这里,仅演示C:/Program Files/Autodesk/Autodesk DWF Viewer/AdView.dll }
{ 导入类型库后的利用,其它仍在摸索。 }
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, StdCtrls, ExpressViewerDll_TLB;
type
TForm1 = class(TForm)
CExpressViewerControl1: TCExpressViewerControl;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
procedure MouseDBClick(ASender: TObject; nX, nY: Integer;
const pHandled: IDispatch);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MouseDBClick(ASender: TObject; nX, nY: Integer;
const pHandled: IDispatch);
begin
CExpressViewerControl1.BrowseProperties;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
CExpressViewerControl1.ExecuteCommand('NEXT');
end;
end.
还是上传不了。
只好贴上。
unit Unit1;
{ Delphi利用AutoCAD类型库调用DWF Viewer 的例子 }
{ 作者:钏裕民 2006年6月10日于昆明 }
{ Email : chuanyumin@126.com.cn }
{ qq : 670856630 }
{ 说明: }
{ 实际上AutoCAD中有许多类型库,不仅是扩展名是.tlb的是类型库 }
{ 许多AutoCAD安装目录下的.dll文件也是类型库,也可导入,可在编程中利用 }
{ 这里,仅演示C:/Program Files/Autodesk/Autodesk DWF Viewer/AdView.dll }
{ 导入类型库后的利用,其它仍在摸索。 }
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, StdCtrls, ExpressViewerDll_TLB;
type
TForm1 = class(TForm)
CExpressViewerControl1: TCExpressViewerControl;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
procedure MouseDBClick(ASender: TObject; nX, nY: Integer;
const pHandled: IDispatch);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MouseDBClick(ASender: TObject; nX, nY: Integer;
const pHandled: IDispatch);
begin
CExpressViewerControl1.BrowseProperties;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
CExpressViewerControl1.ExecuteCommand('NEXT');
end;
end.
本文介绍了一个使用Delphi和AutoCAD类型库调用DWFViewer组件来浏览DWF文件的例子。通过导入C:/Program Files/Autodesk/Autodesk DWF Viewer/AdView.dll类型库,展示了如何在Delphi应用程序中实现对DWF文件的基本操作。
3802

被折叠的 条评论
为什么被折叠?



