CAD (computer-aided design) quick translation and typesetting method and system based on professional knowledge base

By integrating a translation plug-in based on a professional knowledge base in the CAD system, the problem of the lack of multilingual translation and layout functions of existing CAD software is solved, and efficient translation and automatic layout of text in CAD is achieved, improving work efficiency and translation accuracy.

CN119578395APending Publication Date: 2025-03-07POWERCHINA FUJIAN ELECTRIC POWER SURVEY & DESIGN INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411553358.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The lack of built-in multilingual translation and typography capabilities of existing CAD software has led to the need for manual translation and adjustments, which consumes a lot of time and effort, especially when dealing with large-scale text.

Method used

Using the CAD fast translation and layout method based on the professional knowledge base, we use the custom professional thesaurus and machine translation API interface, combined with the coordinate sorting algorithm and a custom output layout format panel, and integrate it into the translation plug-in to directly translate and automatically type in the CAD system.

Benefits of technology

It realizes efficient translation and automatic layout of text in CAD, significantly reduces user workload, improves work efficiency, ensures the accuracy of translation and the neatness of drawings, and adapts to the needs of the global market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578395A_ABST
    Figure CN119578395A_ABST
Patent Text Reader

Abstract

The invention relates to a CAD (computer-aided design) quick translation and typesetting method and system based on a professional knowledge base, and the method comprises the following specific steps: building a self-defined professional lexicon and an API (application program interface) for machine translation, and connecting the API with external machine translation software to form an automatically matched professional knowledge base in a translation process; a user-defined parameter panel is set, selection, translation modes and translation content types of a source language and a target language are included, and the translation modes comprise word and sentence translation and paragraph translation; aiming at the text segment translation mode, splicing multiple lines of characters in the initial text by adopting a coordinate sorting algorithm; setting a self-defined output typesetting format panel which comprises font styles, font sizes, font spacing and the distance between newly-added translated characters and the original text; a professional knowledge base, a self-defined parameter panel and a self-defined output typesetting format panel are integrated in a translation plug-in, and then the translation plug-in is integrated with a CAD system, so that rapid text translation typesetting can be performed by using CAD.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer-aided design, and in particular to a CAD rapid translation and typesetting method and system based on a professional knowledge base. Background Art

[0002] With the deepening of globalization, computer-aided design (CAD) is widely used in all walks of life, especially in engineering, construction and manufacturing. CAD drawings usually contain a lot of text information, and there is an increasing demand for cross-border cooperation projects involving different languages. However, existing CAD software lacks built-in multilingual translation and typesetting functions, and users need to translate and adjust manually, which takes a lot of time and effort, especially when large-scale text needs to be processed.

[0003] In order to meet this challenge, the present invention proposes a CAD rapid translation and typesetting method based on a professional knowledge base, which combines machine translation with a professional vocabulary, supports efficient translation and automatic typesetting of texts in CAD, greatly simplifies the user's translation and typesetting process in CAD software, and improves work efficiency.

[0004] In the prior art CN118607538A, a multi-language machine translation method for DWG drawings is disclosed, which includes the following steps: a user uploads a DWG source file to be translated to a website interface; the background identifies and parses the DWG elements in the DWG source file, and excludes non-translatable characters to obtain text elements; based on coordinate positions and natural language processing-related algorithms, the text elements are merged into a whole paragraph to obtain a translated text; the text of the translated text is put into a translation engine for parsing and translation, the translation results are backfilled into the text elements to replace the DWG source file, and the translation results are output.

[0005] In the prior art, the text information in the source file is integrated into a whole paragraph, and then translated by a translation engine. It is difficult to ensure the accuracy of the translation during the translation by an external translation engine. At the same time, a prerequisite of the prior art is that the DWG source file needs to be transferred to the website interface and then subsequent operations are performed. This is far less efficient than directly translating and typesetting in the CAD system. Summary of the invention

[0006] In order to solve the above problems existing in the prior art, the present invention proposes a CAD rapid translation and typesetting method and system based on a professional knowledge base.

[0007] The technical solution of the present invention is as follows:

[0008] On the one hand, the present invention proposes a CAD rapid translation typesetting method based on a professional knowledge base, and the specific steps include:

[0009] Build a custom professional vocabulary and machine translation API interface, which is connected to external machine translation software to form a professional knowledge base that is automatically matched during the translation process;

[0010] Setting a customized parameter panel, including source language and target language selection, translation mode, and translation content type. The translation mode includes word-sentence translation and text-segment translation;

[0011] For the paragraph translation mode, a coordinate sorting algorithm is used to splice multiple lines of text in the initial text;

