File format conversion method and device, computer equipment and storage medium
By extracting and converting parts and text information in gen format files exported by Tribon software, generating dxf or dwg format files suitable for other nesting software, the problem of inefficiency in nesting in the shipbuilding industry is solved, and the implementation of the implementation of the inefficiency of nesting in the Tribon software is achieved. File formats cross-software compatibility, improve productivity and reduce costs.
Patent Information
- Application Number
- CN202411439051.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-03
AI Technical Summary
Due to the lack of automatic file format conversion function of Tribon software, the exported gen format files cannot be recognized by other nesting software, resulting in designers' inefficiency in nesting in the shipbuilding industry.
Provide a file format conversion method and device, by reading folder information, extracting parts and text information, and generating target files based on this information, such as dxf or dwg format, supports selecting the target file format and whether it contains line information, and generates Thumbnails for inspection.
The batch conversion of part files exported by Tribon software into a general CAD software format is realized, which improves the efficiency of nesting work, shortens production time, and saves costs, providing more flexible nesting software selection.
Smart Images

Figure CN119250022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of file format conversion, and in particular to a file format conversion method, device, computer equipment and storage medium. Background Art
[0002] With the development of shipping, ships have become larger and more specialized, and shipbuilding technology has developed rapidly. Shipbuilding has become one of the most important heavy industries in the world. Ships are made up of thousands of parts, which are related to almost every industrial sector. In addition to the unique hull construction technology, shipbuilding also involves various fields such as machinery, electricity, metallurgy, construction, chemistry and even arts and crafts. Therefore, shipbuilding is a comprehensive technology based on all industrial technologies, reflecting the industrial technology level of a country.
[0003] Due to the different navigation areas, missions and requirements of ships, ship products have the characteristics of many varieties and small production batches. In order to produce rhythmically and shorten the manufacturing cycle, the shipyard must have careful production management and technical management from accepting orders to completing and delivering the ship. Generally speaking, after receiving an order, the shipyard needs to design the hull according to the requirements and draw model drawings. After confirming that there are no errors, the actual processing will begin.
[0004] In the hull production design work, many shipyards use Tribon software for modeling and drawing. At the same time, in order to save costs and improve material utilization, it is also necessary to nest ship parts. However, since Tribon's own nesting software lacks some automated functions, it is inefficient compared to other nesting software and has many inconveniences in use. Therefore, when designers use Tribon software for drawing, they mostly use other nesting software to cooperate with each other to complete the work of modeling, drawing and nesting.
[0005] Due to the differences in programming between different software, many nesting software cannot recognize the gen format files of parts exported by Tribon, but can recognize the exchange file formats of the current common CAD software, such as dxf and dwg. However, Tribon software does not have the function of automatically converting gen format files to dxf and other formats, so a file format conversion method is needed to solve this problem. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a file format conversion method, device, computer equipment and storage medium, which solves the problem in the prior art that different software use different file formats, resulting in difficulty in using nesting software with mapping software.
[0007] In a first aspect, the present invention provides a file format conversion method, comprising:
[0008] Read the folder information to obtain all the files to be converted in a specific format;
[0009] Select all files to be converted, and extract part information and text information related to the parts in the files;
[0010] Regenerate the target file in the required specific format in the original folder according to the part information and text information.
[0011] Preferably, the part information includes the coordinates of the lines of the part shape and the colors of the lines.
[0012] Preferably, the text information includes the content of the part attribute text, the color of the text, and the coordinate points of the text.
[0013] Furthermore, before regenerating the target file of the required specific format, the format of the generated target file can be selected, and it can be selected whether the generated part has line information on the part.
[0014] Furthermore, after the target files are generated, thumbnails of each target file are generated at the same time, and the corresponding thumbnails can be viewed by selecting each target file.
[0015] In a second aspect, the present invention provides a file format conversion device, comprising:
[0016] The file acquisition module is used to select a folder and obtain all the files to be converted in a specific format in the folder;
[0017] An information extraction module is used to extract part information and text information related to the part from each file to be converted;
[0018] The file generation module is used to generate target files in a required specific format using the extracted part information and text information of the file to be converted, and store all the generated target files in the original folder.
[0019] Furthermore, before generating the target file according to the part information and text information of the file to be converted, the file generating module first selects the target file format to be generated, and simultaneously selects whether the line information of the part is required to be attached.
[0020] Furthermore, it also includes a thumbnail generation module, which is used in conjunction with the file generation module to display thumbnails corresponding to the generated target files.
[0021] In a third aspect, the present invention proposes a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the various steps in the above-mentioned file format conversion method when executing the computer program.
[0022] In a fourth aspect, the present invention proposes a readable storage medium having a computer program stored thereon, wherein the computer program implements the steps in the above-mentioned file format conversion method when executed by a processor.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The present invention can batch convert the output file format of one software into another file format, thereby providing a basis for the coordinated use of different software. Especially in the shipbuilding industry, the gen format files of the parts exported by the Tribon software used for drawing modeling can be converted into dxf, dwg and other formats corresponding to the CAD software, so that other automatic nesting software can use the part files after the format conversion to perform nesting work, which solves the problem of low efficiency of the Tribon software in nesting, greatly shortens the nesting time, and enables the nesting work to be completed by selecting more nesting software, thereby reasonably selecting a high-efficiency, low-cost nesting solution, and also saving production costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The figure is a flowchart of a file format conversion method according to an embodiment of the present invention.
[0026] Figure 2 Schematic diagram of the interface of the software used in the embodiment of the present invention.
[0027] Figure 3 Schematic diagram of the file selection interface of the software used in the embodiment of the present invention.
[0028] Figure 4 It is a schematic diagram of the software used in the embodiment of the present invention before running.
[0029] Figure 5 It is a schematic diagram of the software used in the embodiment of the present invention after the software is finished running.
[0030] Figure 6 It is a schematic diagram of thumbnail preview after the software used in the embodiment of the present invention is finished.
[0031] Figure 7 Schematic diagram of the structure of a file format conversion device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be noted that the embodiments described below are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0033] In the embodiment of the present invention, Figure 1 As shown, the present invention proposes a file format conversion method, which specifically includes the following steps:
[0034] Step S101: Read the folder information to obtain all the files to be converted in a specific format.
[0035] In this embodiment, the technical purpose is to convert the gen format files of the parts exported by the Tribon software into dxf, dwg and other formats corresponding to the CAD software. The gen format files of the parts exported by the Tribon software are stored in a folder.
[0036] Specifically, based on the Visual Studio development platform, a Windows desktop application software is written in the computer language C# to implement the conversion work required by this embodiment. The working interface of the software is as follows: Figure 2 There is a folder selection button on the left, click the mouse to select the storage path of the part drawing, such as Figure 3 As shown, select the folder where the gen format part files are stored, and then the software automatically imports all gen format files in the folder and displays a list of these gen format files in the window below.
[0037] Step S102: Select all files to be converted, and extract part information and text information related to the parts in the files.
[0038] For the selected gen format file, a setting dialog box is created for each file. The user can obtain the target part object in the gen format file according to the information he needs, and obtain the part information and related text information in the target part object. The part information includes the coordinates of the lines of the part shape and the color of the lines; the text information includes the content of the part attribute text, the color of the text, the coordinate points of the text, etc. After the program runs, the gen format file selected by the user is read, and these file names and paths are stored in a text array. After the program starts running, each file is opened in turn, and the part information and text information data in each file read are stored in the memory. After reading a file, it is closed.
[0039] Step S103: Regenerate the target file in the required specific format in the original folder according to the part information and text information.
[0040] It should be noted that before regenerating the target file in the required specific format, the target file format to be generated can be selected, and in this embodiment, the dxf format or the dwg format can be selected. It can also be selected whether the generated part has the line information on the part.
[0041] In this embodiment, after obtaining the part information and text information, the third-party library Teigha is used to generate a dxf format or dwg format file. The third-party library Teigha reads each set of part information and text information in the memory in turn, and then generates it into a file in the required format and stores it in the original folder.
[0042] like Figure 4 , Figure 5 As shown in the figure, after importing all the gen format files, check and confirm that they are correct, and select the required target file format and whether line information is required, you can click the start button to start the format conversion, and observe the progress of the check according to the progress bar. There is a display window for the files after format conversion on the right side of the list display window of the gen format files. The part files after format conversion are displayed in the form of a list in this window, so that users can observe whether their quantity and name correspond to the original gen format files. After use, click the quit button to exit the software.
[0043] like Figure 6 As shown, in this embodiment, the generated dxf or dwg target files will be displayed in a listbox list control, and the third-party control ddvue.ocx will form a thumbnail of each target file to check whether there is an error in the shape of the part. There is a thumbnail display window on the far right of the software interface, and each target file can be selected to observe its corresponding thumbnail.
[0044] In another embodiment of the present invention, Figure 7 As shown, a file format conversion device is proposed, comprising:
[0045] The file acquisition module is used to select a folder and obtain all the files to be converted in a specific format in the folder; further, before generating the target file based on the part information and text information of the file to be converted, the file generation module first selects the target file format to be generated, and at the same time selects whether the line information of the part is required.
[0046] An information extraction module is used to extract part information and text information related to the part from each file to be converted;
[0047] The file generation module is used to generate target files in a required specific format using the extracted part information and text information of the file to be converted, and store all the generated target files in the original folder.
[0048] Furthermore, it also includes a thumbnail generation module, which is used in conjunction with the file generation module to display thumbnails corresponding to the generated target files.
[0049] In another embodiment of the present invention, a computer device is proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: reading folder information to obtain all files to be converted in gen format; selecting all files to be converted in gen format, extracting part information and text information related to the parts in the files; and regenerating a target file in dxf or dwg format in the original folder based on the part information and text information.
[0050] In another embodiment of the present invention, a readable storage medium is proposed, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: reading folder information to obtain all files to be converted in gen format; selecting all files to be converted in gen format, extracting part information and text information related to the parts in the files; and regenerating a target file in dxf or dwg format in the original folder based on the part information and text information.
[0051] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0052] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A file format conversion method, characterized in that: include: Read the folder information to obtain all the files to be converted in a specific format; Select all files to be converted, and extract part information and text information related to the parts in the files; Regenerate the target file in the required specific format in the original folder according to the part information and text information.
2. The file format according to claim 1, wherein: The part information includes the coordinates of the lines of the part's outline and the colors of the lines.
3. The file format conversion method according to claim 1, wherein: The text information includes the content of the part attribute text, the color of the text, and the coordinate points of the text.
4. The file format conversion method according to claim 1, wherein: Before regenerating the target file in the required specific format, you can select the target file format to be generated, and you can choose whether the generated part has the line information on the part.
5. The file format conversion method according to claim 1, wherein: After the target files are generated, thumbnails of each target file are generated at the same time. Select each target file to view its corresponding thumbnail.
6. A file format conversion device, characterized in that: include: The file acquisition module is used to select a folder and obtain all the files to be converted in a specific format in the folder; An information extraction module is used to extract part information and text information related to the part from each file to be converted; The file generation module is used to generate target files in a required specific format using the extracted part information and text information of the file to be converted, and store all the generated target files in the original folder.
7. The file format conversion device according to claim 6, characterized in that: Before generating the target file according to the part information and text information of the file to be converted, the file generating module first selects the target file format to be generated, and simultaneously selects whether the line information of the part is required to be attached.
8. The file format conversion device according to claim 6, characterized in that: It also includes a thumbnail generation module, which is used in conjunction with the file generation module to display thumbnails corresponding to the generated target files.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Optimization view angle based ship production design drawing-inspection device implementation method
CN105718643A
File analysis method and device and computer readable medium
CN115729887A
File format converter and conversion method thereof
JP2018036972A
