Hello Michael
AutoCAD LT does not support OLE automation and as such cannot be started
with GetObject or CreateObject
Check out the Shell or ShellExecute API functions
Regards
Tom Roberts
----------------<<<<>>>>----------------
BigByte Drafting & Computer Services
Doubleview, Western Australia
Ph: +61 8 9445 8305
Email: big...@wantree.com.au
Web: http://www.wantree.com.au/~bigbyte
----------------<<<<>>>>----------------
Michael Ziegler wrote:
> Hi!
> What is the classname of AutoCAD LT? I'm trying to start LT from my VB
> application and can only start AutoCAD R14 by using the classname
> "AutoCAD.Application".
> Thanks,
> Michael Ziegler
> <michael...@elp.af.se>
try "Application.DDEInitiate("AutoCAD LT.dde", "system")"
this works in the routines I wrote.
Kind regards,
Robert Benjamins
Hello Robert
I have been utilising DDE links between AutoCAD LT and my VB apps for some
time but I have never seen this method mentioned.
I have always initilised a DDE link with the LinkTopic method of a text box
Eg. Text1.LinkTopic = "AutoCAD LT.DDE|System"
But this method requires LT to be running
Can you give a small example of how the Application.DDEInitiate method would
be used?
BigByte Drafting wrote:
But this method requires LT to be runningCan you give a small example of how the Application.DDEInitiate method would
be used?Regards
Tom Roberts
Here is a small example of a macro I use.
Sub Macro1()
kanaalnr = Application.DDEInitiate("AutoCAD LT.dde", "system")
x = Worksheets("blad1").Range("B5")
y = Worksheets("blad1").Range("B6")
lengte = Worksheets("blad1").Range("B10")
For L = 715 To lengte - 500 Step 500
Call TEKENGAT(x + L, y + 220)
Call TEKENGAT(x - 55 + L, y + 220)
Call TEKENGAT(x + L, y - 63 + 220)
Next L
Application.DDETerminate kanaalnr
End Sub
Sub TEKENGAT(x, y)
Application.DDEExecute kanaalnr, "[Line " & x - 7 & ","
& y - 7 & " " & x + 7 & "," & y + 7 & " ]"
Application.DDEExecute kanaalnr, "[Line " & x - 7 & ","
& y + 7 & " " & x + 7 & "," & y - 7 & " ]"
Application.DDEExecute kanaalnr, "[-LAYER S 1 ]"
Application.DDEExecute kanaalnr, "[Line " & x - 10 & ","
& y & " " & x + 10 & "," & y & " ]"
Application.DDEExecute kanaalnr, "[Line " & x & "," &
y + 10 & " " & x & "," & y - 10 & " ]"
Application.DDEExecute kanaalnr, "[-LAYER S 0 ]"
End Sub
Indeed, Autocad LT must be running.
I normaly use my macro from Excel when I'm working in Autocad LT.
When Autocad LT isn't running, Excel asks if it should start Autocad.
but that always fails.
Regards,
Robert Benjamins
I also recieve a error message if I attempt to launch a session of AutoCAD
Run time error -2147352571 (80020005)
Cannot run AUTOCAD.EXE. The program or one of its components is damaged or
missing
For anyone else following this thread DDEInitiate is a method of the
Excel.Application and Word.Application objects
If you wish to start a DDE conversation between between a stand alone VB app
and AutoCAD use the LinkTopic and LinkMode properties of a textbox
Text1.LinkTopic = "AutoCAD LT.DDE|System"
Text1.LinkMode = 2
Regards
Tom Roberts
----------------<<<<>>>>----------------
BigByte Drafting & Computer Services
Doubleview, Western Australia
Ph: +61 8 9445 8305
Email: big...@wantree.com.au
Web: http://www.wantree.com.au/~bigbyte
----------------<<<<>>>>----------------
Robert Benjamins wrote in message <3701B97C...@wxs.nl>...