Application of ActiveX Technology in Tool CAD (Figure)

1 Introduction

Most of the traditional tool CAD applications are re-developed with Autolisp or ADS under AutoCAD R14. Since the tool design work includes the calculation and calibration of the tool parameters and the tool graphic drawing, when developing such CAD application software, in order to improve the calculation speed, the two parts are usually designed separately, and the data files will be used. The calculation and calibration procedures are linked to the drawing program, that is, the calculated and checked tool parameters are first output to the data file. Then access the data file in the drawing program, read each line of data, and finally generate corresponding graphic data and draw the tool graphic. The connection mode between the calculation program and the drawing program is shown in Fig. 1. This coupling mode can realize the tool design function. However, due to the scattered structure and complicated processing of the data files in the drawing program and strict observance of the operation sequence, the operation speed is slow, the use is inconvenient, and the degree of automation is low.

With Microsoft's integration of ActivcX technology into development tools in AutoCAD 2000 and above, AutoCAD ActiveX technology is now used to directly integrate computing, calibration, and drawing programs without having to go through intermediate data files. The connection mode using ActiveX technology is shown in Figure 2. This method is not only fast, easy to use, but also highly automated.



2 Introduction to ActiveX Technology

ActiveX is the name of the component structure based on the ComponentO Object Model (COM), which is a wrapper technology that encapsulates COM components and places them into applications. An ActiveX control is a COM component that supports the necessary protocols used in visual development tools. Many applications (such as Microsoft Excel, Microsoft Word, Microsoft Access, Visual Basic, Visual C++, Delphi, etc.) support ActiveX technology and can manipulate ActiveX objects from within the program.
AutoCAD ActiveX is the application of ActiveX technology in AutoCAD. It not only provides the control programming mechanism inside AutoCAD, but also can realize the control programming outside AutoCAD by opening the AutoCAD object to the external world. The AutoCAD ActiveX object model is shown in Figure 3.

[s].Collection object [o]. object



Figure 3 AutoCAD ActiveX object model

3 How to manipulate AutoCAD objects in VB

Using ActiveX controls provides objects similar to the way you manipulate other objects, first assigning an object reference to a variable, and then writing code that uses the object's methods, properties, and events. AutoCAD objects are open in AutoCAD ActiveX and can be manipulated directly in VB. The specific methods are as follows:
To reference the AutoCAD type library in the VB project: Select the References option in the Project menu, open the References dialog box, and select the AutoCAD Release 15 (AutoCAD 2000 Object Library) type library, as shown in Figure 4.

Set up AutoCAD program objects and document objects in the program code.

Objects are processed in AutoCAD drawing files via AutoCAD ActiveX objects, properties, and methods.

Figure 4 Reference AutoCAD type library in the project


Figure 5 Typical complex tool CAD system interface

Next page

Stainless Steel Profile

Stainless Steel Profile,Stainless Steel Channels,Aisi Stainless Steel Angle,Stainless U Steel Channel

Shandong Xinsuju Steel Co.,Ltd. , https://www.sawlpipe.com