Abstract This paper presents a graphical automatic programming system for CNC wire cutting 3B code processing, developed on the AutoCAD platform. The system utilizes AutoLisp to extract group code data from graphic entities and convert it into 3B instructions. Practical applications have demonstrated that the method is intuitive, accurate, efficient, and user-friendly. A CNC wire-cutting machine is a device that uses a moving molybdenum wire to perform electrical discharge machining (EDM) on metal materials. Over the years, numerous series of wire-cutting machines have been developed globally, with their corresponding processing instructions following international standards such as ISO and EIA. In China, domestic wire-cutting machines are widely used due to their low cost, ease of maintenance, high reliability, and the availability of skilled operators. However, these machines typically use the 3B format for processing instructions. While general-purpose CAD/CAM software like UGII or MasterCAM can generate codes compliant with ISO and EIA standards, they are not capable of generating 3B format codes. Given the widespread use of AutoCAD in the Chinese manufacturing industry, this paper introduces a 3B instruction-based graphical automatic programming system developed on the AutoCAD platform. It leverages AutoLisp to read entity group codes and transform them into 3B processing codes. Field testing has shown that the system is accurate, practical, and highly efficient. 1 Principle 1.1 3B Instruction Code Format: B XY B YY B J G Z 1.2 AutoCAD Entity Selection Sets and Group Codes Figure 1: Counting Direction Selection (Left: Straight Line, Right: Arc) Figure 2: Machining Instruction Schematic (Left: Straight Line, Right: Arc) The following is a sample of entity group code: (-1.<Entity name: 60000014>) Table: Part Code Group Code | Description 8 | Layer Name 10 | Starting Point Coordinate 11 | End Point Coordinate 40 | Radius 50 | Start Angle 51 | End Angle 210 | Extension Direction 2 Programming Method The program begins by using the getfiled() function to create an NC file with a .3B extension. Then, it employs the ssget() function to define a selection set of entities, based on the user’s input according to the processing sequence. These entities are then categorized into two types: Line and Arc. It was observed that for AutoCAD version 12.0, complex entities like polylines or splines are broken down into basic line and arc segments. Therefore, the core of the program revolves around handling these two types of entities. The program loops through each entity, determining whether it is a line or an arc. Once identified, the relevant geometric data is extracted using the appropriate group codes. A string in the format "B XX B YY BJGZ" is created and added to the NC file. This process continues until all entities are processed. For straight lines, the start and end coordinates are obtained using group codes 10 and 11. The origin is then shifted to the starting point, and the values of XX and YY represent the end point coordinates. The projection length J is calculated based on the larger of the absolute values of XX and YY, determining the counting direction (Gx or Gy). For arcs, the center, radius, start angle, and end angle are retrieved using group codes 10, 40, 50, and 51. Calculating the projection length J for arcs involves three distinct cases, depending on the position of the arc relative to the counting direction. For instance, if the origin is moved to the start point, J is calculated as the absolute difference between the start and end points. If the arc spans across both directions, J is the sum of the projections along both axes plus any additional distance. Regarding the machining direction of arcs (clockwise or counterclockwise), since AutoCAD defines all arcs in a counterclockwise manner, the program compares the last entity’s endpoint with the current arc’s start point. If they match, the arc is considered counterclockwise; otherwise, it is clockwise, and the start and end points are swapped accordingly. Figure 3: Calculation of Arc Projection Length J (G=Gx on the left, G=Gy on the right) 3 Conclusion Practical implementation has confirmed that the method described in this paper for generating 3B code is simple, fast, accurate, and reliable. It significantly reduces the workload of numerical control programmers and simplifies the process of creating 3B code. The system effectively enables graphical automatic programming for 3B processing, demonstrating strong practical value and efficiency. Industrial Agitator,Industrial Stirrer,Industrial Agitator Mixer,Industrial Mixers And Agitators wuxi top mixer equipment co.,ltd , https://www.wxtpmixer.com
Keywords: Graphic, Solid Line, Cutting, Entity Code
Where "B" is a delimiter. XY and YY represent coordinates depending on the type of operation. For straight lines, they indicate the end point coordinate relative to the start point. For arcs, they refer to the starting point coordinate relative to the center. G indicates the counting direction, which can be X or Y (Gx or Gy). J represents the projected length of the path in the counting direction. Z denotes the specific machining instruction, with 12 different types available.
In AutoCAD, each graphic element is treated as an individual entity. The ssget() function allows users to create custom selection sets. Each entity's properties can be accessed via its group codes. For example, group code -1 refers to the entity name, while group code 0 defines the entity type, such as Line, Arc, or Pline. Other group codes provide additional geometric information like coordinates, radius, and angles.
(0."LINE")
(8."0")
(10 1.0 2.0 0.0)
(11 6.0 6.0 0.0)
Graphical automatic programming of CNC wire cutting 3B machining instructions