[0012] Set up a custom output layout format panel, including font style, font size, font spacing, and the distance between the newly added translated text and the original text;

[0013] By integrating the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrating the translation plug-in with the CAD system, you can use CAD for fast text translation and typesetting.

[0014] As a preferred implementation, the word and sentence translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing, and the added position is automatically added downward according to the added line spacing.

[0015] As a preferred implementation, during the translation process, the initial text is first translated using an internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through an API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

[0016] As a preferred implementation, the text translation sorting algorithm is specifically as follows:

[0017] Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

[0018] On the other hand, the present invention provides a CAD rapid translation and typesetting system based on a professional knowledge base, comprising:

[0019] A professional knowledge base building module builds a custom professional vocabulary and a machine translation API interface, which is connected to an external machine translation software to form a professional knowledge base that is automatically matched during the translation process;

[0020] A panel parameter setting module is used to set a customized parameter panel, including the selection of source language and target language, translation mode, and translation content type. The translation mode includes word translation and text translation.

[0021] The text translation sorting module uses a coordinate sorting algorithm to splice multiple lines of text in the initial text according to the text translation mode;

[0022] Typesetting format setting module, set the customized output typesetting format panel, including font style, font size, font spacing and the distance of the newly added translated text relative to the original text;

[0023] The translation plug-in integration module integrates the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrates the translation plug-in with the CAD system, so that CAD can be used for rapid text translation and typesetting.

[0024] As a preferred implementation, the word and sentence translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing, and the added position is automatically added downward according to the added line spacing.

[0025] As a preferred implementation, during the translation process, the initial text is first translated using an internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through an API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

[0026] As a preferred implementation, the text translation sorting algorithm is specifically as follows:

[0027] Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

[0028] On the other hand, the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a CAD rapid translation and typesetting method based on a professional knowledge base as described in any embodiment of the present invention is implemented.

[0029] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a CAD rapid translation and typesetting method based on a professional knowledge base as described in any embodiment of the present invention.

[0030] The present invention has the following beneficial effects:

[0031] 1. The present invention uses automatic translation and typesetting functions, so users do not need to perform manual operations, thereby reducing the workload of translation and typesetting and significantly saving time costs in the project cycle.

[0032] 2. With the support of professional vocabulary, the present invention enables users to maintain consistency in terminology translation in different projects, avoiding duplication of work and improving translation accuracy, especially in the processing of technical terms and proprietary vocabulary.

[0033] 3. The present invention is based on the fact that traditional translation and typesetting methods are prone to human errors, especially when processing large-scale texts. The automated process reduces the steps of manual adjustment, thereby reducing the chance of errors.

[0034] 4. The translated text in the present invention can automatically adapt to the typesetting requirements in the drawings, ensuring the neatness and beauty of the drawings, reducing subsequent typesetting adjustment work, and improving the professionalism and overall quality of the project.

[0035] 5. The present invention supports multi-language translation, especially the conversion between Chinese and English, so that CAD drawings can better adapt to the needs of the global market and enhance the competitiveness in international projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the steps of the present invention;

[0037] Figure 2 It is a schematic diagram of the translation result of the present invention;

[0038] Figure 3 It is a schematic diagram of the layout of the present invention;

[0039] Figure 4 This is a schematic diagram of the structure of the setting panel;

[0040] Figure 5 This is a schematic diagram of the setting interface options;

[0041] Figure 6 This is a schematic diagram of the style of the translation result;

[0042] Figure 7 This is a schematic diagram of the editing operation of a professional vocabulary. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.

[0045] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0046] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0047] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.

[0048] Embodiment 1:

[0049] See also Figure 1 , a CAD rapid translation typesetting method based on a professional knowledge base, the specific steps include:

[0050] Build a custom professional vocabulary and machine translation API interface, which is connected to external machine translation software to form a professional knowledge base that is automatically matched during the translation process;

[0051] Setting a customized parameter panel, including source language and target language selection, translation mode, and translation content type. The translation mode includes word-sentence translation and text-segment translation;

[0052] In this embodiment, word and sentence refers to the translation of sentences. The text can be translated by combining professional vocabulary and machine translation, or multiple text objects can be selected for batch translation. Segment translation refers to the translation of the entire paragraph. Single-line text or multi-line text that is typeset by line on the drawing can be selected. The program will sort the text according to the text coordinates (the text is sorted from left to right and from top to bottom according to the X coordinate and Y coordinate, and the difference between the Y coordinates within the range of one times the character height is regarded as the same line of text), and combined into a paragraph for translation. The translated text output after translation is multi-line text. The user can specify the insertion point and width of the multi-line text for typeset. The translation result is as follows: Figure 2 As shown, the typesetting results are as follows Figure 3 shown.

