Abstract : This paper introduces a method of designing parametric parts for machine tool fixture based on client/server model in AutoCAD For Windows environment. The parametric component design and the use of the C++ language to manipulate the SQL Server database were studied.
For the research and development of Computer Aided Fixture Design System (CAFD), the graphics library for machine tool fixtures occupies an important position in the system. Traditionally, the graphics libraries for these components are hung on CAD graphics software, which can only be applied to prototype systems with fewer components. At present, all kinds of machine tool fixture systems have a large number of parts and components. For example, the types and specifications of the parts and components of special fixtures belonging to GB have reached tens of thousands of scales, plus the combination of slotted fixtures and hole assembly fixtures. The number of components such as pneumatic and hydraulic power sources and general fixtures is considerable. Secondly, for the CAFD system, the fixture component graphics library should be a separate part for the CAFD system to retrieve and call. There are also parameterized technologies. Mature, the establishment of a parameter-based fixture component graphics library has the advantages of simplifying graphics storage, modifying the structure design, and reducing storage space. For this purpose, we have researched and developed a client/server model based machine tool fixture parametric part graphics library and its system to meet the above requirements.
1 Determination of design plan
1) Client/Server Architecture
As more and more departments install networks to share resources in the network environment, object-oriented methods and client server architectures are favored. The client factory server architecture includes multiple computers connected in a network. Those computers that process applications are called clients, and computers that process database services in the background are called servers. In the database environment, the client and server communicate through several programming interfaces called middleware. The client's capabilities include managing user interfaces, accepting data from users, processing applications, generating database requests, sending database requests to servers, and receiving results from servers. The server's capabilities include accepting database requests from clients, processing database requests, formatting and delivering results to clients, performing integrity checks, providing concurrent access control, and optimizing query and update processing.
2) System software and hardware solutions
The parameterized parts graphic library design system adopts a client/server architecture, and the system operating environment is set as follows:
Hardware environment 1 IBM PC Server high-end microcomputer server, 2 to several clients (PII450, 64M RAM, 10.4G HDD).
The software environment server operating system is Windows NT4.0 operating system, the guest operating system is Windows NT4.0 operating system, Windows 98 operating system, the server, client network protocol set TCP/IP, and the database management system is Microsoft SQL Server 6.5, The client application development tool is Visual C++ 6.0, AutoCAD R14.
3) Parametric Parts Graphics Library Overall Design Framework
In this system, the parameters of the machine tool components are stored on the server side. C + + language to draw the parameters of the machine tool fixture parametric graphics program, through the interface program to read the value of the field in the server database, the user can interactively modify the field value, the value of the field as a size parameter passed to the drawing function in the program, Drawing in the AutoCAD environment to achieve parametric design of machine tool parts. The overall design scheme is shown in Figure 1.
Figure 1 overall design plan
2 Database Design
Database structure design
When designing a database structure with Microsoft S QLServer, there is a table for each part of the machine fixture.
Due to the dimensional chaining between the part size parameters, errors caused by user input of parameter values â€‹â€‹will cause drawing errors. We solve this problem by setting validity rules. When the parameter value of the user input does not meet the dimensional chain relationship, the dialog box will prompt an error. This makes the database operator interface has a certain error correction function.
Database operation interface design
Microsoft Visual C++ 6.0 has a powerful visual programming function, so it can use its database programming interface to easily complete the data record query, add, delete and modify functions.
3 C++ language interface program design of database in parametric drawing
AutoCAD has provided the interface ASI (AutoCAD SQL Interface) with the external database from the 12th edition, integrates the SQL (Structured Query Language) language into AutoCAD, can realize the data exchange with the external database in AutoCAD. ADS ASI consists of a large set of C language library functions that require driver support during execution, and as the version of the ASI function has been greatly modified, these have greatly increased the burden on the developer, just for different environments. The adaptation work took a lot of time and extended the software development cycle.
ObjectARX is a new programming environment based on AutoCAD R14. It provides an object-oriented development environment and interface based on C++, and can directly access AutoCAD R14 graphics database directly. The ObjectARX programming environment, in addition to providing several easy-to-use class libraries, can also use the MFC class library to compile a rich Windows-style interface. ARX â€‹â€‹shares the address space with AutoCAD in the form of a dynamic link library (DLL), calls AutoCAD core functions directly, and has direct access to the AutoCAD database. Compared to ADS and AutoLISP, ARX applications run faster and more stable.
I use the ObjectARX application written in Visual C++ 6.0 to implement the database connection. The following uses the A-type flat plate of common parts for machine tool clamps as an example to introduce how to use Visual C++ 6.0 to operate the database in parametric drawing.
Connect to the database via ODBC. ODBC (Open Database Connectivity) is an open service architecture database part of Microsoft's Windows. It is a unified interface standard for accessing multiple databases. ODBC is actually a database access library, but it only provides a unified application program interface (API). This use of ODBC can avoid changes in the application with the database changes. ODBC achieves database independence through the use of database drivers. The standard interfaces provided by the driver allow application developers and driver providers to pass data between applications and data sources.
Through the ODBC in the Windows 98 Control Panel, you can connect to the database of machine tool fixtures built in the server used by this parametric design system.
For each table in the database, an application-specified recordset class is derived from Crecordset. Open the database and create a recordset object, call the recordset's Open member function to open the recordset, and then use the Requery member function to rebuild a recordset. Write all records in this record set to an array of structures.
Corresponds to each table in the database, adds a dialog resource from the resource and derives an application-specified dialog class from CDialog. In the dialog box, the number of edit boxes (EditBox) is determined according to the number of fields in the table. The static text box has the same title as the field name in the database. The part parameter control dialog is shown in Figure 2.
Figure 2 Component Parameters Control Dialog Box
The first record in the recordset is displayed as a default value in the edit boxes of the dialog box. The user can select the appropriate record through the two buttons on the right side of the dialog box (last record and next record), or enter the record number directly in the edit box to obtain the desired record and display it in each edit box.
The user can edit and modify the parameter values â€‹â€‹in each edit box. After pressing the OK button, the user first checks whether the value of each parameter meets the dimensional chain relation. If they match, the value in each edit box is passed as the size parameter value to the drawing function. Medium; otherwise, a popup dialog box indicates an error.
Based on the client/server model, the machine tool fixture parametric parts graphic library not only has large capacity, safe and reliable operation, stable operation, but also can install various types of CAFD system on the client, which is convenient for multi-user design in the network environment. The fixture meets the CAFD system requirements for the parts library. At the same time, the structure of such a structure of the graphical database can also be used for various types of machinery, including machine tools, including a variety of computer-aided mechanical design of the graphic database, it has a certain universal significance.