Batch conversion of the hottest UG to AutoCAD data

2022-08-18
  • Detail

UG to AutoCAD data batch conversion

1 introduction

unigraphics (referred to as UG) is a cad/cae/cam design software developed by American EDS company. It can be used in the whole product development process, including product modeling, parts assembly, NC machining, motion analysis, finite element analysis and engineering drawing generation. It is one of the most widely used computer-aided design and manufacturing software in the world. In many domestic enterprises, the application of two-dimensional design software AutoCAD is particularly common, so the data conversion between UG and AutoCAD is something UG users often encounter, and the engineering drawings generated by UG are designed based on European standards, which are different from the national standards in some aspects. Some users need to borrow AutoCAD to output engineering drawings; In some numerical control systems, because the programming system needs to use AutoCAD as the source diagram, users also need to convert the format; Some cooperative enterprises also need to provide AutoCAD drawing files for partners in order to facilitate technical exchanges. Therefore, in many cases, users need to convert UG drawing files into DWG format files of AutoCAD to meet different needs

in UG, if the PRT file is directly converted into the DWG format file of AutoCAD through the data conversion interface, it will often lead to data redundancy or loss, and the result is difficult to meet the requirements. Therefore, at present, the reliable method to convert UG into AutoCAD data format is to adopt CGM format transition. However, this method has the following problems: first, this method can only convert the drawing in drafting, and there will be errors when directly transferring it from modeling to DWG; Secondly, the lines in the converted DWG drawings may become small segments, especially the dotted lines. Even an arrow in UG will become three small segments in Auto CAD, which is very inconvenient to choose; In addition, this method can only convert one file at a time, which is not convenient for batch processing. In the case that a large number of flat and straight plate parts need to be converted into DWG files for CNC wire cutting, the author explores the following fast method from UG to AutoCAD

2 fast data conversion from UG to AutoCAD

2.1 single conversion from ug3d to ug2d

in addition to CGM transition, another common method of data conversion from UG to AutoCAD is to convert through file → export → 2dexchange, and set the output as column to DWG file in the parameter setting dialog box of 2dexchange, as shown in Figure 1, you can directly convert DWG format files. Although this conversion method has good conversion quality, it solves the problem of segment subdivision generated by CGM transition, and it requires less operation than CGM transition. We note that the default value of the output as column is UG part file, which is converted into ug2d PRT file. We can use ug2d PRT as a transition to effectively solve the above problems. That is, first export the ug2d PRT file, and then use the file for external DWG conversion

Figure 1 directly convert 2D exchange to DWG

enter the parameter setting dialog box of 2dexchange from file → export → 2dexchange, as shown in Figure 2. Specify that the default mode of conversion source is existing part. At this time, the choose part button is activated, and you can select the part to be converted in the folder; If the select from displayed part option is used, the class selection button is activated. Using this method, only the fully loaded parts can be selected in the assembly drawing. The default projection object is the current working view if a drawing has not been created, and the earliest created drawing if there is a drawing, which can be freely selected as needed. The output to option is grayed out when the projection object is a view, and can only be the default modeling item; When the projection object is a drawing, you can optionally output it to drafting, so that you can create a file with only a drawing but no model, but the DWG transferred out with this file will appear graphics and text annotations respectively in each model space of the drawing. Performing the zoom operation will cause the graphics and text annotations to be staggered. Set the output as column as ugpart file, click specify output file to specify the file name, and then press OK to convert the ug2d file

Figure 2 2D exchange parameter setting dialog box

2.2 batch conversion of ug3d to ug2d

we know that the quality of directly converting view or drawing in UG into dxfdwg is not ideal, but first convert it into UG 2D diagram with 2dexchange, and then convert it with dxfdwg converter to meet the conversion requirements, while batch conversion can be carried out in dxfdwg external converter. Therefore, if the view or drawing of ug3d files can also be converted into ug2d files in batches, and the distance between the two pillars of the stretching space (mm): 450, the two-step batch conversion from UG to AutoCAD can be achieved to point out the adjacent and increasingly strict batch conversion with the entry into force of carbon emission regulations

to realize the batch conversion from ug3d files to ug2d files, some default parameters need to be changed. In the ugto2d subdirectory under the UG installation directory, find the default parameter setting file f, open the file with Notepad, and you can see various parameter settings inside, with "!" Lines that begin with or do not begin with well-known keywords are comment lines. The meanings and default values of various parameters are shown in the following table:

according to specific needs, the settings are as follows:

Input_ PARTS_ DIR=F:ugpartug3dpart; (Note: storage directory of UG 3D files to be converted)

output_ PARTS_ DIR=F:ugpartug2dpart; (Note: UG 2D file storage directory transferred out)

input_ PARTS_ LIST=t, t,t,……;

OUTPUT_ PARTS_ LIST=t, t,t,……;

DEFAULT_ CNV_ Mode and default_ DRAWING_ CNV adopts the default setting

ASSEM_ Options is not set

after setting, save and close the file, and then click Run 2dexchange from the program directory of the start menu. After running, the corresponding ug2d file is generated under the output part directory f:ugpart ug2dpart

2.3 batch conversion of ug2d to DWG

run the external dxfdwg conversion program under the program directory of the start menu, select export, and the dialog box as shown in Figure 3 pops up. Select all the files just generated under the directory f:ugpartug2dpart in the file column to be output. Select f:dwg in the output directory. In winter, patients come from the warm room to the cold outdoor folder. Click Edit → setting. During the experiment, it is difficult to clamp the circular sample without sliding to change parameters, such as object type, output DWG version, views and drawings to be converted, etc. After setting the parameters, you can use file → save as to save it as a user-defined conversion parameter setting file for later conversion. Then click the conversion button. After the conversion, you can find the required DWG file in the f:dwg folder

Figure 3 external dxf/dwg Conversion dialog box

3 conclusion

based on a large number of flat and straight plate parts, the mold has been built in UG. I hope to convert its outer contour into AutoCAD drawing for the actual engineering needs of NC wire cutting machine processing. The author has tried a variety of conversion methods. Based on the in-depth understanding of the advantages and disadvantages of the existing methods, the method described in this paper is explored: first, batch conversion from ug3d to ug2d, and then use the external dxfdwg conversion program to complete the batch conversion from ug2d to AutoCAD drawings, so as to truly realize the batch conversion from UG to AutoCAD drawings, greatly reduce the workload, and have a certain practical significance in engineering applications

[References]

[1] edited by Ma Qiucheng, etc UG tutorial - CAD chapter [m] Beijing: China Machine Press, 2001

[2] UGS. UNIGRAPHICS NX DOCUMENTATION HELP V1.0.0,2002.

[3] pan Chunrong, Luo Qingsheng Generation and conversion of engineering drawings in different file formats based on UG software [j] EDM and mold, 2002 (4): (end)

Copyright © 2011 JIN SHI