[0053] For the paragraph translation mode, a coordinate sorting algorithm is used to splice multiple lines of text in the initial text;

[0054] Set up a custom output layout format panel, including font style, font size, font spacing, and the distance between the newly added translated text and the original text;

[0055] In this embodiment, for the in-situ addition mode, after setting the character width and height, new translated text can be added according to the set style. For in-situ replacement, the original text style will be modified to the new style, and the setting is applicable to both phrases and paragraphs. The new line spacing means that when using in-situ addition, the new font is several times the original font height downward from the original font. The plug-in also sets an option to choose to use the system font style. The plug-in will automatically identify the font style of the existing text in the drawing, and the user can specify a font style as the font style of the translated language. In addition, the user can obtain these parameters by picking. The character width and height can be set by picking the existing text on the drawing. The new line spacing can be customized by clicking two points on the drawing to customize the distance between the translated text and the source text. The steps for defining the new distance by two points are as follows: Figure 3 shown.

[0056] By integrating the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrating the translation plug-in with the CAD system, you can use CAD for fast text translation and typesetting.

[0057] In this embodiment, based on the above steps, the actual workflow of the present invention is as follows:

[0058] The first step is to load the plug-in and initialize the parameters: the user enters NETLOAD in the CAD command bar to load the translation plug-in, and the system will automatically load the last used translation parameters, including source language, target language, translation mode, etc., and start the translation process. If no keywords are entered during the translation process, the system will execute the translation task in a loop and the setting panel will not pop up.

[0059] The second step is to call the settings panel: during the translation process, users can call up the settings panel at any time by entering the keyword "s" to adjust the translation parameters. The settings panel supports users to define the translation direction of the source language and the target language, as well as to select the translation mode (sentence translation or paragraph translation) and the typesetting style. Finally, the translated result data can be saved and processed, and professional vocabulary can be added. The settings interface and its setting options are as follows: Figure 4 and Figure 5 shown.

[0060] The third step is translation processing: according to the type of translation content selected by the user (word or paragraph), the system will automatically detect the text content in CAD. For word translation, the system can batch process multiple sentences; for paragraph translation, the system will use a coordinate sorting algorithm to splice texts in different positions into a complete paragraph for translation.

[0061] Step 4: vocabulary matching and machine translation: During the translation process, the system first queries the professional vocabulary. If there is a matching word in the vocabulary, it will be used first. Otherwise, the result will be obtained through the machine translation API.

[0062] Step 5: After the translation is completed, the system automatically adjusts the font, spacing and position of the translated text according to the user's preset typesetting format. Users can choose to use the existing font style in the CAD drawing or set a new format.

[0063] Step 6. After the translation is completed, users can export the translation results as TXT files and import them into the professional vocabulary in batches. Users can also search, edit, delete and add vocabulary contents through the management panel of the professional vocabulary.

[0064] As a preferred implementation mode of this embodiment, the word and sentence translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing. The added position is automatically added downward according to the newly added line spacing.

[0065] In this embodiment, in-situ replacement refers to replacing the translated text with the original text position, directly replacing it (the original text disappears); in-situ addition refers to adding the translated text to the drawing (the original text does not disappear), and the added position is automatically added downward according to the added line spacing. The result of the word translation is as follows Figure 6 shown.

[0066] As a preferred implementation of this embodiment, during the translation process, the initial text is first translated through an internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through an API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

[0067] In this embodiment, for the translation results, the user can export the data in the translation process as a txt document through the Export Data button, where the languages ​​before and after the translation are separated by commas, which is the same as the storage format of the professional vocabulary, so that the user can filter the exported data and store it in the professional vocabulary after modification. The Open Professional Vocabulary button can open the professional vocabulary stored locally. Users can add professional vocabulary in batches here, and can also delete, search, and add vocabulary in the professional vocabulary through the Store Professional Vocabulary button. The editing operation of the professional vocabulary is as follows: Figure 7 shown.

[0068] As a preferred implementation of this embodiment, the text translation sorting algorithm is specifically as follows:

[0069] Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

[0070] Embodiment 2:

[0071] A CAD rapid translation typesetting system based on a professional knowledge base, comprising:

[0072] A professional knowledge base building module builds a custom professional vocabulary and a machine translation API interface, which is connected to an external machine translation software to form a professional knowledge base that is automatically matched during the translation process;

