Batch conversion of UG to AutoCAD data

1 Introduction

Unigraphics (abbreviated as UG) is a CAD/CAE/CAM design software developed by the United States EDS company. It can be used in the entire product development process, including product modeling, component assembly, numerical control processing, motion analysis, finite element Analysis and engineering drawing generation, etc. It is one of the most widely used computer-aided design and auxiliary manufacturing software in the world. In many domestic enterprises, the AutoCAD application of two-dimensional design software is especially common. Therefore, the data conversion between UG and AutoCAD is often encountered by UG users, and the engineering drawings generated by UG are based on European standards. In some aspects, they are related to national standards. There are some discrepancies, some users need to borrow AutoCAD output engineering drawings; In some CNC systems, because with the programming system needs to use AutoCAD as a source map, the user also needs to carry out the format conversion; some collaborative enterprises, in order to facilitate the technical exchange , also need to provide AutoCAD graphics files for partners. Therefore, in many cases, users need to convert UG graphics files into AutoCAD DWG format files to meet different needs.

In UG, if you convert a prt file directly into a AutoCAD DWG file through a data conversion interface, it often results in data redundancy or loss, and the result is difficult to meet. Therefore, the current reliable method for converting UG to AutoCAD data format is to use the CGM format transition. However, this method has the following problems: First of all, this method can only make mistakes when converting Drawings inside Drafting, directly transferring from Modeling to DWG, and secondly, the lines in the converted DWG drawings may become one. This is particularly true for small segments, and even an arrow in UG will turn into three small segments in Auto CAD. It is extremely inconvenient to select editors. In addition, this method can only convert one file at a time during conversion, which is not convenient for batch production. deal with. The author in the need to convert a large number of flat board parts into DWG files for CNC wire cutting, explored the following from UG to AutoCAD rapid method.

2 UG to AutoCAD Fast Data Conversion

2.1 Single Conversion from UG3D to UG2D

In addition to the CGM transition, another common method for converting data from UG to AutoCAD is through File→Export→2DExchange. In the 2DExchange parameter setting dialog, set the Output As column to DWG File, as shown in Figure 1. , you can directly convert the DWG format file. Although this conversion method is of good quality, it solves the problem of line segmentation caused by CGM transition and is one step less than CGM transition. We noticed that the default value of the Output As column is UG Part File, which is converted to UG2D prt file. We can use UG2D prt as a transition to effectively solve the above problem. That is, export the UG2D prt file first, then use this file for external DWG conversion.

Figure 1 Direct 2D Exchange to DWG

From File→Export→2DExchange, enter the parameter setting dialog of 2DExchange, as shown in Figure 2. Specifying the conversion source defaults to Existing Part. The Choose Part button is active. You can select the components to be converted in the folder. If you use the select from Displayed Part option, the Class Selection button is activated. Use this method in the assembly drawing. You can only select components that have been fully loaded. The default projection object is the current work view if no drawing has been created, and the earliest created drawing in the case of a drawing, and can be freely selected as needed. The Output To option is grayed out when the projection object is a view. It can only be the default Modeling item; when the projection object is a drawing, it can be optionally output to Drafting. This can create a file with only the drawing and no model, but then use the The DWG that the file is exported will appear with graphics and text labels, etc. In the model space of the drawings, performing zoom operation will cause the graphics and text labels to be staggered. Set Output As column to UGPart File, then click Specify Output File to specify the file name and press OK to convert the UG2D file.

Figure 2 2D Exchange Parameter Settings Dialog Box

2.2 Mass Conversion of UG3D to UG2D Conversion

We know that it is very unsatisfactory to directly transfer View or Drawing from UG to DXFDWG, but first convert it to 2D map with 2D Exchange, and then convert it with DXFDWG converter to achieve the conversion requirement. The DXFDWG external converter is capable of batch conversion. Therefore, if the View or Drawing of the UG3D file can also be batch converted into an UG2D file, the batch conversion from the UG to the AutoCAD can be achieved through batch conversion in two steps.

To implement batch conversion of UG3D files to UG2D files, some default parameters need to be changed. In the UG installation directory under the UGTO2D subdirectory, find the default parameter settings file ugto2d.def, use Notepad to open the file, you can see the various parameter settings inside, beginning with "!" or not known keywords The lines at the beginning are comment lines. The meanings and default values ​​of each parameter are shown in the following table:

According to specific needs, set the following:

INPUT_PARTS_DIR=F:\ugpart\ug3dpart; (Note: The UG three-dimensional file storage directory to be converted)
OUTPUT_PARTS_DIR=F:\ugpart\ug2dpart; (note: transferred out of the UG two-dimensional file storage directory)
INPUT_PARTS_LIST=0204M01.prt, 0204M02.prt,0204M03.prt,......;
OUTPUT_PARTS_LIST=0204M01.prt, 0204M02.prt,0204M03.prt,......;
DEFAULT_CNV_MODE and DEFAULT_DRAWING_CNV have default settings;
ASSEM_OPTIONS is not set.

After setting, save and close the file, and then click Run 2Dexchange from the Start menu under the program directory. After the operation is complete, the corresponding UG2D file is generated in the output part directory F:\ugpart\ug2dpart.

2.3 Batch Conversion of UG2D to DWG

Run the external DXFDWG conversion program from the program directory of the Start menu, select export, and the dialog box shown in Figure 3 will pop up. In the file to be exported, select all the files that have just been generated in the F:\ugpart\ug2dpart directory. Select the F:\dwg folder in the output directory and click Edit→Setting to set the conversion parameters, such as the object type, the output DWG version, and the file to be converted. Views, drawings, and more. Parameter settings can be saved as a user-defined conversion parameter setting file using File→Save As for later conversion. Then click the Convert button. After the conversion is completed, the required DWG file can be found in the F:\dwg folder.

Figure 3 External DXF/DWG Conversion Dialog

3 Conclusion

Based on the fact that high-volume flat-plate parts have been built in UG, and we hope to convert the outer contour to AutoCAD drawings for the actual engineering needs of CNC wire-cutting machine tool processing, the author tried various conversion methods. Based on an in-depth understanding of the advantages and disadvantages of the existing methods, the method described in this article was explored: that is, batch conversion from UG3D to UG2D, and then the external DXFDWG conversion program was used to complete the batch conversion from UG2D to AUTOCAD, thus realizing UG to The large-scale conversion of AutoCAD drawings greatly reduces the workload and has certain practical significance in engineering applications.

Handheld Fiber Laser Welding Machine

Handheld Fiber Laser Welding Machine,HandHeld Laser Welding Machine,HandHeld Fiber Laser Welder,Laser Handheld Welding Machine

Feiquan Laser Technology Wuxi Co., Ltd. , https://www.fq-laser.com