Value interchange between the two softwares and their use in gear transmission


1 Introduction Gear transmission is the most commonly used transmission method in machinery. The design of gear transmission is also one of the most contacted design contents in mechanical design.
This paper introduces a software system that uses VisualBasic language to program and calculate the parameters of the gear transmission, and automatically generates the gear parts map through the object link and dynamic data exchange between VisualBasic and AutoCAD.
2 The design of the gear transmission tooth part design program inputs the original parameters required by the design through the TextBox control, ComboBox control and CommandButton control on the “Input Original Parameter” form. The parameters involved in the gear transmission design process are many, the original parameters are only Some of them, more parameters can not be determined before the design calculation, need to be based on the calculated intermediate results in the design process, by the chart in the relevant design manual is continuously introduced [1]. Such parameters can pop up the Dialog dialog box at any time. TextBox control, ComboBox control and other instant input, can also be built into the program code automatically selected by the program during the running process. After the program runs, the design calculation result is displayed by the MSFlexGrid control list in the "tooth design calculation result" form. If the result is not satisfactory, press the "redesign" button to redesign the calculation and adjust the parameter value of the intermediate input; Conversely, the design calculation results can be printed or saved and moved to the next stage of the design.
3 Gear structure design and graphics drawing program After the gear tooth part design is completed, the gear structure type is determined according to the diameter of the tip circle (automatically selected by the program), the relevant information is input, and the required structure type is judged by the program, and then Call the subroutine of the corresponding structure type design to determine the main structure, shape and size of the gear.
Using the link and data communication between VisualBasic and AutoCAD, according to the design calculation and structural design of the gear tooth part, use VisualBasic programming to automatically draw in the AutoCAD interface (the AutoCAD window is equivalent to a VB form control) Gear graphics and related annotations [2] (such as size, tolerance, roughness, gear parameter table, technical requirements, title bar, etc.). After the graphics are completed, if the results are not satisfactory, the design can be redesigned. Otherwise, the graphics can be printed or saved. The processing of some technical problems in the 4 program design is the same as the design of other mechanical parts. Many parameters such as structure and size are determined. All must conform to the standards or specifications of the mechanical design. The parameters calculated by the design need to be rounded to the standard value. The parameters to be introduced in the design should be determined by referring to the chart in the relevant manual. In order to make the design program run smoothly, the dialog box can be popped up at any time for parameters with strong discreteness or large selection range, and input by using TextBox, ComboBox and other controls; for the parameters with strong regularity or small selection range, the following methods can be used. The selection process is automatically completed by the program: (1) For some standard parameters with a small selection range (such as the gear modulus m, etc.), only the standard value can be selected, so the standard parameters are built into the program code and the program is automatically executed during the running process. Select by filtering as required. The following program code can be calculated by the intensity calculated m0 (non-standard value) rounded to the standard modulus m: Ifmomb (Imax) ThenMsgBox" modulus exceeds the maximum standard value, please modify the parameters to recalculate. "Frm input raw parameters. ShowUnloadMeExitSubEndIf' The modulo calculation value overflows when prompted to return to redesign.
ForI 0ToImax―1Ifmo>mb(I)Andmo< mb(I 1)Thenm mb(I 1)GoTo10EndIfNextI10(2) For some non-standard parameters with a small selection range (such as tooth profile coefficient, etc.), the parameters can be fitted to Approximate curve or polyline, the value is automatically selected by interpolation when the program is running. The following program code can determine the tooth profile Y by the equivalent tooth number Zv of the gear: IfZvZvo(Jmax)ThenY Yf(Jmax) (Yf(Jmax)Yf(Jmax-1))3(Zv?Zvo(Jmax))/_( Zvo(Jmax)Zvo(Jmax-1)) When GoTo20EndIf'Zv is larger than the maximum sample, it is extrapolated to the right.
IfZv>Zvo(J)AndZv< Zvo(J 1)Then' interpolated values.
Y Yf(J) (Yf(J 1)Yf(J))3(ZvZvo(J))/(Zvo(J 1)?Zvo(J))EndIf builds an XML document, traverses the structure, adds, modifies, and deletes content Wait. Therefore, DOMAPIs serve as a bridge between applications and XML documents.
(1) Import the MSXML header file and library in stdafx.h: #importusingnamespaceMSXML2; (2) Add the code to create the XML table in the method of the previous section: MSXML2: IXMLDOMDocumentPtrpDocNULL; / / initialize the COM object CoInitialize (NULL); / / Create DOMDocument object HRESULThr pDoc.CreateInstance(__uuidof(MSXML2:DOMDocument40)) (3) Write the obtained BOM information into XML, the steps are as follows: traverse BOM / / according to the position of each cell data is added to the column by column order The XML table is in the corresponding element node {Get the number of rows and columns of the BOM in each column {Get the column name; Create a new element node; Get the data of each row; Convert the data to XML format and add it to the element node; Add this element node to the previous child node; Example of function to write data and save XML data: pDoc->createElement(bstrName,pElement);pElement->put_text(bstrText);pNodeChild->appendChild(pElement);pDoc ->save(VARIANTdestination); 4 Conclusion Valve parts BOM contains important information about product design, through secondary development technology Improve the operating efficiency and will be widely used in actual production.

Brass Fitting-TMOK

Brass Fitting,Brass Pipe Fittings ,Compression Fitting ,Brass Pipe

Valves & Parts Co., Ltd. , http://www.nbfaucet.com