Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Visual Basic

279 views
Skip to first unread message

Michael Ziegler

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
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>

BigByte Drafting

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to
>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".


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
----------------<<<<>>>>----------------

Robert Benjamins

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to

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


BigByte Drafting

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to
>try "Application.DDEInitiate("AutoCAD LT.dde", "system")"
>this works in the routines I wrote.


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?

Robert Benjamins

unread,
Mar 31, 1999, 3:00:00 AM3/31/99
to

BigByte Drafting wrote:

But this method requires LT to be running

Can 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

BigByte Drafting

unread,
Apr 1, 1999, 3:00:00 AM4/1/99
to
Thanks very much Robert, I'm with it now

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>...

0 new messages