According to the new control device standard parts library preset

AutoCAD uses the database AutoCAD to allow access and manipulation of non-graphical data in external databases (such as standard part size data), using Microsoft's ODBC and OLEDB to achieve AutoCAD external database access. The external databases supported by AutoCAD2000 include M-icrosoftAccess, SQLServer7.0, Visual FoxPro6.0, and so on. Access is a database component in Microsoft Office2000, which is convenient and practical. In this paper, the Access database is selected in the design of mechanical standard parts library.

Establish database and ODBC data source 1) Create a database file for storing standard parts size <3> such as bolts, screws, nuts, washers, bearings, etc. in Access, such as standard.mdb.2) Select ODBC from the system panel. Establish a system DNS file, the data source is named standard, and the database selected by the data source is standard.mdb.

Access to the external database uses VisualCClassWizard to create a derived class <4> of CRecordset, which associates the derived class with the database table through the data source to achieve access to the database. The steps are as follows: 1) Create a new class using ClassWizard (such as the class name CstandardRec) and select its base class as Crecordset.2) to select the data source. In the DatabaseOptions dialog box, select the data source whose established data source standard is a derived class. 3) Select the data sheet. Select the appropriate data table in the SelectDatabaseTable dialog.

User Interface Design User Menu Design AutoCAD provides a powerful tool for customizing menus. The Au-toCAD software comes with a standard menu file called ACAD.MNU. When you start AutoCAD, the ACAD.MNU menu file is automatically loaded. The AutoCAD commands included in the menu file allow the user to modify and rearrange. The user can also delete unusable commands and define new commands. User menu design can be done by editing the ACAD.MNU menu file or writing a new menu file. Considering that this standard parts library is only for mechanical designers, it can be added to the ACAD.MNU menu file. The standard parts menu is designed as shown in the menu section.

Dialog Design Previously, AutoCAD applications used DCL dialogs as a user interface. Windows provides a richer user interface than DCL. ObjectARX can use the MFC in Visual C6.0 to design a Windows-style interface. The steps are as follows: 1) Select the menu Insert/Resource..., select Dialog in the Insert/Re-source dialog box, click the New button, and the dialog box will appear.

2) Select the menu View/ClassWizard, select a new class in the AddingaClass dialog box, and enter the class name ClsDalog in the NewClass dialog box.

3) Add the required controls in the dialog box, such as the hex head BOLT parameter input dialog design.

4) Add code to the corresponding control. For example, the bolt specification drop-down box code is as follows. When the bolt specification changes, the program reads the data from the database and displays it in the dialog box.

Drawing program design When the user selects the bolt specification, the size of other parameters of the bolt is displayed in the dialog box. The designer can modify the bolt length and the thread length. After inputting the coordinates of the insertion point, the drawing program reads the parameters from the dialog box and calculates according to the parameters. The key point of the graph. Wait for the function to draw its standard part graphic.

Conclusion Using AutoCAD secondary development tool ObjectARX, through the ODBC database development interface, you can realize the connection between AutoCAD and external database, obtain the information of standard parts in the database, conveniently call the mechanical standard parts graphics, and greatly reduce the duplication of designers in mechanical design. Sexual labor.

HEX FLANGE BOLT

Hex Flange Bolt,Flange Head Screws,Flanged Button Head Screw,Flanged Hex Head Bolt

Shaoxing Grace International Trade Co.,Ltd , https://www.shaoxinggrace.com