Drawing Format Conversion Method, Device, Computer Equipment and Storage Medium
By obtaining the drawing source and determining the format conversion rules, the primitive objects in the drawing editing software are converted into compatible formats, which solves the problem that different versions of drawings cannot be edited in the same software, and achieves efficient conversion and unification of drawing files.
Patent Information
- Application Number
- CN202510239734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the prior art, different versions of CAD drawing files cannot be edited in the same software, resulting in cumbersome drawing reuse and difficult to interact with historical drawings.
By obtaining the drawing source of the drawing editing software, determine the format conversion rules of the primitive object to be converted, and convert the primitive object into a compatible format based on these rules to generate drawings with compatible file formats.
It realizes editing of different versions of drawing files in the same software, improves usage efficiency, reduces usage costs, and ensures accurate and rapid conversion of historical drawings.
Smart Images

Figure CN119722873B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of drawing format conversion, and particularly to a drawing format conversion method, device, computer device, storage medium, and computer program product. Background Art
[0002] AutoCAD software is a drawing editing software that emerged with the digitalization of the industrial industry. It can parse CAD drawings by reading drawing exchange files such as DXF, DWT, and DWG.
[0003] Currently, there are many existing design software on the market, but the files are closed-source and need to be opened with the corresponding software to perform attribute editing and modification, making the reuse of CAD drawings rather cumbersome. At the same time, over time, the design software has undergone version iterations. Historical files of older versions can only be viewed and edited in lower version programs, and it is difficult to perform interactive operations on the large number of historical drawings accumulated by enterprises using other design software.
[0004] Therefore, in traditional technologies, there is a problem that drawing files of different versions cannot be opened and edited in the same software. Summary of the Invention
[0005] Based on this, it is necessary to provide a drawing format conversion method, device, computer device, computer-readable storage medium, and computer program product that can open and edit drawing files of different versions in the same software for the above technical problems.
[0006] A drawing format conversion method includes:
[0007] Obtain the drawing source of the current drawing opened by the drawing editing software; the current drawing includes to-be-converted primitive objects incompatible with the drawing editing software;
[0008] Determine the format conversion rules for each to-be-converted primitive object according to the drawing format conversion configuration information corresponding to the drawing source;
[0009] Use the format conversion rules corresponding to each to-be-converted primitive object to convert each to-be-converted primitive object to obtain the converted primitive objects corresponding to each to-be-converted primitive object;
[0010] Generate the converted drawing corresponding to the current drawing according to the primitive information corresponding to each converted primitive object; the file format of the converted drawing is the compatible file format of the drawing editing software.
[0011] In one of the embodiments, obtaining the drawing source of the current drawing opened by the drawing editing software includes:
[0012] When there is a drawing frame object to be converted in the current drawing, determine the file group code information of the drawing frame object, and determine the field information of the drawing source field in the file group code information;
[0013] Determine the drawing source of the current drawing according to the field information of the drawing source field.
[0014] In one embodiment, according to the drawing format conversion configuration information corresponding to the drawing source, determine the format conversion rules for each drawing element object to be converted, including:
[0015] When the drawing source corresponds to a standard drawing, obtain the drawing format conversion configuration information corresponding to the standard drawing;
[0016] Determine the format conversion rules for each drawing element object to be converted according to the format conversion parameters in the drawing format conversion configuration information.
[0017] In one embodiment, the drawing element object to be converted includes a title block object to be converted. According to the drawing format conversion configuration information corresponding to the drawing source, determine the format conversion rules for each drawing element object to be converted, including:
[0018] When the drawing source corresponds to multiple standard drawings, determine the target standard drawing that matches the title block information of the title block object to be converted among the standard drawings;
[0019] Obtain the drawing format conversion configuration information corresponding to the target standard drawing, and determine the format conversion rules for each drawing element object to be converted according to the format conversion parameters in the drawing format conversion configuration information corresponding to the target standard drawing.
[0020] In one embodiment, determining the target standard drawing that matches the title block information of the title block object to be converted among the standard drawings includes:
[0021] For any one of the standard drawings among the standard drawings, obtain the title block information of the title block object of any one of the standard drawings;
[0022] When the title block information of the title block object to be converted matches the title block information of the title block object of any one of the standard drawings, use any one of the standard drawings as the target standard drawing.
[0023] In one embodiment, the title block information of the title block object to be converted includes the title block size, title block table structure, and title block custom area of the title block object to be converted. The method further includes:
[0024] Perform matching based on whether the title block size of the title block object to be converted is the same as the title block size of any one of the standard drawings to obtain a first matching result;
[0025] When the first matching result indicates a successful match, match based on whether the title bar table structure of the title bar object to be transformed is the same as the title bar table structure of any standard drawing to obtain a second matching result;
[0026] When the second matching result indicates a successful match, match based on whether the custom area of the title bar of the title bar object to be transformed is the same as the custom area of the title bar corresponding to any standard drawing to obtain a third matching result;
[0027] When the third matching result indicates a successful match, determine that any standard drawing matches the title bar information of the title bar object to be transformed.
[0028] In one embodiment, the primitive object to be transformed includes a serial number object to be transformed; the serial number object to be transformed is a block object including at least one serial number text; the primitive information of the serial number object to be transformed includes the serial number text and the serial number stacking state; using the format conversion rules corresponding to each primitive object to be transformed, transform each primitive object to be transformed to obtain the transformed primitive object corresponding to each primitive object to be transformed, including:
[0029] When the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the serial number object to be transformed is the overall mode, determine the first serial number text of the serial number object to be transformed according to the serial number text of the serial number object to be transformed; the overall mode indicates that each stacked serial number text belongs to the same block object;
[0030] Using the first serial number text as the base serial number text, merge the other serial number texts in the serial number object to be transformed into the base serial number text in sequence to generate a transformed serial number object; the other serial number texts are the serial number texts in the serial number object to be transformed except the first serial number text.
[0031] In one embodiment, the method further includes:
[0032] When the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the serial number object to be transformed is the separated mode, generate any stacked serial number text, and find the previous serial number text of the stacked serial number text according to the position coordinates of the serial number marking point of the stacked serial number text; the separated mode indicates that each stacked serial number text is an independent block object;
[0033] When the previous serial number text is found, merge and stack the stacked serial number text onto the previous serial number text to generate a transformed serial number object.
[0034] In one embodiment, the method further includes:
[0035] When the previous serial number text is not found, cancel the generation of the stacked serial number text and place the stacked serial number text at the end of the stacked serial number text traversal set;
[0036] Traverse the stack sequence number text in the set of stack sequence number texts, and return the steps to generate the stack sequence number text until each stack sequence number text is merged into the corresponding pre-sequence number text of each stack sequence number text to generate a transformed sequence number object.
[0037] In one embodiment, the to-be-transformed primitive object includes a to-be-transformed detailed list object; according to the drawing source, determine the format transformation rules for each to-be-transformed primitive object in the to-be-transformed drawing frame object, including:
[0038] According to the drawing source, determine the block object attributes of all row data of each column in the to-be-transformed detailed list object;
[0039] When the block object attribute indicates that all row data of any column in the detailed list belongs to the same overall block object, determine the splitting method of the to-be-transformed detailed list object according to the number of overall block objects in the to-be-transformed detailed list object and the target point information of each overall block object in the to-be-transformed detailed list object;
[0040] When the block object attribute indicates that all row data of any column in the detailed list is a single-row block object, determine the splitting method of the to-be-transformed detailed list object according to the target point information of each single-row block object in the to-be-transformed detailed list object.
[0041] A drawing format conversion device includes:
[0042] A source determination module for obtaining the drawing source of the current drawing opened by the drawing editing software; the current drawing includes to-be-transformed primitive objects that are not compatible with the drawing editing software;
[0043] A rule determination module for determining the format transformation rules for each to-be-transformed primitive object according to the drawing format conversion configuration information corresponding to the drawing source;
[0044] A primitive transformation module for transforming each to-be-transformed primitive object by using the corresponding format transformation rules of each to-be-transformed primitive object to obtain the transformed primitive object corresponding to each to-be-transformed primitive object;
[0045] A drawing transformation module for generating a transformed drawing corresponding to the current drawing according to the primitive information corresponding to each transformed primitive object; the file format of the transformed drawing is a compatible file format of the drawing editing software.
[0046] A computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0047] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0048] A computer program product includes a computer program which, when executed by a processor, implements the steps of the above method.
[0049] For the above drawing format conversion method, device, computer device, storage medium and computer program product, by obtaining the drawing source of the current drawing opened by the drawing editing software; the current drawing includes to-be-converted primitive objects incompatible with the drawing editing software; determining the format conversion rules for each to-be-converted primitive object according to the drawing format conversion configuration information corresponding to the drawing source; using the format conversion rules corresponding to each to-be-converted primitive object to convert each to-be-converted primitive object to obtain the converted primitive objects corresponding to each to-be-converted primitive object; generating the converted drawing corresponding to the current drawing according to the primitive information corresponding to each converted primitive object; the file format of the converted drawing is the compatible file format of the drawing editing software; thus, it is possible to quickly determine the format conversion rules for each to-be-converted primitive object in the current drawing according to the drawing source of the current drawing opened by the drawing editing software, and convert each to-be-converted primitive object into each converted primitive object according to the format conversion rules of each to-be-converted primitive object, so as to quickly perform drawing format conversion. Overall, it is possible to flexibly and accurately and quickly convert multi-source drawings and historical drawings, unify the drawing parameters corresponding to the converted drawings into the required design software, improve the usage efficiency and reduce the usage cost. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 It is an application environment diagram of a drawing format conversion method in an embodiment;
[0052] Figure 2 It is a schematic flowchart of a drawing format conversion method in an embodiment;
[0053] Figure 3 It is a flowchart of a drawing conversion method in an embodiment;
[0054] Figure 4 It is a schematic diagram of a horizontal stacking state in an embodiment;
[0055] Figure 5 It is a schematic diagram of a vertical stacking state in an embodiment;
[0056] Figure 6 Schematic diagram of the graphic element information of an object with a serial number to be converted in an embodiment;
[0057] Figure 7 Schematic diagram of a detailed list object in an implementation;
[0058] Figure 8 Flow schematic diagram of a drawing format conversion method in another embodiment;
[0059] Figure 9 Structural block diagram of a drawing format conversion device in an embodiment;
[0060] Figure 10 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0061] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] The drawing format conversion method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed in the cloud or other network servers. The server 104 obtains the drawing source of the current drawing opened by the drawing editing software; the current drawing includes the graphic element objects to be converted that are not compatible with the drawing editing software; the server 104 determines the format conversion rules for each graphic element object to be converted according to the drawing format conversion configuration information corresponding to the drawing source; the server 104 uses the format conversion rules corresponding to each graphic element object to be converted to convert each graphic element object to be converted, and obtains the converted graphic element objects corresponding to each graphic element object to be converted; the server 104 generates the converted drawing corresponding to the current drawing according to the graphic element information corresponding to each converted graphic element object; the file format of the converted drawing is the compatible file format of the drawing editing software. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0063] In an exemplary embodiment, as Figure 2As shown, a method for converting drawing formats is provided. Taking the server 104 in Figure 1 as an example, the method includes the following steps S202 to S208. Among them:
[0064] Step S202: Obtain the drawing source of the current drawing opened by the drawing editing software; the current drawing includes primitive objects to be converted that are incompatible with the drawing editing software.
[0065] Among them, the drawing editing software may refer to AutoCAD (Autodesk Computer Aided Design) software.
[0066] Among them, the current drawing may refer to the DWG drawing currently opened by the drawing editing software, the current drawing may be a historical version drawing of the drawing editing software, or a drawing of other image editing software.
[0067] Among them, the drawing source may refer to the drawing editing software to which the current drawing belongs. For example, software such as Design Star, Yaocreate, and CAXA.
[0068] Among them, the primitive objects to be converted may refer to primitive objects that cannot be edited and modified in terms of attributes in the drawing editing software. In a drawing, the primitive objects may be drawing frame objects, title bar objects, bill of materials objects, and serial number objects.
[0069] Optionally, the server determines whether the currently opened DWG drawing of the drawing editing software contains a drawing frame object that needs to be converted. In the case of containing a drawing frame object that needs to be converted, the server judges the drawing source of the currently opened DWG drawing of the drawing editing software. For different drawing sources, different drawing format conversion configuration texts are pre-configured in the server.
[0070] Step S204: Determine the format conversion rules for each primitive object to be converted according to the drawing format conversion configuration information corresponding to the drawing source.
[0071] Among them, the drawing format conversion configuration information can be the information pre-written in the drawing format conversion program or the information in the drawing format conversion configuration file. The drawing format conversion configuration file can refer to the configuration file used to convert the drawing format of the current drawing into a drawing format compatible with the drawing editing software. The information pre-configured in the configuration file is used to convert the primitive objects of the current drawing into primitive objects compatible with the drawing editing software. Different writing methods of the drawing format conversion configuration information have different advantages. Writing the drawing format conversion configuration information into the drawing format conversion program can improve the convenience of data acquisition, while writing the drawing format conversion configuration information into the drawing format conversion configuration file can improve the flexibility and adaptability of drawing format conversion.
[0072] Among them, the format conversion rule of the primitive object to be converted can refer to the primitive object parameter conversion method corresponding to converting the primitive object to be converted in the current drawing into a primitive object compatible with the drawing editing software.
[0073] Optionally, when the primitive objects to be converted in the current version of the DWG drawing include the drawing frame object to be converted, the title bar object to be converted, the bill of materials object to be converted, and the part number object to be converted, the server determines the format conversion rules corresponding to the drawing frame object to be converted, the title bar object to be converted, the bill of materials object to be converted, and the part number object to be converted respectively according to the drawing format conversion configuration information corresponding to the drawing source.
[0074] Step S206: Use the format conversion rules corresponding to each primitive object to be converted to convert each primitive object to be converted, and obtain the converted primitive objects corresponding to each primitive object to be converted.
[0075] Among them, the converted primitive object refers to the primitive object compatible with the image editing software.
[0076] Optionally, when the primitive objects to be converted in the current version of the DWG drawing include the drawing frame object to be converted, the title bar object to be converted, the bill of materials object to be converted, and the part number object to be converted, the server uses the format conversion rules corresponding to the drawing frame object to be converted, the title bar object to be converted, the bill of materials object to be converted, and the part number object to be converted respectively to perform format conversion on the drawing frame object to be converted, the title bar object to be converted, the bill of materials object to be converted, and the part number object to be converted respectively, and obtains the converted drawing frame object corresponding to the drawing frame object to be converted, the converted title bar object corresponding to the title bar object to be converted, the converted bill of materials object corresponding to the bill of materials object to be converted, and the converted part number object corresponding to the part number object to be converted.
[0077] Step S208: Generate the converted drawing corresponding to the current drawing according to the primitive information corresponding to each converted primitive object; the file format of the converted drawing is the compatible file format of the drawing editing software.
[0078] Among them, the graphic element information of the transformed graphic element object may include the drawing frame parameter information, title bar parameter information, bill of materials parameter information, and serial number parameter information of the transformed graphic element object.
[0079] Among them, the transformed drawing can be a drawing compatible with the image editing software.
[0080] Optionally, after the server obtains the transformed drawing frame object corresponding to the drawing frame object to be transformed, the transformed title bar object corresponding to the title bar object to be transformed, the transformed bill of materials object corresponding to the bill of materials object to be transformed, and the transformed serial number object corresponding to the serial number object to be transformed, according to the graphic element information of the transformed drawing frame object, the transformed title bar object, the transformed bill of materials object, and the transformed serial number object, the server generates the transformed drawing corresponding to the current drawing.
[0081] In the above drawing format conversion method, by obtaining the drawing source of the current drawing opened by the drawing editing software; the current drawing includes the graphic element objects to be transformed that are not compatible with the drawing editing software; according to the drawing format conversion configuration information corresponding to the drawing source, determining the format conversion rules for each graphic element object to be transformed; using the format conversion rules corresponding to each graphic element object to be transformed to transform each graphic element object to be transformed, obtaining the transformed graphic element objects corresponding to each graphic element object to be transformed; generating the transformed drawing corresponding to the current drawing according to the graphic element information corresponding to each transformed graphic element object; the file format of the transformed drawing is the compatible file format of the drawing editing software; in this way, it is possible to quickly determine the format conversion rules for each graphic element object to be transformed in the current drawing according to the drawing source of the current drawing opened by the drawing editing software, and according to the format conversion rules of each graphic element object to be transformed, transform each graphic element object to be transformed into each transformed graphic element object, so as to quickly perform drawing format conversion. Generally speaking, it is possible to flexibly and accurately and quickly transform multi-source drawings and historical drawings, unify the drawing parameters corresponding to the transformed drawings into the required design software, improve the use efficiency, and reduce the use cost.
[0082] In an exemplary embodiment, obtaining the drawing source of the current drawing opened by the drawing editing software includes: when there is a drawing frame object to be transformed in the current drawing, determining the file group code information of the drawing frame object, and determining the field information of the drawing source field in the file group code information; according to the field information of the drawing source field, determining the drawing source of the current drawing.
[0083] Among them, the drawing frame object to be transformed may refer to the drawing frame that needs to be format-converted in the DWG drawing currently opened by the drawing editing software.
[0084] Among them, the file group code information may refer to the dxf group code information of the block objects in the currently opened DWG drawing. In practical applications, the file group code information may be composed of each field and the field value corresponding to each field.
[0085] Among them, the drawing source field may refer to the field in the file group code information that identifies the drawing source.
[0086] Among them, the field information of the drawing source field may refer to the field value corresponding to the field in the file group code information that identifies the drawing source. This field value can indicate the manufacturer from which the currently opened DWG drawing is sourced.
[0087] Optionally, when the server determines that there is a frame object to be converted in the currently opened DWG drawing, it determines the dxf group code information of the frame object, determines the field value of the drawing source field in the dxf group code information, and determines the drawing source of the currently opened DWG drawing according to the field value of the drawing source field.
[0088] In this embodiment, when there is a frame object to be converted in the current drawing, the file group code information of the frame object is determined, and the field information of the drawing source field is determined in the file group code information; according to the field information of the drawing source field, the drawing source of the current drawing is determined; in this way, the drawing source of the current drawing can be determined quickly and accurately.
[0089] In this application, one drawing source may correspond to one standard drawing, or may correspond to multiple standard drawings. It can be understood that the same drawing manufacturer may have one standard drawing or multiple standard drawings. The next embodiment corresponds to the specific method of determining the format conversion rules of each to-be-converted primitive object when one drawing source corresponds to only one standard drawing.
[0090] In an exemplary embodiment, determining the format conversion rules of each to-be-converted primitive object according to the drawing format conversion configuration information corresponding to the drawing source includes: when the drawing source corresponds to one standard drawing, obtaining the drawing format conversion configuration information corresponding to the standard drawing; determining the format conversion rules of each to-be-converted primitive object according to the format conversion parameters configured in the drawing format conversion configuration information.
[0091] Among them, the standard drawing may be a drawing with a standard format.
[0092] Among them, the format conversion parameter may refer to the conversion parameter based on which a to-be-converted primitive object incompatible with the image editing software is converted into a primitive object compatible with the image editing software.
[0093] Optionally, when there is only one standard drawing corresponding to the drawing source of the currently opened DWG drawing, the server obtains the drawing format conversion configuration information corresponding to the standard drawing, and determines the format conversion rules for each to-be-converted graphic element object according to the format conversion parameters configured in the drawing format conversion configuration information.
[0094] In this embodiment, when there is only one standard drawing for the drawing source, the drawing format conversion configuration information of the standard drawing can be quickly obtained, so as to quickly and accurately determine the format conversion rules for each to-be-converted graphic element object.
[0095] The previous embodiment corresponds to a specific method for determining the format conversion rules for each to-be-converted graphic element object when there is only one standard drawing corresponding to the drawing source. The next embodiment corresponds to a specific method for determining the format conversion rules for each to-be-converted graphic element object when there are multiple standard drawings corresponding to the drawing source. Different from the previous embodiment, in the next embodiment, it is necessary to first determine the target standard drawing among multiple standard drawings before determining the format conversion rules for each to-be-converted graphic element object.
[0096] In an exemplary embodiment, the to-be-converted graphic element object includes a to-be-converted title block object. Determining the format conversion rules for each to-be-converted graphic element object according to the drawing format conversion configuration information corresponding to the drawing source includes: when there are multiple standard drawings corresponding to the drawing source, determining a target standard drawing that matches the title block information of the to-be-converted title block object among the standard drawings; obtaining the drawing format conversion configuration information corresponding to the target standard drawing, and determining the format conversion rules for each to-be-converted graphic element object according to the format conversion parameters configured in the drawing format conversion configuration information corresponding to the target standard drawing.
[0097] Among them, the to-be-converted title block object may refer to a title block object that is incompatible with the image editing software.
[0098] Among them, the title block information may refer to the information corresponding to the title block size, title block table structure, and title block custom area of the to-be-converted title block object.
[0099] Among them, the target standard drawing may refer to the standard drawing that matches the title block information of the to-be-converted title block object among multiple standard drawings.
[0100] Optionally, when the drawing source corresponds to multiple standard drawings, the server determines a target standard drawing that matches the title bar information of the title bar object to be converted from each standard drawing according to the title bar information of the title bar object to be converted. Then, the server obtains the drawing format conversion configuration information corresponding to the target standard drawing, and determines the format conversion rules corresponding to the drawing frame object, the title bar object to be converted, the bill of materials object to be converted, and the serial number object to be converted respectively according to the format conversion parameters configured in the drawing format conversion configuration information corresponding to the target standard drawing.
[0101] In this embodiment, when the drawing source corresponds to multiple standard drawings, it is possible to first determine a target standard drawing that matches the title bar information of the title bar object to be converted from each standard drawing, then obtain the drawing format conversion configuration information corresponding to the target standard drawing, and quickly and accurately determine the format conversion rules of each drawing element object to be converted according to the format conversion parameters configured in the drawing format conversion configuration information corresponding to the target standard drawing.
[0102] The next embodiment provides a specific method for matching according to the title bar information of the title bar object to determine the target standard drawing among multiple standard drawings.
[0103] In an exemplary embodiment, determining a target standard drawing that matches the title bar information of the title bar object to be converted from each standard drawing includes: for any one of the standard drawings of each standard drawing, obtaining the title bar information of the title bar object of any one of the standard drawings; when the title bar information of the title bar object to be converted matches the title bar information of the title bar object of any one of the standard drawings, using any one of the standard drawings as the target standard drawing.
[0104] Optionally, when it is determined that the drawing source corresponds to multiple standard drawings, it is necessary to distinguish each standard drawing of the drawing source. For any one of the standard drawings of each standard drawing, the server obtains the title bar information of the title bar object of any one of the standard drawings. When the title bar information of the title bar object to be converted matches the title bar information of the title bar object of any one of the standard drawings, using any one of the standard drawings as the target standard drawing.
[0105] In this embodiment, when the drawing source corresponds to multiple standard drawings, by traversing the drawing format conversion configuration information of each standard drawing and matching the title bar information of the title bar object in the drawing format conversion configuration information of each standard drawing with the title bar information of the title bar object to be converted, the target standard drawing can be determined, and the target standard drawing can be accurately determined, thereby ensuring the correctness of the drawing conversion.
[0106] The next embodiment provides a specific method for triple verification based on the title bar information of the title bar object to determine the target standard drawing among multiple standard drawings.
[0107] In an exemplary embodiment, the title bar information of the title bar object to be transformed includes the title bar size, the title bar table structure, and the title bar custom area of the title bar object to be transformed. The method further includes: matching based on whether the title bar size of the title bar object to be transformed is the same as the title bar size of any standard drawing to obtain a first matching result; when the first matching result indicates successful matching, matching based on whether the title bar table structure of the title bar object to be transformed is the same as the title bar table structure of any standard drawing to obtain a second matching result; when the second matching result indicates successful matching, matching based on whether the title bar custom area of the title bar object to be transformed is the same as the corresponding title bar custom area of any standard drawing to obtain a third matching result; when the third matching result indicates successful matching, it is determined that any standard drawing matches the title bar information of the title bar object to be transformed.
[0108] Among them, the title bar size may include the length and height of the title bar object to be transformed.
[0109] Among them, the title bar table structure can be represented by the straight line object parameters included inside the title bar object to be transformed.
[0110] Among them, the title bar custom area may refer to a pre-specified area in the title bar object to be transformed. In practical applications, for a drawing source, the information within the title bar custom areas corresponding to its multiple standard drawings should be different. Therefore, the information within the title bar custom area can be used to determine the target standard drawing among multiple standard drawings.
[0111] Optionally, triple verification needs to be performed based on the title bar size of the title bar object to be converted and the title bar size of any standard drawing, the title bar table structure of the title bar object to be converted and the title bar table structure of any standard drawing, and the title bar custom area of the title bar object to be converted and the title bar custom area of any standard drawing to determine the target standard drawing. Specifically, it is necessary to traverse the drawing format conversion configuration information corresponding to each standard drawing, compare the title bar length and title bar height with the title bar standard length and title bar standard height in the drawing format conversion configuration information corresponding to the current standard drawing, and initially determine whether the title bar size matches successfully. If the match fails with the drawing format conversion configuration information of the current standard drawing, then traverse the drawing format conversion configuration information of the next standard drawing for matching until the match is successful and proceed to the next verification. If the match fails, a user prompt for the failure of relevant parameter matching is given; after the title bar size matches successfully, compare the straight line object parameters included in the title bar block object with the straight line object standard parameters in the drawing format conversion configuration information of the current standard drawing to further determine whether the internal structure of the title bar table matches successfully. If the match fails with the drawing format conversion configuration information of the current standard drawing, then traverse the drawing format conversion configuration information of the next standard drawing for matching until the match is successful and proceed to the next verification. If the match fails, a user prompt for the failure of relevant parameter matching is given; after the internal structure of the title bar table matches successfully, compare according to the information of the user-defined title bar area. After obtaining the information of the user-specified title bar area, compare it with the user-defined standard information content in the drawing format conversion configuration information of the current standard drawing. If the match fails, then traverse the drawing format conversion configuration information of the next current standard drawing for matching until the match is successful, and then the correct drawing format conversion configuration information can be determined. In the next step, perform the conversion according to the format conversion parameters in the drawing format conversion configuration information. If the match fails, a user prompt for the failure of relevant parameter matching is given.
[0112] For the convenience of those skilled in the art to understand, Figure 3A flowchart of a drawing conversion method is exemplarily provided. The process specifically includes: when it is detected that the DWG drawing opened by the image editing software contains a drawing frame object to be converted, obtaining the drawing area primitive information in the DWG drawing, including the drawing frame object primitive information, the title bar object primitive information, the serial number object primitive information, and the bill of materials object primitive information, and verifying the primitive information to determine the drawing source; obtaining the primitive information of the drawing frame object in the drawing area, calculating the drawing frame data and the drawing frame range of the new drawing frame object to obtain the primitive information of the new drawing frame object, and searching for the primitive information of the title bar object within the drawing frame range to calculate the new drawing sheet ratio to obtain the primitive information of the new title bar object; performing triple verification based on the title bar object. After the triple verification passes, based on the drawing frame range of the drawing frame object, obtaining the primitive information of the serial number object within the drawing frame range and generating the primitive information of the new serial number object. The primitive information of the new serial number object includes the new serial number object text, the new serial number object marker point, the new serial number object placement point, and the new serial number object stacking state. Based on the drawing frame range of the image object, obtaining the primitive information of the bill of materials object within the drawing frame range and generating the primitive information of the new bill of materials object. The primitive information of the new bill of materials object includes the text information of the new bill of materials object and the multi-column bill of materials splitting information; generating a conversion-compatible format file based on the primitive information of the new drawing frame object, the new title bar object, the new serial number object, and the new bill of materials object.
[0113] Figure 3For the triple verification part shown, generally, different matching rules are selected according to the complexity of the customer's historical drawings. Among them, the first-level matching is for the simplest and highly standardized enterprises. Since the historical drawings are relatively standard, only through the first-level matching, the length and height dimensions of the title bar can be verified. After restoring the length and height dimensions set in the configuration file and the length and height dimensions obtained from the actual drawings in a 1:1 ratio, they are compared to match the correct historical drawing. The second-level matching is for enterprises with a certain degree of complexity and general standardization, that is, there are multiple standard drawings with the same length and height of the title bar but different internal structures. At this time, the second-level matching can be used for differentiation. The number of straight line objects in the title bar is compared, and the standard number set in the configuration file and the number of straight line objects obtained from the actual drawings are compared to match the correct historical drawing. The third-level matching is for enterprises with a high degree of complexity and low standardization of historical drawings, that is, when the length and height of the title bar are the same and the internal structures are also the same (the number of straight lines in the title bar is the same), it is necessary to distinguish based on the user-defined key information. At this time, the user needs to identify according to the unique identifier of the specific drawing. For example, if the text in a certain area of the title bar is "Process", then this drawing is a process drawing, that is, it needs to be converted according to the drawing conversion method of the process drawing. Therefore, the user needs to edit the corresponding text content into the user-defined field of the configuration file, and extract the text content at the corresponding position of the title bar to achieve customization. By comparing whether the text content at the actual drawing position is exactly the same as the user-defined text content in the configuration file, the correct historical drawing can be matched.
[0114] In this embodiment, matching is performed based on whether the title bar size of the title bar object to be converted is the same as the title bar size of any standard drawing to obtain a first matching result; when the first matching result indicates a successful match, matching is performed based on whether the title bar table structure of the title bar object to be converted is the same as the title bar table structure of any standard drawing to obtain a second matching result; when the second matching result indicates a successful match, matching is performed based on whether the title bar custom area of the title bar object to be converted is the same as the corresponding title bar custom area of any standard drawing to obtain a third matching result; when the third matching result indicates a successful match, it is determined that any standard drawing matches the title bar information of the title bar object to be converted; in this way, accurate and rapid matching can be achieved in scenarios with a high degree of standardization of historical drawings, and detailed matching can also be performed in scenarios with a low degree of standardization of historical drawings through the final verification of the title bar custom area to ensure the correctness of drawing conversion.
[0115] In an exemplary embodiment, the primitive object to be transformed includes a serial number object to be transformed; the serial number object to be transformed is a block object including at least one serial number text; the primitive information of the serial number object to be transformed includes the serial number text and the serial number stacking state; using the format transformation rules corresponding to each primitive object to be transformed, each primitive object to be transformed is transformed to obtain the transformed primitive object corresponding to each primitive object to be transformed, including: in the case where the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the serial number object to be transformed is the overall mode, according to the serial number text of the serial number object to be transformed, determine the first serial number text of the serial number object to be transformed; the overall mode indicates that each stacked serial number text belongs to the same block object; using the first serial number text as the base serial number text, merge the other serial number texts in the serial number object to be transformed into the base serial number text in sequence to generate the transformed serial number object; the other serial number texts are the serial number texts in the serial number object to be transformed except the first serial number text.
[0116] Among them, the serial number object to be transformed may refer to a serial number object that is not compatible with the image editing software. In practical applications, the currently opened DWG drawing in the image editing software may not contain the serial number object to be transformed, or may contain the serial number object to be transformed. In the case of containing the serial number object to be transformed, the technical solution of this embodiment needs to be used for serial number object transformation. The technical solution of this embodiment corresponds to the case where the serial number object to be transformed contains stacked text serial numbers. See Figure 4 and Figure 5 . In practical applications, there is also a case where the serial number object to be transformed does not contain stacked serial number texts. See Figure 6 . Figure 6 Exemplarily, the primitive information of the serial number object to be transformed is marked, including the serial number object text, the serial number object marking point, the serial number object placement point, and the serial number object stacking state.
[0117] Among them, the serial number text may refer to the text corresponding to the serial number in the serial number object to be transformed. For example, see Figure 4 , Figure 4 contains the serial number object to be transformed, where "4", "5", and "6" are all serial number texts. See Figure 5 , Figure 5 contains the serial number object to be transformed, where "1", "2", and "3" are all serial number texts.
[0118] Among them, the serial number stacking state may refer to that the serial number texts are stacked vertically or horizontally. For example, the serial number stacking state shown in Figure 4 is horizontal stacking, and the serial number stacking state shown in Figure 5 is vertical stacking.
[0119] Among them, the stacked serial number text may refer to Figure 4The serial number texts "5" and "6" in it, the stacked serial number text "5" is horizontally stacked on the ordinary serial number text "4", and the stacked serial number text "6" is horizontally stacked on the stacked serial number text "5"; Figure 5 In it, the stacked serial number text "2" is vertically stacked on the ordinary serial number text "1", and the stacked serial number text "3" is vertically stacked on the stacked serial number text "2". The stacked serial number texts "5" and "6" are leadless serial number texts, and the stacked serial number texts have other styles besides the underlined style and the ball mark style.
[0120] Among them, the stacking mode can include an overall mode and a separated mode. The overall mode means that the n stacked serial number texts are an overall block object, and the separated mode means that the n stacked serial number texts are n independent block objects.
[0121] Among them, the first serial number text can refer to Figure 4 the ordinary serial number text "4" in it.
[0122] Among them, the transformed serial number object can refer to the serial number object obtained after formatting the serial number object to be transformed in Figure 4 it.
[0123] Optionally, for a DWG drawing containing stacked serial number texts, it is first necessary to determine whether the style of the stacked text serial number is the overall mode or the separated mode. For the serial number object to be transformed in the overall mode, when generating a new serial number object, according to the serial number text of the serial number object to be transformed, determine the first serial number text, create a new serial number object with the first serial number as the base serial number, and merge the other serial number texts except the first serial number text into the base serial number in sequence to generate the transformed serial number object.
[0124] The judgment basis for judging the stacked serial number style is: overall mode, that is, the n stacked serial numbers are an overall block object, and the judgment basis is that the serial number object found according to the dxf group code contains more than 1 text object; separated mode, that is, the n stacked serial numbers are n independent block objects. Here, since there is only 1 text object in both the stacked serial number and the ordinary serial number, so in the case of the separated mode, it is necessary to judge whether the current serial number object is a stacked serial number or an ordinary serial number. The judgment basis is that the abscissa of the marked point position coordinate of the serial number object found according to the dxf group code is the same as the abscissa of the placement point position coordinate (for vertical stacking) or the ordinate is the same (for horizontal stacking). By comparing the coordinate relationship between the marked point information and the placement point information of the serial number object, the determination of the stacked serial number is improved to a great extent, effectively avoiding the loss of the transformed serial number object caused by incorrect recognition of the stacked serial number text.
[0125] In this embodiment, when the stacking mode of the stacked serial number texts included in the serial number object to be converted is the overall mode in the serial number stacking state, the first serial number text of the serial number object to be converted is determined according to the serial number text of the serial number object to be converted; the overall mode indicates that each stacked serial number text belongs to the same block object; using the first serial number text as the base serial number text, the other serial number texts in the serial number object to be converted are sequentially merged into the base serial number text to generate a converted serial number object; the other serial number texts are the serial number texts in the serial number object to be converted except the first serial number text; in this way, when the stacking mode of the stacked serial number texts in the serial number object to be converted is the overall mode, the stacking of the serial number texts can be quickly and accurately performed, ensuring the efficiency and accuracy of the serial number conversion.
[0126] In an exemplary embodiment, the method further includes: when the stacking mode of the stacked serial number texts included in the serial number object to be converted is the separated mode in the serial number stacking state, generating any stacked serial number text, and searching for the preceding serial number text of the stacked serial number text according to the position coordinates of the serial number marking point of the stacked serial number text; the separated mode indicates that each stacked serial number text is an independent block object; when the preceding serial number text is found, the stacked serial number text is merged and stacked onto the preceding serial number text to generate a converted serial number object.
[0127] Among them, for the serial number marking point, reference can be made to Figure 6 , Figure 6 which also shows the serial number text "7" and the serial number placement point.
[0128] Among them, for Figure 4 the stacked serial number text "5" therein, its preceding serial number text can be the ordinary serial number text "4" in Figure 4 , and for Figure 4 the stacked serial number text "6" therein, its preceding serial number text can be the stacked serial number text "5" in Figure 4 .
[0129] Optionally, for a DWG drawing containing stacked serial number texts, it is first necessary to determine whether the style of the stacked serial number texts is the overall mode or the separated mode. For the serial number object to be converted in the separated mode, when generating a new serial number object, first generate the stacked serial number text, and then search for the previously generated preceding serial number text according to the position coordinates of the serial number marking point. If the preceding serial number text is found, the just-generated stacked serial number text is automatically merged and stacked onto the preceding serial number text to generate a merged stacked serial number.
[0130] In this embodiment, when the stacking mode of the stacked serial number texts included in the serial number object to be converted in the serial number stacking state is the separation mode, any stacked serial number text is generated, and the preceding serial number text of the stacked serial number text is found according to the position coordinates of the serial number marking points of the stacked serial number text; the separation mode indicates that each stacked serial number text is an independent block object; when the preceding serial number text is found, the stacked serial number text is merged and stacked onto the preceding serial number text to generate a converted serial number object; in this way, when the stacking mode of the stacked serial number texts in the serial number object to be converted is the separation mode, the stacked serial number text can be generated first, and then its corresponding preceding serial number text can be found. When the preceding serial number text is found, the serial number text can be stacked quickly and accurately, ensuring the efficiency and accuracy of the conversion of the serial number object.
[0131] In an exemplary embodiment, the method further includes: when the preceding serial number text is not found, canceling the generation of the stacked serial number text and placing the stacked serial number text at the end of the stacked serial number text traversal set; traversing the stacked serial number texts in the stacked serial number text traversal set, and returning to the step of generating the stacked serial number text until each stacked serial number text is merged into the preceding serial number text corresponding to each stacked serial number text to generate a converted serial number object.
[0132] Wherein, the stacked serial number text traversal set can be a set including multiple stacked serial number texts.
[0133] Optionally, if the preceding serial number text is not found, cancel the generation of the stacked serial number text, place the stacked serial number text at the end of the stacked serial number traversal set, continue to traverse and generate other stacked serial number texts until the preceding serial number texts of all stacked text serial numbers are found to generate a converted serial number object.
[0134] In this embodiment, when the preceding serial number text is not found, cancel the generation of the stacked serial number text and place the stacked serial number text at the end of the stacked serial number text traversal set; traverse the stacked serial number texts in the stacked serial number text traversal set, and return to the step of generating the stacked serial number text until each stacked serial number text is merged into the preceding serial number text corresponding to each stacked serial number text to generate a converted serial number object; in this way, when the stacking mode of the stacked serial number texts in the serial number object to be converted is the separation mode, the stacked serial number text can be generated first, and then its corresponding preceding serial number text can be found. When the preceding serial number text cannot be found, cancel the generation of the stacked serial number text and place the stacked serial number text at the end of the stacked serial number text traversal set. By traversing other stacked serial number texts in the stacked serial number text traversal set, the stacking of the serial number text is realized, effectively avoiding the loss of the serial number text during the conversion of the serial number object caused by the misrecognition of the stacked serial number text, and ensuring the efficiency and accuracy of the conversion of the serial number object.
[0135] In an exemplary embodiment, the graphic primitive object to be converted includes a bill of materials object to be converted; according to the drawing source, determine the format conversion rules for each graphic primitive object in the drawing frame object to be converted, including: according to the drawing source, determine the block object attributes of all row data of each column bill of materials in the bill of materials object to be converted; when the block object attributes indicate that all row data of any column bill of materials belong to the same overall block object, determine the splitting method of the bill of materials object to be converted according to the number of overall block objects in the bill of materials object to be converted and the target point information of each overall block object in the bill of materials object to be converted; when the block object attributes indicate that all row data of any column bill of materials are single-row block objects, determine the splitting method of the bill of materials object to be converted according to the target point information of each single-row block object in the bill of materials object to be converted.
[0136] Among them, the bill of materials object to be converted may refer to a bill of materials that is not compatible with the image editing software.
[0137] Among them, the block object attributes may indicate whether the n row data of each column bill of materials are 1 overall block object or n single-row block objects. Figure 7 Exemplarily, a schematic diagram of a bill of materials object is provided. The bill of materials object is split into two columns, and all row data of each column bill of materials belong to an overall block object. Therefore, the bill of materials object is split into 2 columns, and the number of splits is 1.
[0138] Among them, the target point information of the overall block object may refer to any positioning point information of the overall block object. For example, the target point information of the overall block object may refer to Figure 7 the coordinate information corresponding to the upper right corner point shown, or the coordinate information corresponding to other positioning points not shown. In practical applications, as long as the selected points are consistent, for example, uniformly selecting the upper right corner point or the lower left corner point, the splitting method can be accurately determined.
[0139] Optionally, the server obtains the graphic primitive information of the bill of materials object to be converted. For a drawing scenario with multiple columns of bill of materials to be split, it is necessary to first determine the drawing source and distinguish whether the n row data of each column bill of materials are 1 overall block object or n single-row block objects. For the overall block object, determine whether there is a bill of materials split by counting the number of bill of materials block objects, and determine the number of bill of materials splits and the number of rows generated by each split by obtaining the number of rows of each bill of materials object and the target point information of the bill of materials object. For the single-row block object, determine whether there is a bill of materials split by calculating the target point information of each bill of materials object and judging whether the abscissa of this point is the same value, and determine the number of bill of materials splits and the number of rows generated by each split by calculating the number of differences in abscissa and the number of bill of materials rows with the same abscissa.
[0140] In this embodiment, the block object attributes of all the row data of each column of the detail list in the detail list object to be converted are determined according to the source of the drawing; when the block object attributes represent that all the row data of any column of the detail list belong to the same overall block object, the splitting method of the detail list object to be converted is determined according to the number of overall block objects in the detail list object to be converted and the target point information of each overall block object in the detail list object to be converted; when the block object attributes represent that all the row data of any column of the detail list are single-row block objects, the splitting method of the detail list object to be converted is determined according to the target point information of each single-row block object in the detail list object to be converted; in this way, it can be clearly determined whether the detail list object to be converted has been split and the splitting information, and the new detail list object in the same position can be completely restored in the converted drawing, avoiding the inefficient operation of only generating a new detail list object according to a single column when the splitting information cannot be determined, and then manually splitting the detail list again.
[0141] In another embodiment, Figure 8 As shown, a drawing format conversion method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0142] Step S802: when there is a drawing frame object to be converted in the current drawing, determine the file group code information of the drawing frame object, and determine the field information of the drawing source field in the file group code information.
[0143] Step S804, determining the drawing source of the current drawing according to the field information of the drawing source field; the current drawing includes graphic primitive objects to be converted that are incompatible with the drawing editing software.
[0144] Step S806: determining the format conversion rules of each graphic element object to be converted according to the drawing format conversion configuration information corresponding to the drawing source.
[0145] Step S808 , converting each primitive object to be converted using the format conversion rule corresponding to each primitive object to be converted, and obtaining a converted primitive object corresponding to each primitive object to be converted.
[0146] Step S810, generating a converted drawing corresponding to the current drawing according to the graphic element information corresponding to each converted graphic element object; the file format of the converted drawing is a compatible file format of the drawing editing software.
[0147] It should be noted that the specific limitations of the above steps can refer to the specific limitations of a drawing format conversion method mentioned above.
[0148] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0149] Based on the same inventive concept, an embodiment of the present application further provides a drawing format conversion device for implementing the above-mentioned drawing format conversion method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the drawing format conversion device provided below can refer to the limitations on the drawing format conversion method in the above text, and will not be repeated here.
[0150] In an exemplary embodiment, as Figure 9 shown, a drawing format conversion device is provided, including: a source determination module 902, a rule determination module 904, a primitive conversion module 906, and a drawing conversion module 908, where:
[0151] The source determination module 902 is configured to obtain the drawing source of the current drawing opened by the drawing editing software; the current drawing includes primitive objects to be converted that are not compatible with the drawing editing software;
[0152] The rule determination module 904 is configured to determine the format conversion rules for each primitive object to be converted according to the drawing format conversion configuration information corresponding to the drawing source;
[0153] The primitive conversion module 906 is configured to convert each primitive object to be converted by using the format conversion rule corresponding to each primitive object to be converted to obtain a converted primitive object corresponding to each primitive object to be converted;
[0154] The drawing conversion module 908 is configured to generate a converted drawing corresponding to the current drawing according to the primitive information corresponding to each converted primitive object; the file format of the converted drawing is a compatible file format of the drawing editing software.
[0155] In an exemplary embodiment, the source determination module 902 is specifically configured to, when there is a drawing frame object to be converted in the current drawing, determine the file group code information of the drawing frame object, and determine the field information of the drawing source field in the file group code information; and determine the drawing source of the current drawing according to the field information of the drawing source field.
[0156] In an exemplary embodiment, the rule determination module 904 is specifically configured to, when the drawing source corresponds to a standard drawing, obtain the drawing format conversion configuration information corresponding to the standard drawing; and determine the format conversion rules for each drawing element object to be converted according to the format conversion parameters in the drawing format conversion configuration information.
[0157] In an exemplary embodiment, the drawing element object to be converted includes a title bar object to be converted. The rule determination module 904 is specifically configured to, when the drawing source corresponds to multiple standard drawings, determine a target standard drawing that matches the graphic information of the title bar object to be converted from each standard drawing; obtain the drawing format conversion configuration information corresponding to the target standard drawing, and determine the format conversion rules for each drawing element object to be converted according to the format conversion parameters in the drawing format conversion configuration information corresponding to the target standard drawing.
[0158] In an exemplary embodiment, the rule determination module 904 specifically includes: for any one of the standard drawings of each standard drawing, obtain the title bar information of the title bar object of the any one of the standard drawings; and when the title bar information of the title bar object to be converted matches the title bar information of the title bar object of the any one of the standard drawings, determine the any one of the standard drawings as the target standard drawing.
[0159] In an exemplary embodiment, the title bar information of the title bar object to be converted includes the title bar size, the title bar table structure, and the title bar custom area of the title bar object to be converted. The apparatus further includes: a verification module, specifically configured to perform matching based on whether the title bar size of the title bar object to be converted is the same as the title bar size of any one of the standard drawings to obtain a first matching result; when the first matching result indicates successful matching, perform matching based on whether the title bar table structure of the title bar object to be converted is the same as the title bar table structure of any one of the standard drawings to obtain a second matching result; when the second matching result indicates successful matching, perform matching based on whether the title bar custom area of the title bar object to be converted is the same as the title bar custom area corresponding to any one of the standard drawings to obtain a third matching result; and when the third matching result indicates successful matching, determine that any one of the standard drawings matches the title bar information of the title bar object to be converted.
[0160] In an exemplary embodiment, the primitive object to be transformed includes a serial number object to be transformed; the serial number object to be transformed is a block object including at least one serial number text; the primitive information of the serial number object to be transformed includes the serial number text and the serial number stacking state; the primitive transformation module 906 is specifically configured to, when the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the serial number object to be transformed is the overall mode, determine the first serial number text of the serial number object to be transformed according to the serial number text of the serial number object to be transformed; the overall mode indicates that each stacked serial number text belongs to the same block object; using the first serial number text as the base serial number text, merge the other serial number texts in the serial number object to be transformed into the base serial number text in sequence to generate a transformed serial number object; the other serial number texts are the serial number texts in the serial number object to be transformed except the first serial number text.
[0161] In an exemplary embodiment, the device further includes: an object generation module, configured to, when the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the serial number object to be transformed is the separation mode, generate any stacked serial number text, and find the preceding serial number text of the stacked serial number text according to the position coordinates of the serial number marking point of the stacked serial number text; the separation mode indicates that each stacked serial number text is an independent block object; when the preceding serial number text is found, merge and stack the stacked serial number text onto the preceding serial number text to generate a transformed serial number object.
[0162] In an exemplary embodiment, the object generation module is further configured to, when the preceding serial number text is not found, cancel the generation of the stacked serial number text, and place the stacked serial number text at the end of the stacked serial number text traversal set; traverse the stacked serial number texts in the stacked serial number text traversal set, and return to the step of generating the stacked serial number text until each stacked serial number text is merged into the corresponding preceding serial number text of each stacked serial number text to generate a transformed serial number object.
[0163] In an exemplary embodiment, the primitive object to be transformed includes a bill of materials object to be transformed; the rule determination module 904 is specifically configured to determine the block object attributes of all row data of each column of the bill of materials in the bill of materials object to be transformed according to the drawing source; when the block object attribute indicates that all row data of any column of the bill of materials belong to the same overall block object, determine the splitting method of the bill of materials object to be transformed according to the number of overall block objects in the bill of materials object to be transformed and the target point information of each overall block object in the bill of materials object to be transformed; when the block object attribute indicates that all row data of any column of the bill of materials are single-row block objects, determine the splitting method of the bill of materials object to be transformed according to the target point information of each single-row block object in the bill of materials object to be transformed.
[0164] Each module in the above-mentioned drawing format conversion device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of a computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0165] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 10 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store drawing format conversion data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a drawing format conversion method.
[0166] Those skilled in the art can understand that Figure 10 the structure shown in
[0167] is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0168] In an embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above-mentioned drawing format conversion method. Here, the steps of the drawing format conversion method can be the steps in the drawing format conversion method of each of the above embodiments.
[0169] In one embodiment, a computer program product is provided, including a computer program which, when executed by a processor, causes the processor to perform the steps of the above-mentioned method for converting a drawing format. The steps of the method for converting a drawing format here may be the steps of the method for converting a drawing format in each of the above embodiments.
[0170] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, a database, or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0171] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0172] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for converting drawing formats, characterized in that, The method includes: Obtaining the drawing source of the current drawing opened by the drawing editing software; the current drawing includes to-be-converted primitive objects incompatible with the drawing editing software; the to-be-converted primitive objects are primitive objects that cannot be edited and modified by the drawing editing software in the current drawing; the to-be-converted primitive objects include a to-be-converted drawing frame object and a to-be-converted title bar object; Determining the format conversion rules for each of the to-be-converted primitive objects according to the drawing format conversion configuration information corresponding to the drawing source, including: determining the format conversion rules corresponding to the to-be-converted drawing frame object and the to-be-converted title bar object respectively according to the drawing format conversion configuration information corresponding to the drawing source; Converting each of the to-be-converted primitive objects by using the format conversion rules corresponding to each of the to-be-converted primitive objects to obtain converted primitive objects corresponding to each of the to-be-converted primitive objects, including: converting the format of the to-be-converted drawing frame object by using the format conversion rule corresponding to the to-be-converted drawing frame object to obtain a converted drawing frame object, and converting the format of the to-be-converted title bar object by using the format conversion rule corresponding to the to-be-converted title bar object to obtain a converted title bar object; Generating a converted drawing corresponding to the current drawing according to the primitive information corresponding to each of the converted primitive objects, including: generating a converted drawing corresponding to the current drawing according to the primitive information corresponding to the converted drawing frame object and the converted title bar object respectively; the file format of the converted drawing is a compatible file format of the drawing editing software.
2. The method according to claim 1, characterized in that, The obtaining the drawing source of the current drawing opened by the drawing editing software includes: Determining the file group code information of the to-be-converted drawing frame object, and determining the field information of the drawing source field in the file group code information; Determining the drawing source of the current drawing according to the field information of the drawing source field.
3. The method according to claim 1, wherein The determining the format conversion rules for each of the to-be-converted primitive objects according to the drawing format conversion configuration information corresponding to the drawing source includes: When the drawing source corresponds to a standard drawing, obtaining the drawing format conversion configuration information corresponding to the standard drawing; Determining the format conversion rules for each of the to-be-converted primitive objects according to the format conversion parameters in the drawing format conversion configuration information.
4. The method according to claim 1, wherein The determining the format conversion rules for each of the to-be-converted primitive objects according to the drawing format conversion configuration information corresponding to the drawing source includes: When the drawing source corresponds to multiple standard drawings, determining a target standard drawing that matches the title bar information of the to-be-converted title bar object among the standard drawings; Obtaining the drawing format conversion configuration information corresponding to the target standard drawing, and determining the format conversion rules for each of the to-be-converted primitive objects according to the format conversion parameters in the drawing format conversion configuration information corresponding to the target standard drawing.
5. The method according to claim 4, wherein The determining a target standard drawing that matches the title bar information of the to-be-converted title bar object among the standard drawings includes: For any one of the standard drawings, obtain the title bar information of the title bar object of the any one of the standard drawings; When the title bar information of the to-be-converted title bar object matches the title bar information of the title bar object of the any one of the standard drawings, use the any one of the standard drawings as the target standard drawing.
6. The method according to claim 5, characterized in that, The title bar information of the to-be-converted title bar object includes the title bar size, the title bar table structure, and the title bar custom area of the to-be-converted title bar object. The method further includes: Based on whether the title bar size of the to-be-converted title bar object is the same as the title bar size of the any one of the standard drawings, perform matching to obtain a first matching result; When the first matching result indicates successful matching, based on whether the title bar table structure of the to-be-converted title bar object is the same as the title bar table structure of the any one of the standard drawings, perform matching to obtain a second matching result; When the second matching result indicates successful matching, based on whether the title bar custom area of the to-be-converted title bar object is the same as the corresponding title bar custom area of the any one of the standard drawings, perform matching to obtain a third matching result; When the third matching result indicates successful matching, determine that the any one of the standard drawings matches the title bar information of the to-be-converted title bar object.
7. The method according to claim 1, wherein The to-be-converted primitive object includes a to-be-converted serial number object; the to-be-converted serial number object is a block object including at least one serial number text; the primitive information of the to-be-converted serial number object includes the serial number text and the serial number stacking state; Using the format conversion rules corresponding to each of the to-be-converted primitive objects to convert each of the to-be-converted primitive objects to obtain the converted primitive objects corresponding to each of the to-be-converted primitive objects, including: When the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the to-be-converted serial number object is the overall mode, determine the first serial number text of the to-be-converted serial number object according to the serial number text of the to-be-converted serial number object; The overall mode indicates that each of the stacked serial number texts belongs to the same block object; Using the first serial number text as the base serial number text, merge the other serial number texts in the to-be-converted serial number object into the base serial number text in sequence to generate a converted serial number object; The other serial number texts are the serial number texts in the to-be-converted serial number object except the first serial number text.
8. The method according to claim 7, wherein The method further includes: When the serial number stacking state indicates that the stacking mode of the stacked serial number texts included in the to-be-converted serial number object is the separated mode, generate any one of the stacked serial number texts, and find the preceding serial number text of the stacked serial number text according to the position coordinates of the serial number marking point of the stacked serial number text; The separated mode indicates that each of the stacked serial number texts is an independent block object; When the preceding serial number text is found, merge and stack the stacked serial number text onto the preceding serial number text to generate the converted serial number object.
9. The method according to claim 8, wherein The method further includes: In the case where the pre-sequence number text is not found, cancel the generation of the stacked sequence number text and place the stacked sequence number text at the end of the stacked sequence number text traversal set; Traverse the stacked sequence number texts in the stacked sequence number text traversal set and return to the step of generating the stacked sequence number text until each of the stacked sequence number texts is merged into the corresponding pre-sequence number text of each of the stacked sequence number texts to generate the converted sequence number object.
10. The method according to claim 1, characterized in that, The to-be-converted graphic element object includes a to-be-converted bill of materials object; determining the format conversion rule for each to-be-converted graphic element object in the to-be-converted drawing frame object according to the drawing source includes: Determine the block object attributes of all row data of each column bill of materials in the to-be-converted bill of materials object according to the drawing source; In the case where the block object attributes indicate that all row data of any column bill of materials belong to the same overall block object, determine the splitting method of the to-be-converted bill of materials object according to the number of the overall block objects in the to-be-converted bill of materials object and the target point information of each of the overall block objects in the to-be-converted bill of materials object; In the case where the block object attributes indicate that all row data of any column bill of materials are single-row block objects, determine the splitting method of the to-be-converted bill of materials object according to the target point information of each single-row block object in the to-be-converted bill of materials object.
11. A drawing format conversion device, characterized in that, The device includes: A source determination module for obtaining the drawing source of the current drawing opened by the drawing editing software; the current drawing includes to-be-converted graphic element objects that are incompatible with the drawing editing software; the to-be-converted graphic element objects are graphic element objects that cannot be edited and modified by the drawing editing software in the current drawing; the to-be-converted graphic element objects include a to-be-converted drawing frame object and a to-be-converted title bar object; A rule determination module for determining the format conversion rules for each of the to-be-converted graphic element objects according to the drawing format conversion configuration information corresponding to the drawing source, including: determining the format conversion rules corresponding to the to-be-converted drawing frame object and the to-be-converted title bar object respectively according to the drawing format conversion configuration information corresponding to the drawing source; A graphic element conversion module for converting each of the to-be-converted graphic element objects by using the format conversion rules corresponding to each of the to-be-converted graphic element objects to obtain the converted graphic element objects corresponding to each of the to-be-converted graphic element objects, including: performing format conversion on the to-be-converted drawing frame object by using the format conversion rule corresponding to the to-be-converted drawing frame object to obtain a converted drawing frame object, and performing format conversion on the to-be-converted title bar object by using the format conversion rule corresponding to the to-be-converted title bar object to obtain a converted title bar object; A drawing conversion module for generating a converted drawing corresponding to the current drawing according to the graphic element information corresponding to each of the converted graphic element objects, including: generating a converted drawing corresponding to the current drawing according to the graphic element information corresponding to the converted drawing frame object and the converted title bar object respectively; the file format of the converted drawing is the compatible file format of the drawing editing software.
12. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for converting various graphic model file formats into uniform format, and equipment
CN113536739A