1. introduction
In the tool design, especially the design of the complex tool, in order to reduce the design workload, shorten the design cycle, improve the design accuracy, the use of CAD technology is a top priority. Based on the general tool CAD technology, this paper presents a CAD method that is suitable for the multi-parameter design of complex tool and develops the corresponding CAD software. For the same type of complex tool with different structure size, as long as the known parameters are input, it is not necessary to re-program and calculate, the tool structure and size can be automatically calculated according to the user's requirements, and the tool design structure drawing is drawn. The biggest advantage of this software is its versatility. Compared with interactive graphics software, it can greatly shorten the design cycle, improve the design accuracy, and reduce the design error between similar products. The worm gear hob parameter design is taken as an example to introduce the overall structure, function design and data communication of the software.
2. The overall structure of the worm gear hob parameter design software
This software adopts the structural design method, first uses the Foxbase+ database to carry on the window design and the data inquiry, the retrieval; Then uses the VC++ language to carry on the parameter computation; Finally calls the drawing program which the intelligent parameter drawing language Autolisp compiles to carry on the hob work drawing. The software execution block diagram is shown in the figure below.
Software execution diagram
3. Window design and data retrieval
The menu design of this software and the query of the number table all use Foxbase+ language, Foxbase+ can realize the operation such as setting up the database and data inquiry, and can realize the data operation in the data file through the procedure. Therefore, many look-up tasks when designing a worm gear hob are done by Foxbase+. In addition, Foxbase+ also features concise menu design features. The software uses @X,Y SAY "..."statements for menu design, its advantages are: positioning statements with @...... SAY can be set anywhere on the screen menu of any size, do not have to add spaces in the absence of display information frequently Character, so it has some flexibility. And this statement can make full use of the color features provided by the hardware environment to make the menu beautiful and eye-catching. Examples of program statements are as follows @5,12 say “... worm wheel hob menu selection...â€
@7,12 prompt "1. Archimedes Worm Hob"
@9,12 prompt "2. Cogging normal worm gear hob"
@11,12 prompt "3.ZC1 Circular Cylindrical Worm Hob"
@12,13 prompt "4. Exit"
4. Data communication between Foxbase+ and VC++
The calculation of hob structural parameters in this software uses VC++ language, and the data communication between Foxbase+ and high-level language is realized by means of data files.
Foxbase+'s COPY TO command converts database files to data files (text files with *.TXT extensions) that high-level language programs can accept, while the APPEND FROM command transfers high-level language data files to database files. To complete the data communication between Foxbase+ and high-level languages.
5. Data communication between Foxbase+ and Autolisp
In computer-aided design, data information and graphics information are closely related. After using the Foxbase+ menu design table to query, call VC++ program to calculate the hob design parameters, you need to transfer these data information to the Autolisp program for parameter mapping.
Autolisp language is an intelligent design language embedded in AutoCAD content. It is a powerful tool for secondary development of AutoCAD. The language runs in AutoCAD environment and can directly call AutoCAD drawing commands.
In this software design, Autolisp's input/output (I/O) function is used to achieve data communication with Foxbase+. In Autolisp's I/O function, Read-line can read data from an ASCII text file, one row at a time, each row as a processing unit. The final calculation results of hob design structure parameters are stored in a text file (*.TXT) using Foxbase+ language, and then called by the Autolisp interface program to read the data in the text file (*.TXT) for parameter drawing.
For example: read the coordinates of the two ends of the line Pt1, Pt2 draw the line Pt1Pt2, the program is as follows:
(setq f(open "name1.txt" "r"))
(setq kk(read line f))
(setq b "("c")")
(setq mm(strcat b kk c))
(setq nn(read mm))
(setq pp(car nn))
(if (=pp 1)(setq ptl(list (nth 1nn)(nth 2nn))))
(setq pt2(list(nth 3 nn)(nth 4 nn)))
(command "line" pt1 pt2)
(command nil)
6. Conclusion
This software uses Foxbase+ to generate screen menus that are intuitive and concise. Foxbase+'s database management function facilitates the storage of the items required for tool design and allows for locating and searching. In order to overcome the weakness of Foxbase+ computing power, VC++ is used to calculate the tool structure parameters, and the interface program is used to realize the data communication between the two languages.
After the tool structure parameters are determined, by calling the preprogrammed Autolisp parameter drawing program, the worm wheel hob work diagram can be drawn out conveniently and quickly, eliminating the need for an arduous process of interactive drawing.
The software programming method is also suitable for CAD of other types of tools.