首页 > 编程 > Delphi > 正文

AutoCAD调用技巧

2019-09-08 23:09:06
字体:
来源:转载
供稿:网友

//uses ComObj;
//for autocad 2000
procedure TForm1.Button1Click(Sender: TObject);
var
obj_Acad :OleVariant;
begin
try
obj_Acad:=GetActiveOleObject(''AutoCAD.Application.15'');
except
obj_Acad:=CreateOleObject(''AutoCAD.Application.15'');
end;
obj_Acad.Visible:=True;
obj_ACAD.Documents.Open(''g://AutoCad/data/dwg/4.dwg'');
end;

//for r14
procedure TForm1.Button1Click(Sender: TObject);
var
obj_Acad :OleVariant;
begin
try
obj_Acad:=GetActiveOleObject(''AutoCAD.Application.14'');
except
obj_Acad:=CreateOleObject(''AutoCAD.Application.14'');
end;
obj_Acad.Visible:=True;
obj_ACAD.ActiveDocument.Open(''g://AutoCad/data/dwg/4.dwg'');
end;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选