|
|
You can create and manipulate AutoCAD objects from any application that serves as an Automation controller. Thus, Automation enables macro programming across applications, a capability that does not exist in AutoLISP.
Through Automation, AutoCAD exposes programmable objects, described by the AutoCAD Object Model, that can be created, edited, and manipulated by other applications. Any application that can access the AutoCAD Object Model is an Automation controller, and the most common tool used for manipulating another application using Automation is Visual Basic for Applications (VBA). VBA is found as a component in many Microsoft Office applications. You can use these applications, or other Automation controllers, such as Visual Basic, .NET, and Delphi, to drive AutoCAD.
The advantage of implementing an ActiveX interface for AutoCAD is twofold:
- Programmatic access to AutoCAD drawings is opened up to many more programming environments. Before ActiveX Automation, developers were limited to an AutoLISP or C++ interface.
- Sharing data with other Windows applications, such as Microsoft Excel and Microsoft Word, is made dramatically easier.
For example, you might want to prompt for input, set preferences, make a selection set, or retrieve drawing data. You can decide on the controller to use, depending on the type of manipulation.
Using Automation, you can create and manipulate AutoCAD objects from any application that serves as an Automation controller. Thus, Automation enables macro programming across applications, a capability that does not exist in AutoLISP. With Automation you can combine the features of many applications into a single application.
The displayed objects are called Automation objects. Automation objects make methods, properties, and events available. Methods are functions that perform an action on an object. Properties are functions that set or return information about the state of an object. Events are user-initiated actions or occurrences to which a program responds.
Virtually any type of application can access the displayed Automation objects within AutoCAD. These applications can be stand-alone executables, dynamic linked library (DLL) files, and macros within applications such as Microsoft Word or Microsoft Excel. The most common of these is most likely the stand-alone executable. If you are using applications from application developers, follow their instructions for installation and use of their product.