thanks,
JJ
You can easily work with autocad w/ delphi using OLE automation. In
fact inprise's David I did a little story on it:
http://community.borland.com/article/0,1410,10194,00.html
todd
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The more I learn, the less I know.
This could take forever.
Todd Palmer
Developer
CallCenter Technology Inc.
todd....@CallCti.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Take a look at http://ourworld.compuserve.com/homepages/tonyt. It is very
usefull!
Marc
> Does anyone have any experience linking Delphi with AutoCAD? I looked at
> the documentation in AutoCAD 14 for OLE Automation and it seemed to hint
> that the only language capable of linking with AutoCAD was Visual Basic
> (*gulp*). I know you can work using AutoLISP but was hoping to avoid that.
>
> thanks,
>
> JJ
What do you exactly want to do with AutoCAD?
I'm currently working with AutoCAD and Delphi using OLE-Automation.
So I'm sure I can help you.
Explain your problem!
C U
Burgi
If you could briefly outline the steps (including locating the type
library)...
Thank you VERY much, this is a small but quite powerful segment of Delphi
programming, and finding help is tough.
thanx,
JJ
Klaus Burgstaller <klaus.bu...@netway.at> wrote in message
news:384E97DD...@netway.at...
Import the Type Library from within the Delphi IDE:
Project|Import Type Library... select AutoCAD Object Library
or add ACAD.TLB by pressing then [Add...] button
Add to the uses clause in your Delphi code:
AutoCAD_TLB, ComObj
Then sample draws a line in color blue.
const acBlue = 5; // Const taken from VBA Objectbrowser
procedure TForm1.Button1Click(Sender: TObject);
var
Linie : AcadLine;
acd : variant;
acad : AcadApplication;
doc : AcadDocument;
begin
try
acd := GetActiveOleObject('AutoCAD.Application.14');
except
ShowMessage('AutoCAD is not started!');
exit;
end;
doc := IDispatch(Acd.ActiveDocument) as AcadDocument;
// access AutoCAD Application. Not necessary, just
// here for demonstration
acad := doc.Application_;
doc := acad.ActiveDocument ;
Linie := doc.ModelSpace.AddLine (Mkpt(10,10,0),MkPt(20,12.5,0));
Linie.Color := acBlue;
caption := doc.Name ;
acad.Visible := True;
end;
function TForm1.MkPt(x,y,z : double):OleVariant;
begin
result := VarArrayCreate ([0,2],varDouble);
result[0] := x;
result[1] := y;
result[2] := z;
end;
Hope this helps
Sascha
JJ wrote in message <82jp28$1m...@forums.borland.com>...