Abstract: Combined with MFC and ObjectARX, the selection and checking program of the pump rolling bearing was developed on the AutoCAD2002 platform. This paper expounds the characteristics of ARX technology and how to set the application environment and precautions of ObjectARX2000 under the VC++ application wizard interface, analyzes the selection principles and mathematical expressions of rolling bearings, and puts forward the selection and verification flow chart of this program. The application program interface is presented, and the selection and checking of pump bearings are realized.
1. Introduction
In recent years, with the development of computer and the popularization of CAD technology, the application of AutoCAD in engineering design and the secondary development work using it as a running platform are becoming more and more extensive. ObjectARX is a secondary development environment based on AutoCAD object-oriented technology. It has powerful timely expansion function. Together with MFC in VC++, it can easily and quickly realize the selection and verification of a wide variety of pump rolling bearings.
2. ARX technical features
ARX (AutoCADRuntimeeXtension) is an object-oriented VC++ data development environment. The interface uses VC++ as the development language and ARX class library as the development tool. It adopts object-oriented and visual programming methods and supports MFC programming. By sharing the address space with AutoCAD, it can directly access AutoCAD’s database, graphics system and geometric modeling core by using AutoCAD’s kernel code, extend the classes and functions of AutoCAD in real time, and establish new AutoCAD commands. ObjectARX2000 technology can carry out ARX development for AutoCAD2002 version (multiple use of C or C++). Utilize the “class” technology in C++ to encapsulate the basic core modules of the AutoCAD system, without caring about how it operates internally, reducing the repetitive work of developing the underlying modules, focusing on developing application modules, and expanding existing The function of the module reflects the “encapsulation” and “inheritance” in the object-oriented technology. The ARX program is essentially a dynamic link library (DLL), which directly calls the core functions of AutoCAD in a message-driven way, directly accesses the AutoCAD database, and runs faster and more stable [1-4].
3. Pump bearings and their selection and checking principles
The selection of rolling bearings is related to many factors, and the size and direction of the load on the bearing are mainly considered in the selection process of the pump bearing. For both radial and axial combined loads, the selection principles are as follows:
(1) Angular contact ball bearings or tapered roller bearings are generally used;
(2) If the radial load Fr is large and the axial load Fa is small, choose deep groove ball bearings or cylindrical roller bearings with ribs on the inner and outer rings; if the installation alignment is poor, use self-aligning ball bearings, Spherical roller bearing;
(3) If the radial load Fr is small and the axial load Fa is large, thrust angular contact ball bearings and thrust tapered roller bearings can be selected; if self-aligning performance is required at the same time, thrust spherical roller bearings can be selected;
(4) Combination of bearings: deep groove ball bearings and thrust ball bearings, deep groove ball bearings and angular contact ball bearings, deep groove ball bearings and tapered roller bearings, cylindrical roller bearings and thrust ball bearings, two angular contact ball bearings The combination of forward, reverse and tandem bearings, and the forward, reverse and tandem of two tapered roller bearings.
Considering the different force conditions, operating speeds, cooling and lubrication conditions of the bearing in the pump, the following principles are used in this program design [5]:
(1) The principle of economic life. That is, the service life of the bearing is the closest to the required life, but the former is not less than the latter. Application occasion: Under the action of external load, the support bearing will not generate internal additional load, or the selection of this bearing does not consider the influence of other bearings on the same shaft.
(2) “Sum of life” approximation principle. That is to say, the service life sum of the two bearings is the closest to the service life required by the bearing, but the service life of the two bearings is not less than the required service life.
(3) The principle of equal life expectancy. That is, the service life of the two bearings is not much different, and they fail at almost the same time.
(4) The principle of minimum life margin. That is to say, among the left and right bearings, the service life of the bearing with the longest service life is close to the required service life, and the degree of proximity is determined by the margin factor.
According to the different flow directions of the inlet and outlet, the water pump is divided into axial flow pump, radial flow (centrifugal) pump and mixed (oblique) flow pump. in combination with radial force. In the selection process of pump bearings, the design is roughly based on the above ideas, and the specific process is divided into preliminary determination of the type and final determination of the bearing model. In the process of preliminary selection, it is determined whether to select the combined bearing according to the length of the pump shaft, the magnitude of the force and the number of stages of the pump. combination. In the process of determining the specific model of the bearing, first calculate the equivalent dynamic load P/(P=XFa+YFr), and access the bearing database through the application program (ODBC database or ADO database established by Access or SQL Server 2000, and the application program accesses through the TSQL query statement The established database), call the corresponding type of parameters X, Y, e, fh, fm, fd, fn, fT, and finally calculate the rated dynamic load.
According to the condition C≤Ca(Cr), traverse the corresponding standard database to select the most economical and reasonable bearing model. The program flow is shown in Figure 1 (where: A is thrust ball bearing, B is thrust cylindrical roller bearing, C is thrust tapered roller bearing; D is deep groove ball bearing, E is self-aligning ball bearing, F is angle Contact ball bearing, G is tapered roller bearing, H is cylindrical roller bearing, M is spherical roller bearing, N is thrust spherical roller bearing).
4. Object-oriented technology for pump bearing selection ObjectARX application
The application program interface layer mainly includes the standard AutoCAD2002 main interface, user demand input (such as working condition parameters, medium properties, material properties, standardization requirements, etc.)
The interface program layer completes the data communication between the upper and lower layers, and AutoCAD calls the ARX module through the entry function acrxEntrypoint() of its dynamic link library. The acrxEntrypoint() function not only serves as the communication entry function between ARX application and AutoCAD, but also is the way for ARX application to transmit information and return status code to AutoCAD.
The way to create MFC-based ObjectARX applications is to use the dynamic link MFC library, which is the only way to safely use the two basic libraries, AcUi and AdUi provided by ARX [6, 7, 8]. The process of creating this application using the application wizard AppWizard provided by ObjectARX2000 is as follows:
(1) Select the ObjectARX2000AppWizard item in the VC++ application wizard interface Project;
(2) ProjectType select ObjectARX[AutoCADextension], AdditionalLibraries select MFCExtensionDLL(usingsharedMFCDLL) and select USEMFCExtensionforAutoCAD;
(3) Click Finish to create the project. Using the ObjectARX project wizard, the class library and header files required by the ARX program can be added automatically, eliminating the need for manual settings. At the same time, the DLL entry function DllMain() and the ARX application entry function acrxEntryPoint(), the initialization function initapplication(), and the unloading function unloadapplication() are automatically added in the program. Users do not need to modify it, but only add their own defined functions. Develop a complete ARX application. Of course, setting the path of the ARX library file and the included file in VC++6.0 is the premise that the program can be compiled and passed, and the application program established in this way can be guaranteed to be loaded and run normally in AutoCAD2002. When the designed ObjectARX application uses the MFC library shared with AutoCAD or other applications, it is a problem to consider its resource management, so ObjectARX2000 provides two simple C++ classes to facilitate the resources. The CAcExtensionModule class can hold an AFX_EXTENSION_MODULE data structure and track the provider of the DLL resource. The CacModuleResourceOverride class object can switch between resource providers, that is, when a class object is constructed and generated, it will switch to a new resource provider. When the object is destructed, the previously saved resource provider will be reset. Insert a dialog resource in the project, then add the required controls in this dialog and edit the message response program code of the dialog and controls, named ID-WXY1-DIALOG, and its interface is shown in Figure 2.
Finally, add the header file of the dialog class to the .cpp file of the main application. After compiling and linking, an ARX file is generated, and the program can be run by calling the AutoCAD external command MYMFC generated by this program in the AutoCAD environment.
5. Conclusion
The rational use of MFC with rich resources in the secondary development of AutoCAD with ObjectARX can greatly improve the work efficiency of developers and improve the quality of the developed applications. In the application development of pump bearing selection, only MFC is used, which can shorten the development time and make the program user interface (GUI) more convenient, beautiful and friendly.