Custom programming solutions, applications and training!

Dynamic Data Exchange (DDE)

Contract CADD Group - Phone: (604) 591-1140 Email: frank.zander@contractcaddgroup.com

Looking for CADD expertise?  Think Contract CADD Group!
Looking for Web Solutions?    Think CORBIMITE!

Phone: (604) 591-1140
Toll Free: 1 866 433-2233

AutoCAD r12 Windows menu customization and Dynamic Data Exchange (DDE).

by Frank Zander

(604) 591-1140

This article describes how to harness some of AutoCAD's Dynamic Data Exchange (DDE) power by customizing the AutoCAD menu (ACAD.MNU).

In the Windows environment, programs can "talk" to one another through a Windows protocol called Dynamic Data Exchange (DDE). For AutoCAD to use DDE functions, an AutoCAD Development System (ADS) program needs to be loaded to define the functions AutoCAD will use to "talk" to other Windows applications. Luckily, the ADS program defining the AutoCAD functions is shipped with each license of AutoCAD. The ADS program is called DDELISP.EXE and is located in the \ACADWIN\ sub-directory.

The first part of the process in creating a DDE link is the loading of the DDELISP.EXE. AutoCAD will automatically load DDELISP.EXE if the support file ACAD.ADS is modified to include the path and file name DDELISP.EXE. A look inside the ACAD.ADS file reveals a default ADS program that is launched each time AutoCAD loads, called ACADAPP.. The ACAD.ADS file will look like this after the modifications is complete.

Next I will outline the rudiments of how to: launch Windows Calculator, and File manager; view a drawing using Cyco's Classic Viewer; and build an application for doing a spell check using Word 6.0 for Windows spell checker.

Accessing the Windows calculator is relatively simple. The Windows Calculator can be run directly from AutoCAD by editing the standard ACAD.MNU and adding the following lines under the ***POP0 menu area:

[WIN Calc]^c^c^c(startapp "calc.exe" "system")

The results:

Now selecting "WIN Calc" launches Window Calculator directly from AutoCAD (great for checking Metric to Imperial calculations).

Launching file manager is accomplished in the same manner, by adding the following code to the AutoCAD menu (ACAD.MNU):

[File Manager...]^c^c^c^P(startapp "c:/windows/Winfile.exe" " ");^p

To view a drawing file using Cyco's Automanager Classic Drawing viewer add:

[/Vview...]^c^c^c^P+

(SETQ RESPONSE nil);+

(setq RESPONSE (getfiled "Cyco Classic Viewer" "C:/drawings/" "dwg"

4));+

(if RESPONSE (startapp "E:/AM/AMC44WIN/AMCWIN.exe" RESPONSE));+

(setq RESPONSE nil)(prin1)^p

Cyco's Automanager Classic is available directly from Cyco for $85.00 U.S. and serves well as a drawing pre-viewer or block picker.

To launch a concurrent drawing session directly from AutoCAD add:

[/COpen Concurrent session]^c^c^c^P+

(setq RESPONSE (getfiled "AutoCAD

Concurrent Session Drawing Loader" "D:/drawings/" "dwg" 4));+

(if RESPONSE (startapp "C:/ACADWIN/ACAD" RESPONSE));+

(setq RESPONSE nil)(prin1)^p

To run Word 6.0 for Windows as a Spell checker for AutoCAD add:

[Spell Check Word for Windows]^c^c^c^p+

setvar;menuecho;3;setvar;highlight;0;+

(prin1)(princ "Starting Word for Windows spell checker")(prin1)+

(ssget "x" '((0 . "text")))(prin1);dxfout;spell;e;p;;6;+

^C^C^C(startapp "C:/WINWORD/WINWORD.EXE" "SPELL.DXF");+

(prin1)+

(princ "Control C to abort or press enter to continue")(prin1)(prin1);+

erase\p;;dxfin;spell;setvar;highlight;1;setvar;menuecho;0;+

(progn (prompt " ^M ^M ^M")(princ));^p

The spell checking idea was originally Bill Fane's. Bill uses an AutoCAD DOS "shell" (no Windows) to access the checker inside Word Perfect DOS. I would rather use AutoCAD for Windows and Word 6.0 for Windows (just personal preference). Word for Windows reads a file created by this program called SPELL.DXF. SPELL.DXF contains all the text entities in the current drawing exported by AutoCAD. Inside Word for Windows, run Word's Spell check (short cut key: Shift + F7). Save the corrections and end Word for Windows. Upon returning to AutoCAD session, press enter and all the previously exported text is erased and the spell checked text from the file SPELL.DXF is imported back into AutoCAD to the correct locations inside the drawing.

Notes:

Update the ACAD.MNU changes by reloading the ACAD.MNU. This can be accomplished by typing MENU at the AutoCAD command prompt and then selecting the ACAD.MNU as the current menu.

Bill Fane's DOS spell checking routine and Frank Zander's ACAD.MNU are free downloads to Vancouver AutoCAD Users Society's (VAUS) Members on the VAUS  Website.

CORBIMITE Web Solutions
Website created By Frank Zander
Phone: (604) 591-1140
Copyright © 2006 
Contract CADD Group
All rights reserved.


Contract CADD Group is an Autodesk Developer Network member.

Please give us Feedback!
Send your comments and  suggestions to:
Frank Zander
Revised: September 07, 2008.

Visit our favorite websites

CORBIMITE Website hosting
Registration | Hosting | Design
Vizdeopt Visualization resource
Nvidia Nvidia forums
Tenlinks Top 10 AutoCAD VBA
cadalyst Cadalyst CAD eZine
Back Back Top of Page
Search

ENGLISH > SPANISH ENGLISH > BRAZILIAN ENGLISH > CHINESE ENGLISH > FRENCH - FRANCAIS ENGLISH > GERMAN - DEUTSCH ENGLISH > ITALIAN ENGLISH > JAPANESE ENGLISH > KOREAN ENGLISH > PORTUGUESE Contract CADD Group