[0073] A panel parameter setting module is used to set a customized parameter panel, including the selection of source language and target language, translation mode, and translation content type. The translation mode includes word translation and text translation.

[0074] The text translation sorting module uses a coordinate sorting algorithm to splice multiple lines of text in the initial text according to the text translation mode;

[0075] Typesetting format setting module, set the customized output typesetting format panel, including font style, font size, font spacing and the distance of the newly added translated text relative to the original text;

[0076] The translation plug-in integration module integrates the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrates the translation plug-in with the CAD system, so that CAD can be used for rapid text translation and typesetting.

[0077] As a preferred implementation mode of this embodiment, the word and sentence translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing. The added position is automatically added downward according to the newly added line spacing.

[0078] As a preferred implementation of this embodiment, during the translation process, the initial text is first translated through an internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through an API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

[0079] As a preferred implementation of this embodiment, the text translation sorting algorithm is specifically as follows:

[0080] Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

[0081] Embodiment three:

[0082] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a CAD rapid translation and typesetting method based on a professional knowledge base as described in any embodiment of the present invention is implemented.

[0083] Embodiment 4:

[0084] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a CAD rapid translation and typesetting method based on a professional knowledge base as described in any embodiment of the present invention.

[0085] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A CAD rapid translation and typesetting method based on a professional knowledge base, characterized in that: The specific steps include: Build a custom professional vocabulary and machine translation API interface, which is connected to external machine translation software to form a professional knowledge base that is automatically matched during the translation process; Setting a customized parameter panel, including source language and target language selection, translation mode, and translation content type. The translation mode includes word-sentence translation and text-segment translation; For the paragraph translation mode, a coordinate sorting algorithm is used to splice multiple lines of text in the initial text; Set up a custom output layout format panel, including font style, font size, font spacing, and the distance between the newly added translated text and the original text; By integrating the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrating the translation plug-in with the CAD system, you can use CAD for fast text translation and typesetting.

2. The CAD rapid translation and typesetting method based on a professional knowledge base according to claim 1 is characterized in that: The word translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing. The added position is automatically added downward according to the added line spacing.

3. The CAD rapid translation and typesetting method based on a professional knowledge base according to claim 1 is characterized in that: During the translation process, the initial text is first translated through the internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through the API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

4. The CAD rapid translation and typesetting method based on a professional knowledge base according to claim 1 is characterized in that: The text translation sorting algorithm is specifically as follows: Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

5. A CAD rapid translation and typesetting system based on a professional knowledge base, characterized in that: include: A professional knowledge base building module builds a custom professional vocabulary and a machine translation API interface, which is connected to an external machine translation software to form a professional knowledge base that is automatically matched during the translation process; A panel parameter setting module is used to set a customized parameter panel, including the selection of source language and target language, translation mode, and translation content type. The translation mode includes word translation and text translation. The text translation sorting module uses a coordinate sorting algorithm to splice multiple lines of text in the initial text according to the text translation mode; Typesetting format setting module, set the customized output typesetting format panel, including font style, font size, font spacing and the distance of the newly added translated text relative to the original text; The translation plug-in integration module integrates the professional knowledge base, customized parameter panel and customized output typesetting format panel into the translation plug-in, and then integrates the translation plug-in with the CAD system, so that CAD can be used for rapid text translation and typesetting.

6. The CAD rapid translation and typesetting system based on a professional knowledge base according to claim 5 is characterized in that: The word translation includes in-situ replacement and in-situ addition. The in-situ replacement is to directly replace the translated text with the original text position, and the in-situ addition is to add the translated text to the drawing. The added position is automatically added downward according to the added line spacing.

7. The CAD rapid translation and typesetting system based on a professional knowledge base according to claim 5 is characterized in that: During the translation process, the initial text is first translated through the internal custom professional vocabulary. If the corresponding vocabulary cannot be found in the custom professional vocabulary, it is translated using external machine translation software through the API interface, and the corresponding vocabulary is updated in the internal custom professional vocabulary.

8. The CAD rapid translation and typesetting system based on a professional knowledge base according to claim 5 is characterized in that: The text translation sorting algorithm is specifically as follows: Sort the text from left to right and from top to bottom according to the X-coordinate and Y-coordinate. The difference between the Y-coordinates within the range of one times the character height is regarded as the same line of text. Single-line and multi-line texts in different positions are automatically spliced ​​into complete paragraphs in sequence.

9. An electronic 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 program, the method for rapid CAD translation and typesetting based on a professional knowledge base as described in any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a CAD rapid translation and typesetting method based on a professional knowledge base as described in any one of claims 1 to 4 is implemented.