A method for adjusting details of a drawing surface after converting a three-dimensional engineering drawing into a two-dimensional drawing
By automatically adjusting the blocks in the 3D engineering drawing after converting it to 2D paper using full drawing traversal and block traversal methods, the annotation problem is solved, ensuring that the drawing conforms to the standard and improving design efficiency.
Patent Information
- Application Number
- CN202311309867.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-10-09
AI Technical Summary
After converting 3D design engineering drawings into 2D drawings, annotation problems occur, such as roughness value offset and line overlap, chamfer dimension overlap, loss of datum compliance information, and loss of geometric tolerance leaders. These issues cause the drawings to fail to meet mechanical and enterprise drafting standards, requiring manual adjustments and affecting the design cycle and efficiency.
By employing full-drawing traversal and block traversal methods, and through software programming, AutoCAD is further developed to automatically adjust the converted blocks, including roughness, chamfer dimensions, datum symbols, geometric tolerances, local view annotations, technical requirements, center line symbols, and welding symbols, to ensure that the drawings conform to mechanical drawing standards.
The converted drawings conform to mechanical and enterprise drafting standards, avoiding manual adjustments and improving design efficiency.
Smart Images

Figure CN117372573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engineering drawing technology, and more specifically to a method for optimizing the details of a 3D engineering drawing after it has been converted to a 2D drawing. Background Technology
[0002] When converting 3D engineering drawings (such as SolidWorks) to AutoCAD 2D drawings, many annotations are automatically converted into blocks, which can lead to annotation problems such as roughness value offset and line overlap, chamfer dimension overlap, loss of datum compliance information, and loss of geometric tolerance leaders. These issues do not meet mechanical and enterprise drafting standards and cannot be used directly. The converted AutoCAD drawings also require designers to spend a lot of time making manual adjustments, which seriously affects the design cycle and the promotion and application of 3D design.
[0003] Therefore, there is an urgent need for a method that can automatically solve these detailed problems when converting three-dimensional engineering drawings into two-dimensional drawings. Summary of the Invention
[0004] In view of this, the present invention provides a method for optimizing the details of a 3D engineering drawing after it has been converted into a 2D drawing. This method solves the problems that exist in the conversion of drawings between different software, and makes the converted drawings conform to mechanical and enterprise drafting standards and meet the production requirements of enterprises. It also avoids the need for manual adjustment of the converted 2D drawings and improves design efficiency.
[0005] Therefore, the present invention provides the following technical solution:
[0006] This invention discloses a method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing. The method includes:
[0007] Obtain the 2D drawings converted from 3D engineering drawings;
[0008] Traverse the blocks in the converted 2D drawing and obtain the target block by block name; the target block includes one or more of the following: roughness block, chamfer dimension block, datum symbol block, geometric tolerance block, partial view annotation block, technical requirement block, center symbol line block, and welding symbol block.
[0009] Traverse the target map tiles to obtain their contents;
[0010] The target block is adjusted based on its content to optimize its surface roughness, chamfer dimensions, datum symbols, geometric tolerances, local view annotations, technical requirements, center symbol lines, and welding symbols.
[0011] Further, the target image block is a roughness image block, which includes: a multi-line text and three straight lines; or a multi-line text and four straight lines; accordingly, the target image block is adjusted based on its content, including:
[0012] Obtain the roughness type, roughness value, and coordinates of each line based on the content of the roughness map;
[0013] The roughness direction is determined based on the aforementioned linear coordinates;
[0014] The text style and subwidth ratio are set based on the roughness direction and the roughness value, and the text position is adjusted.
[0015] Further, the target image block is a chamfered dimension image block, which includes: three multi-line text blocks, a horizontal straight line, a diagonal straight line, and a solid line; correspondingly, the target image block is adjusted based on its content, including:
[0016] Obtain the coordinates of each line based on the contents of the chamfer dimension block;
[0017] Determine the direction of the chamfer dimension based on the coordinates of the lines mentioned above;
[0018] Remove spaces from three multi-line texts and combine them into one multi-line text;
[0019] The combined text style is set based on the direction of the chamfer size;
[0020] The length of the horizontal line and the position of the text are determined by the number of combined characters.
[0021] Adjust the position of the combined text according to the determined text position;
[0022] Clear the contents of the original three lines of text.
[0023] Further, the target image block is a reference symbol image block, which includes: a multi-line text, a circle, and a straight line; correspondingly, the target image block is adjusted based on its content, including:
[0024] The orientation and linear coordinates of the datum are obtained from the contents of the datum symbol block.
[0025] Multiple lines are drawn based on the orientation and linear coordinate position of the reference.
[0026] Further, the target block is a geometrical tolerance (GMT) block, which includes: GMT values and leader lines; correspondingly, the target block is adjusted based on its content, including:
[0027] Obtain the insertion point and profile of the geometric tolerance based on the content of the geometric tolerance block;
[0028] Determine the direction of geometric tolerances based on the coordinates of the extension line;
[0029] The tolerance insertion point is modified based on the geometric tolerance direction.
[0030] Further, the target block is a partial view annotation block, and the geometric tolerance block includes: a horizontal straight line and two multi-line texts; correspondingly, the target block is adjusted based on its content, including:
[0031] Obtain the coordinates of the horizontal line based on the content of the annotation block in the partial view, and determine the length of the line;
[0032] Get the insertion point and content of multi-line text;
[0033] The position of the multi-line text is determined based on the difference between the length of the straight line and the width of the multi-line text.
[0034] Further, the target image block is a technical requirement image block, which includes: multi-line text; correspondingly, the target image block is adjusted based on its content, including:
[0035] Obtain multi-line text content and coordinates based on the content of the block according to technical requirements;
[0036] Determine whether it is a technical requirement block based on the content of the first multi-line text;
[0037] The system determines whether multiple lines of text are on the same line based on their coordinates, and then adjusts the text position to achieve alignment.
[0038] Assign the correct child width ratio to the text.
[0039] Furthermore, the target image block is a center symbol line image block, and accordingly, the target image block is adjusted based on its content, including:
[0040] Obtain the centerline length based on the content of the center symbol line block;
[0041] When the centerline length is less than the set value, its linear scale is set to the ratio of the length to the set value, and the layer is set.
[0042] Furthermore, the target block is a welding symbol block, and accordingly, the target block is adjusted based on its content, including:
[0043] Based on the content of the welding symbol block, determine the full circumference, custom symbols, basic weld symbols, baseline, weld height, weld length, number of welds, and tail; among them, custom symbols are automatically converted into sub-blocks, with their positions shifted to the lower right corner, and the text has a phenomenon of shifting to the upper left corner;
[0044] The direction of the welding symbol is obtained through the baseline coordinates;
[0045] Adjust the position to the top left corner based on the coordinates of the custom symbol;
[0046] Adjust the text position according to the orientation of the welding symbols, the coordinates of the basic weld symbols, the text content, and whether there is tail information.
[0047] Furthermore, the three-dimensional engineering drawing is an engineering drawing created using the three-dimensional software SolidWorks;
[0048] The two-dimensional drawing is an AutoCAD two-dimensional drawing.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] This invention solves the problem of block issues on the drawing surface after converting three-dimensional engineering drawings to two-dimensional drawings, and provides a specific solution to ensure that the converted drawings meet mechanical and enterprise drafting standards and enterprise production requirements. It also avoids the need for manual adjustment of the converted two-dimensional drawings, thus improving work efficiency. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart of roughness optimization in an embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of the roughness before optimization in an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram showing the roughness after optimization in an embodiment of the present invention;
[0055] Figure 4 This is a flowchart illustrating the chamfer dimension overlap processing in an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the chamfer dimensions before overlap processing in an embodiment of the present invention;
[0057] Figure 6 This is a schematic diagram showing the chamfer dimensions after overlap processing in an embodiment of the present invention;
[0058] Figure 7 This is a schematic diagram of the form and position tolerances before adjustment in an embodiment of the present invention;
[0059] Figure 8 This is a schematic diagram showing the adjusted geometric tolerances in an embodiment of the present invention;
[0060] Figure 9 This is a schematic diagram of the partial view before text adjustment in an embodiment of the present invention;
[0061] Figure 10 This is a schematic diagram showing the text adjustment in a partial view according to an embodiment of the present invention. Detailed Implementation
[0062] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0063] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0064] This invention analyzes the annotation problems that occur when SolidWorks 3D engineering drawings are converted to AutoCAD 2D drawings. It uses software programming to perform secondary development of AutoCAD, and adopts full drawing traversal and block traversal methods to adjust the annotation problems one by one through the program, so that the converted drawings meet mechanical drawing standards and meet the production needs of enterprises.
[0065] This invention provides a method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing. The method includes the following steps:
[0066] S1. Obtain the 2D drawing after converting the 3D engineering drawing;
[0067] S2. Traverse the blocks in the converted 2D drawing and obtain the target block by block name;
[0068] The target blocks include one or more of the following: roughness block, chamfer dimension block, datum symbol block, geometric tolerance block, partial view annotation block, technical requirement block, center symbol line block, and welding symbol block.
[0069] S3. Traverse the target map tiles and obtain the content of the target map tiles;
[0070] S4. Adjust the target block based on its content to optimize its roughness, chamfer size, datum symbol, geometric tolerance, local view annotation, technical requirements, center symbol line, and welding symbol.
[0071] To facilitate understanding, the following provides a detailed explanation of the optimization of the image details after each conversion.
[0072] (1) Roughness numerical offset and line overlap processing;
[0073] There are two main problems with roughness annotation: one is that the numbers overlap with the lines, and the other is that the width of the numbers exceeds the line limits. Roughness annotation directions can be horizontal, vertical, or angled, while text tends to shift to the left. Therefore, determining the roughness annotation direction is crucial.
[0074] Roughness is automatically converted into a block in the converted AutoCAD drawing, named "SW_SFSYMBOL". This block has two composition types: the first type consists of a multi-line text and three straight lines, and the second type consists of a multi-line text and four straight lines. The first type appears in horizontal or vertical annotations, and the second type appears in annotations with leader lines.
[0075] Based on the above characteristics, such as Figure 1 As shown, the roughness tuning process includes:
[0076] S11. Traverse all blocks in the converted engineering drawing;
[0077] S12. Extract the content of the block named "SW_SFSYMBOL";
[0078] S13. Obtain the roughness type, roughness value, and coordinates of each line based on the block content;
[0079] S14. Determine the roughness direction based on linear coordinates;
[0080] S15. Set text style, subwidth ratio, etc., under the condition that the direction and value are determined;
[0081] S16. Adjust the text position.
[0082] Comparison before and after roughness optimization process Figure 2 and 3 Clearly, after roughness optimization, the numbers and lines no longer overlap, and the width of the numbers does not exceed the line range.
[0083] (2) Chamfer dimensions overlap processing;
[0084] The main problems with chamfer dimensions are text overlap and large text spacing. In the converted AutoCAD drawing, the chamfer dimensions are automatically converted into a block named "SW_CHAMFER_DIMENSION". This block consists of multiple parts. The numerical part mainly consists of three multi-line texts, namely "×", the value before "×", and the value after "×". The remaining content includes a horizontal line, a diagonal line, and a solid line (when there is an arrow).
[0085] Based on this characteristic, such as Figure 4 As shown, the chamfer dimension optimization process includes:
[0086] S21. Obtain the chamfered dimension block;
[0087] S22. Obtain the content of the block by traversal;
[0088] S23. Determine the direction of the chamfer dimension based on the linear coordinates;
[0089] S24. Remove the spaces from the three multi-line texts and combine them into one multi-line text.
[0090] S25. Set the style for grouped text;
[0091] S26. Determine the length of the horizontal line, the position of the text, etc., based on the number of combined characters;
[0092] S27. Adjust the position of the combined text according to the determined text position of the combined text;
[0093] S28. Clear the contents of the original three lines of text.
[0094] Before and after chamfering size optimization, comparison example Figure 5 , 6 Clearly, after the chamfer size was optimized, the text no longer overlapped, and the text spacing was reduced.
[0095] (3) Handling of benchmark conformity information loss:
[0096] A complete datum feature symbol consists of four parts. The datum is mainly arranged in four directions on the drawing: top, bottom, left, and right. After converting to AutoCAD, the polyline in the datum is lost.
[0097] After the datum symbol is converted to an AutoCAD drawing, it is automatically converted into a block named "SW_DATUMTAG". This block consists of a multiline text, a circle and a straight line, and the polyline is lost.
[0098] Based on this characteristic, the methods for handling benchmark conformity information loss include:
[0099] S31. Obtain the orientation and linear coordinate position of the reference by traversing the blocks;
[0100] S32. Draw polylines based on the orientation and linear coordinate position of the reference.
[0101] (4) Separation of geometric tolerance leaders and symbols:
[0102] Geometric tolerances can be divided into horizontal leaders and leaders with broken lines according to the form of the leader line. The annotation method mainly adopts horizontal annotation, and the orientation can be left or right. When the text style in the geometric tolerance changes, the leader line may separate from the geometric tolerance.
[0103] In AutoCAD, the corresponding name for geometric tolerances is "AcDbFcf". Methods for separating geometric tolerance values from leader lines include:
[0104] S41. Obtain the insertion point and profile of the geometric tolerance by traversing the data.
[0105] S42. Determine the direction of geometric tolerances based on the coordinates of the extension line;
[0106] S43. Modify the tolerance insertion point. Comparison before and after geometric tolerance adjustment. Figure 7 , 8 As shown, it is clear that after adjusting the geometric tolerances, the separation of the leader line from the geometric tolerances is avoided.
[0107] (5) Handling text position offset and content misalignment in partial views;
[0108] When annotations in partial views are converted to AutoCAD drawings, there is an offset problem, with the upper and lower parts of the content not aligned, which is unsightly.
[0109] In the converted AutoCAD drawing, the annotations for the partial view are stored as blocks named "SW_NOTE". The block content contains a horizontal line and two lines of text.
[0110] The process of adjusting text in a partial view includes:
[0111] S51. Obtain the coordinates of the horizontal line and determine the length of the line;
[0112] S52. Obtain the insertion point and content of multi-line text;
[0113] S53. Determine the position of the multi-line text based on the difference between the length of the straight line and the width of the multi-line text.
[0114] Comparison of text before and after adjustment in partial view Figure 9 , 10 Clearly, adjusting the text in the local view avoids the problem of annotation offset in the local view.
[0115] (6) Handling overlapping text and content exceeding the drawing size in technical requirements;
[0116] During the design process, certain related dimensions are often specified in the technical requirements of the drawings. After being converted into AutoCAD drawings, problems such as overlapping text and incorrect text width ratios causing text to exceed the drawing size may occur.
[0117] In AutoCAD drawings, technical requirements are automatically converted into blocks named "SW_NOTE", which consist of multiple lines of text. One important feature that distinguishes technical requirement blocks is that the first member of the block contains "technical requirements", and the associated dimension text is offset to the upper left corner.
[0118] Based on these characteristics, the technical requirements for text processing methods include:
[0119] S61. Use the block traversal method to obtain the text content and coordinates of multiple lines;
[0120] S62. Determine whether the first multi-line text content is a technical requirement block;
[0121] S63. Determine whether multiple lines of text are on the same line based on their coordinates, and then adjust the text position to achieve alignment.
[0122] S64. Assign the correct child width ratio to the text.
[0123] (7) The linear proportion of the center line is unreasonable, and the center line is displayed as a solid line:
[0124] In the converted AutoCAD drawing, center symbols are converted into blocks named "SW_CENTERMARKSYMBOL" and placed on layer "0". Shorter center lines and center symbols are displayed as straight lines due to an unreasonable linear scale, affecting the display.
[0125] In AutoCAD drawings, the centerline is represented by the "CENTER" object. Centerline optimization methods include:
[0126] S71. Use a traversal method to obtain an object of type "CENTER" and name "SW_CENTERMARKSYMBOL", and obtain the centerline length;
[0127] S72. When the centerline length is less than the set value, set its linear ratio to length / set value and set the layer.
[0128] (8) Method for handling overlapping welding symbols:
[0129] In the converted AutoCAD drawing, the welding symbols are changed to blocks and leaders, with the block name being "SW_WELDSYMBOL". The main problems are overlap or large distance between text and lines, and custom symbols.
[0130] Overlapping welding symbols processing includes:
[0131] S81. Obtain information from the block using a traversal method, including the entire circumference, custom symbols, basic weld symbols, baseline (solid line), baseline (dashed line), weld height, weld length, number of welds, and tail section. Custom symbols are automatically converted to sub-blocks and shifted to the lower right corner, while text shifts to the upper left corner.
[0132] S82. Obtain the welding symbol direction (left or right) through the baseline coordinates;
[0133] S83. Adjust the position to the upper left corner according to the coordinates of the custom symbol;
[0134] S84. Adjust the text position based on information such as the orientation of the welding symbol, the coordinates of the basic weld symbol, the text content, and whether there is a tail.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing, characterized in that... The method includes: Obtain the 2D drawings converted from 3D engineering drawings; Traverse the blocks in the converted 2D drawing and obtain the target block by block name; the target block includes one or more of the following: roughness block, chamfer dimension block, datum symbol block, geometric tolerance block, partial view annotation block, technical requirement block, center symbol line block, and welding symbol block. Traverse the target map tiles to obtain their contents; The target block is adjusted based on its content to optimize its surface roughness, chamfer dimensions, datum symbols, geometric tolerances, local view annotations, technical requirements, center symbol lines, and welding symbols. The target block is a reference symbol block, which includes: a multi-line text, a circle, and a straight line. Accordingly, the target block is adjusted based on its content, including: obtaining the orientation and straight line coordinate position of the reference according to the content of the reference symbol block; and drawing multiple lines based on the orientation and straight line coordinate position of the reference.
2. The method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing, as described in claim 1, is characterized in that... The target image block is a roughness image block, which includes: a multi-line text and three straight lines; or a multi-line text and four straight lines; accordingly, the target image block is adjusted based on its content, including: Obtain the roughness type, roughness value, and coordinates of each line based on the content of the roughness map; The roughness direction is determined based on the aforementioned linear coordinates; The text style and subwidth ratio are set based on the roughness direction and the roughness value, and the text position is adjusted.
3. The method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing, as described in claim 1, is characterized in that... The target image block is a chamfered dimension image block, which includes: three multi-line text blocks, a horizontal straight line, a diagonal straight line, and a solid line; correspondingly, the target image block is adjusted based on its content, including: Obtain the coordinates of each line based on the contents of the chamfer dimension block; Determine the direction of the chamfer dimension based on the coordinates of the lines mentioned above; Remove spaces from three multi-line texts and combine them into one multi-line text; The combined text style is set based on the direction of the chamfer size; The length of the horizontal line and the position of the text are determined by the number of combined characters. Adjust the position of the combined text according to the determined text position; Clear the contents of the original three lines of text.
4. The method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing, as described in claim 1, is characterized in that... The target block is a geometrical tolerance (GMT) block, which includes: geometrical tolerance values and leader lines; correspondingly, the target block is adjusted based on its content, including: Obtain the insertion point and profile of the geometric tolerance based on the content of the geometric tolerance block; Determine the direction of geometric tolerances based on the coordinates of the extension line; The tolerance insertion point is modified based on the geometric tolerance direction.
5. The method for optimizing the details of a drawing after converting a three-dimensional engineering drawing to a two-dimensional drawing, as described in claim 1, is characterized in that... The target block is a partial view annotation block, and the geometric tolerance block includes: a horizontal straight line and two multi-line text blocks; accordingly, the target block is adjusted based on its content, including: Obtain the coordinates of the horizontal line based on the content of the annotation block in the partial view, and determine the length of the line; Get the insertion point and content of multi-line text; The position of the multi-line text is determined based on the difference between the length of the straight line and the width of the multi-line text.
6. The method for optimizing the details of a 3D engineering drawing after converting it to a 2D drawing, as described in claim 1, is characterized in that... The target image block is a technical requirement image block, which includes: multi-line text; accordingly, the target image block is adjusted based on its content, including: Obtain multi-line text content and coordinates based on the content of the block according to technical requirements; Determine whether it is a technical requirement block based on the content of the first multi-line text; The system determines whether multiple lines of text are on the same line based on their coordinates, and then adjusts the text position to achieve alignment. Assign the correct child width ratio to the text.
7. The method for optimizing the details of a drawing after converting a three-dimensional engineering drawing to a two-dimensional drawing according to claim 1, characterized in that, The target image block is a center symbol line image block. Accordingly, the target image block is adjusted based on its content, including: Obtain the centerline length based on the content of the center symbol line block; When the centerline length is less than the set value, its linear scale is set to the ratio of the length to the set value, and the layer is set.
8. The method for optimizing the details of a drawing after converting a three-dimensional engineering drawing to a two-dimensional drawing according to claim 1, characterized in that, The target block is a welding symbol block. Accordingly, the target block is adjusted based on its content, including: Based on the content of the welding symbol block, determine the full circumference, custom symbols, basic weld symbols, baseline, weld height, weld length, number of welds, and tail; among them, custom symbols are automatically converted into sub-blocks, with their positions shifted to the lower right corner, and the text has a phenomenon of shifting to the upper left corner; The direction of the welding symbol is obtained through the baseline coordinates; Adjust the position to the top left corner based on the coordinates of the custom symbol; Adjust the text position according to the orientation of the welding symbols, the coordinates of the basic weld symbols, the text content, and whether there is tail information.
9. The method for optimizing the details of a three-dimensional engineering drawing after converting it to a two-dimensional drawing, as described in any one of claims 1 to 8, is characterized in that... The three-dimensional engineering drawing is an engineering drawing created using the three-dimensional software SolidWorks; The two-dimensional drawing is an AutoCAD two-dimensional drawing.
Citation Information
Patent Citations
Three-dimensional grid simplifying method and device, electronic equipment and storage medium
CN112614228A
Defect removal from manufactured objects having morphed surfaces
US20210034961A1
