• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
 
Bonus Chapter 4
Using ActiveXAutomation withAutoCAD
 
A
utoCAD 14 was the first version to include ActiveXautomation server capabilities.These capabilities were fur-ther extended in AutoCAD 2000 (AutoCAD 2005 supportsthe same automation server capabilities as AutoCAD 2000).ActiveXautomation makes it possible to perform AutoCAD operationsfrom a wide variety ofother applications,including MicrosoftVisual Basic,Microsoft Excel,and Microsoft Word.This chapter willreview the basics ofActiveX Automation and investigate the inte-gration ofthis powerful technique with AutoCAD.Unlike the other skills covered in this book,ActiveX Automationprogramming is not done within AutoCAD,but within other pro-grams such as Visual Basic or Excel.So this chapter departs fromusual tutorial style to provide reference information on this excitingnew topic.You’ll find all ofthe examples discussed in this chapter.The Visual Basic samples are also on this CD-ROM in both sourceand compiled format,so you can test them even ifyou don’t have acopy ofVisual Basic.
What Is ActiveX Automation?
The AutoCAD Object Model
Automation Techniques
IfYou Want to Experiment…
 
What Is ActiveX Automation?
You’ve seen by now that AutoCAD is an immensely flexible and programmable drawingsystem.You can control AutoCAD from the command prompt,from menus and tool-bars,and from AutoLISP macros and programs.Autodesk also supplies a set ofexten-sions for controlling AutoCAD from the C++ language.These extensions,calledObjectARX,are designed for use from C++ only and are beyond the scope ofthis book.Starting with AutoCAD 14,there’s an entirely new way to control AutoCAD—through ActiveX Automation.ActiveX Automation is a Microsoft-created standard,formerly called OLE Automation,that allows one Windows application to controlanother Windows application through exposed “objects.In this chapter,you’ll see how you can use an external application to control AutoCAD and become familiar with theActiveX Automation capabilities ofAutoCAD 2005.Ifyou want to see some immediate examples ofActiveX Automation programming,skip forward to the
 Automation Techniques
section.But be sure to come back and readother material in this chapter for an overview ofthe potential ofActiveX Automationwith AutoCAD.
Integrating Applications
AutoCAD is a marvelously flexible application,but like all computer applications,it’sspecialized in one particular area.AutoCAD’s specialty is producing drawings.Despitesome capabilities for handling text,numbers,and data storage,AutoCAD isn’t a wordprocessor,spreadsheet,or database program—nor should it be.By concentrating theirefforts on drawing functionality,the Autodesk developers can produce the best possibledrawing application,and let other teams produce the best possible word processors,spreadsheets,and databases.However,there are times when it would be nice to combine the capabilities ofmulti-ple programs.Imagine that you have a complex architectural drawing for an entire build-ing,such as an office building,and you need to produce some custom reports on thenumber ofdesks,chairs,and computer workstations the plan includes.Yes,you could fig-ure out a way to do this within AutoCAD itself.But wouldn’t it be much easier to some-how use the AutoCAD data within a database program that has a powerful reportgenerator? Or suppose you need to include a summary oflumber board feet in a docu-ment you’re preparing in a word processor.Wouldn’t you like to be able to read the neces-sary information from the drawing file you’ve been working with?
WHAT IS ACTIVEX AUTOMATION?
3
 T
HISCHAPTERORIGINALLYAPPEAREDIN
M
ASTERING
A
UTO
CAD 2004
AND
A
UTO
CAD LT 2004
ANDHASBEENUPDATEDFOR
A
UTO
CAD 2005
AND
A
UTO
CAD LT 2005.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...