Talking about the Automatic Writing and Writing of VBA Numerical Control in CAD

Applying VBA to generate NC code in AutoCAD Because VBA can be used to develop applications in AutoCAD, you can directly manipulate the data, methods, and properties of AutoCAD graphics entities, and you can use AutoCAD's powerful tools (such as view tools, selection tools, etc.). It is very convenient to generate NC code with VBA in AutoCAD. VBA's application for secondary development of Auto2 CAD has many differences with other automatic CNC programming software independent of AutoCAD environment. Parts in AutoCAD include all geometric information and size of parts, but for CAM process. The process of generating NC code, some geometric information (such as inner contours in wire cutting) and dimensioning are redundant. Since the VBA is used for secondary development of AutoCAD, the entire AutoCAD can be called as a subform or directly in the AutoCAD environment. To remove these extra entities (even if the part drawing becomes a simple part outline), of course Using the existing erase tool in AutoCAD, but in order to generate CNC code more professional and easier to use, you can use VBA to easily develop a reserve tool (delete unselected entities, retain selected entities), here mainly use AutoCAD ActiveX The selection set operation and the AcadEntity Erase method in the technology.

Judging the rationality of the contour involves a simple CAPP process. Any part contour map must be strictly judged, that is, whether it can be processed by the selected CNC machine and CNC system. There are many contents included here, such as judging whether there is inner contour and continuous contour in the wire cutting process. It is a simple example. Through practice, the author believes that in the process of generating NC code, the better method is to load the independent contour entity into a whole sequence. In the online cutting, the contour entity is kneaded into an AcadLW2 Polyline. For simple CNC machining, For example, wire cutting and CNC vehicles can judge the rationality of the contour when loading the contour sequence.

Easy to use external applications to make development work easier. Mathematical processing is essential in the process of generating NC code. At present, there are many good mathematical processing softwares that are powerful and easy to use. If they are well referenced in the process of generating NC code, the workload of development will be greatly reduced. When VBA is used for secondary development of Auto2 CAD, it is convenient to use the Microsoft Visual Basic development environment and other application software function library interfaces, so that other application software becomes an engineering sub-form equivalent to AutoCAD, and it is convenient. Communicate with each other. For example, when developing and generating CNC 3B code, the function library of MATLAB can be used to solve the problem of the loss calculation of the curve fitting in one step, and avoid using the chasing method to calculate the loss.

The method of discretization of the arc when the tool moves in a circular arc in NC machining. Since the Object More method can only achieve point-to-point movement, that is, the coordinates of the start point and the end point are required, and because the arc in AutoCAD only gives the value of the geometric element, it cannot be given by the equation, so the discretization process uses the pole. The coordinates are better, that is, the polar angle is used as a parameter to discretize. The processing method when the relative speed of the workpiece and the tool is large.

(Finish)

High Performance Butterfly Valve

RF Flanged High Performance Butterfly Valve,Cast Steel High Performance Butterfly Valve,CF3m High Performance Butterfly Valve

Fengshen Refrigeration Controls Co., Ltd. , http://www.shaivalve.com