dwginfo问题(zoomwindow放大的的区域不正确)急 如题,高手帮忙 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit AcadTest2000; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ActiveX, ComObj, OleCtnrs; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var p1, p2 : OleVariant; Acad, ActiveDoc, : OleVariant; begin // create variant arrays to hold coordinates of the window p1 := VarArrayCreate([0,2], VT_R8); p2 := VarArrayCreate([0,2], VT_R8); // assign values to array elements p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0) p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0) Acad := CreateOleObject('AutoCad.Application'); if not varisempty(Acad) then Acad.visible := visible; // open drawing ActiveDoc := Acad.Documents.Open('E:\Home\Planview.dwg'); // zoom appliciation Acad.ZoomExtents; Acad.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2)); end; end. The Approach for Acad-14 is different. The ZoomExtents and ZoomWindow methods apply to a viewport, also the sintaxe of opening a file is different unit AcadTest14; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ActiveX, ComObj, OleCtnrs; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var p1, p2 : OleVariant; Acad, ActiveDoc, ViewPort : OleVariant; begin // create variant arrays to hold coordinates of the window p1 := VarArrayCreate([0,2], VT_R8); p2 := VarArrayCreate([0,2], VT_R8); // assign values to array elements p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0) p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0) Acad := CreateOleObject('AutoCad.Application.14'); if not varisempty(Acad) then Acad.visible := visible; // open drawing ActiveDoc := Acad.ActiveDocument.Open('E:\Home\Planview.dwg'); //Activate viewport ViewPort := ActiveDoc.ActiveViewPort; // zoom appliciation ViewPort.ZoomExtents; ViewPort.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2)); end; end. 我用的dwginfo控件啊 VarArrayCreate([0,2], VT_R8); VT_R8 是什么??varEmpty = $0000; varNull = $0001; varSmallint = $0002; varInteger = $0003; varSingle = $0004; varDouble = $0005; varCurrency = $0006; varDate = $0007; varOleStr = $0008; varDispatch = $0009; varError = $000A; varBoolean = $000B; varVariant = $000C; varUnknown = $000D; varShortInt = $0010; varByte = $0011; varWord = $0012; varLongWord = $0013; varInt64 = $0014; varStrArg = $0048; varString = $0100; varAny = $0101; varTypeMask = $0FFF; varArray = $2000; varByRef = $4000; Acad是什么控件?? 在dbgrid中使用方向键[->]问题:如果实现[->]这个向右的键与tab一样的功能呢? 问一下这个函数的意思 条条小路通厕所,散分贴 如何在“市场”下面增加节点? 打包问题? 调用一个vc写的dll时遇到奇怪的问题!! 小问题!!快来拿分!!!在线等待!!!(另外开贴,高手请进) 我的delphi 6.0 为什么不能编译了? 关于NMSMTP的问题,请指教! 当IE的地址栏网址发生变化,我如何做才能感知得到? 数据库链接错误! 关于窗体的分辨率的问题?进者有分!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ActiveX, ComObj, OleCtnrs; type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject);
var
p1, p2 : OleVariant;
Acad, ActiveDoc, : OleVariant;
begin
// create variant arrays to hold coordinates of the window
p1 := VarArrayCreate([0,2], VT_R8);
p2 := VarArrayCreate([0,2], VT_R8); // assign values to array elements
p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0)
p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0) Acad := CreateOleObject('AutoCad.Application');
if not varisempty(Acad) then
Acad.visible := visible; // open drawing
ActiveDoc := Acad.Documents.Open('E:\Home\Planview.dwg'); // zoom appliciation
Acad.ZoomExtents;
Acad.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2));
end; end.
The Approach for Acad-14 is different. The ZoomExtents and ZoomWindow methods apply to a viewport, also the sintaxe of opening a file is different
unit AcadTest14; interface uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ActiveX, ComObj, OleCtnrs; type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject);
var
p1, p2 : OleVariant;
Acad, ActiveDoc, ViewPort : OleVariant;
begin
// create variant arrays to hold coordinates of the window
p1 := VarArrayCreate([0,2], VT_R8);
p2 := VarArrayCreate([0,2], VT_R8); // assign values to array elements
p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0)
p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0) Acad := CreateOleObject('AutoCad.Application.14');
if not varisempty(Acad) then
Acad.visible := visible; // open drawing
ActiveDoc := Acad.ActiveDocument.Open('E:\Home\Planview.dwg');
//Activate viewport
ViewPort := ActiveDoc.ActiveViewPort; // zoom appliciation
ViewPort.ZoomExtents;
ViewPort.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2));
end; end.
VarArrayCreate([0,2], VT_R8);
VT_R8 是什么??varEmpty = $0000;
varNull = $0001;
varSmallint = $0002;
varInteger = $0003;
varSingle = $0004;
varDouble = $0005;
varCurrency = $0006;
varDate = $0007;
varOleStr = $0008;
varDispatch = $0009;
varError = $000A;
varBoolean = $000B;
varVariant = $000C;
varUnknown = $000D;
varShortInt = $0010;
varByte = $0011;
varWord = $0012;
varLongWord = $0013;
varInt64 = $0014;
varStrArg = $0048;
varString = $0100;
varAny = $0101;
varTypeMask = $0FFF;
varArray = $2000;
varByRef = $4000; Acad是什么控件??