A method and system for batch modifying the title blocks and drawing labels of CAD drawings

By sorting the format and attribute judgment of CAD drawings, modifying the frames and charts in batches, and using coordinate conversion algorithms to automatically process, the problem of inefficient drawing modification in the power industry is solved, and efficient and accurate charts and chart modifications are achieved.

CN119830114BActive Publication Date: 2025-07-08四川电力设计咨询有限责任公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510307762.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-07-08
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

In the prior art, the frames and diagram formats of transmission line engineering drawings in the power industry are diverse, resulting in low efficiency of manual modification and error-prone, making it difficult to achieve comprehensive and accurate modification and replacement.

Method used

By sorting the CAD drawings in a consistent format, loading the drawings in batches, judging the block or non-block properties of the drawing frame and drawings, calculating the drawing frame and identifying the drawing information, and using the coordinate conversion algorithm to accurately extract and modify the drawing frame and drawing information, and finally inserting the modified drawings in the form of blocks.

Benefits of technology

Automatic batch modification of drawing frames and drawings is realized, which improves modification efficiency and accuracy, and solves the problems of inefficiency and error-proneness in manual processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830114B_ABST
    Figure CN119830114B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for batch modifying the title blocks and drawing labels of CAD drawings to solve the problems of low efficiency and easy errors in the existing manual batch modification of the title blocks and drawing labels of CAD drawings, and relates to the technical field of data processing. A method for batch modifying the formats of the title blocks and drawing labels of CAD drawings includes: batch loading CAD drawings with the same format of any type of drawing label in the CAD drawings to be modified; judging the block and non-block attributes of the title blocks and drawing labels of the loaded CAD drawings; performing sheet size calculation on the CAD drawings according to the judged title block attributes of the CAD drawings, and identifying the drawing label information of the CAD drawings according to the judged drawing label attributes of the CAD drawings; inserting the modified title blocks and drawing labels into the CAD drawings in the form of blocks respectively to modify and replace the title blocks and drawing labels with inconsistent formats and requirements. The present invention improves the modification efficiency and accuracy of the title blocks and drawing labels of the drawings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and specifically to a method and system for batch modifying the title blocks and drawing labels of CAD drawings. Background Art

[0002] With the rapid development of the power industry, the number of transmission line projects has been increasing day by day. Especially with the extensive layout of ultra-high voltage projects, the delivery volume of transmission line engineering drawings has shown an explosive growth trend. In joint design projects such as ultra-high voltage projects, the sources of drawings are diversified and involve multiple design institutes. When delivering project drawings, it is necessary to uniformly convert the drawings of other design institutes into the standard title block and drawing label formats of the using institute.

[0003] However, the design styles of title blocks and drawing labels in each design institute are very different, and the format and style specifications are also quite different. Traditional processing methods rely on manual modification and replacement of each drawing one by one. This operation method not only consumes a large amount of manpower and time and has extremely low efficiency, but also is prone to errors due to the limitations of manual operations, and the situation of missing some information is also common. Although some simple text information can be processed through the conventional find and replace function, in the face of a large number of various title block and drawing label formats, traditional methods are powerless and difficult to achieve comprehensive and accurate modification and replacement. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for batch modifying the title blocks and drawing labels of CAD drawings to solve the problems of low efficiency and easy errors in the existing manual batch modification of the title blocks and drawing labels of CAD drawings.

[0005] The technical solution adopted by the present invention to solve its technical problems is: A method for batch modifying the title blocks and drawing labels of CAD drawings, including:

[0006] S1. Classify the CAD drawings to be modified according to the classification principle of grouping those with the same drawing label format into one category;

[0007] S2. Batch load the CAD drawings with the same drawing label format in any category of the CAD drawings to be modified;

[0008] S3. Judge the block and non-block attributes of the title blocks and drawing labels of the loaded CAD drawings to determine whether the title blocks and drawing labels of the loaded CAD drawings are block or non-block attributes;

[0009] S4. Calculate the drawing size of the title blocks of the CAD drawings according to the judged title block attributes of the CAD drawings, and identify the drawing label information of the CAD drawings according to the judged drawing label attributes of the CAD drawings; where:

[0010] When calculating the drawing format of the CAD drawing frame based on the judged drawing frame attributes of the CAD drawing, for the CAD drawing with the drawing frame being a block, calculate the drawing format of the CAD drawing frame by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing; for the CAD drawing with the drawing frame being non-block, first confirm the composition form of the drawing frame of the CAD drawing to confirm whether it is enclosed by 4 straight line segments or closed by a polyline, and then calculate its drawing format according to its drawing frame composition form; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, calculate the drawing format of the CAD drawing frame by obtaining the starting and ending coordinates of each constituent line segment of the drawing frame of the CAD drawing; if the drawing frame of the CAD drawing is closed by a polyline, calculate the drawing format of the CAD drawing frame by extracting the coordinates of each point of the polyline;

[0011] When identifying the title block information of the CAD drawing according to the judged title block attributes of the CAD drawing, for the CAD drawing with the title block attribute being a block, identify each information category of its title block according to the attribute tags of its title block, and extract the attribute values corresponding to each information category; for the CAD drawing with the title block attribute being non-block, the steps are as follows:

[0012] Arbitrarily select a CAD drawing from the CAD drawings with the title block attribute being non-block, and calculate the relative coordinates of the regions where each information category of the title block of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing;

[0013] According to the calculated relative coordinates and the coordinates of the lower right corner point of the drawing frame of each CAD drawing, use the coordinate conversion algorithm to calculate the actual region coordinates of each information region of the title block of each CAD drawing, and locate and extract the text information corresponding to the regions where each information category of the title block of each CAD drawing is located according to the calculated actual region coordinates of each information region of the title block of each CAD drawing;

[0014] S5. Insert the modified drawing frame and title block into the CAD drawing in the form of blocks respectively to modify and replace the drawing frame and title block whose formats and requirements are inconsistent, and output the attribute values of each information attribute of the title block of each extracted CAD drawing or the text information set by the user to the corresponding attribute values of its title block;

[0015] S6. Repeat steps S2 to S5 to replace and modify the drawing frames and title blocks of the remaining various types of CAD drawings in turn until the modification of the remaining various types of CAD drawings is completed.

[0016] Furthermore, arbitrarily select a CAD drawing from the CAD drawings with the title block attribute being non-block, and calculate the relative coordinates of the regions where each information category of the title block of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing, including:

[0017] From the selected CAD drawings, frame the areas where each information category of the title block is located;

[0018] Respectively extract the actual coordinate data of the areas where each information category of the title block of the framed CAD drawings is located;

[0019] Obtain the coordinates of the lower right corner point of the drawing frame of the selected CAD drawing to serve as the reference point for the areas where each information category of the title block of this CAD drawing is located;

[0020] Use the actual coordinates of the areas where each information category is located in combination with the coordinates of the lower right corner point of the drawing frame to calculate the relative coordinates of the areas where each information category of the title block of the selected CAD drawing is located.

[0021] Furthermore, for the CAD drawing whose drawing frame is not a block, confirming that its drawing frame is enclosed by 4 straight line segments includes the steps of:

[0022] Traverse all the straight line segments in the CAD drawing, and obtain their starting point and ending point coordinates and calculate their lengths;

[0023] According to the calculated lengths, screen out the straight line segments that can form a preset drawing frame from the straight line segments;

[0024] According to the starting point and ending point coordinates of the screened straight line segments, check whether there is a situation where 4 straight line segments are connected end to end in sequence and closed into a rectangular drawing frame. If so, the drawing frame is enclosed by 4 straight line segments.

[0025] Furthermore, for the CAD drawing whose drawing frame is not a block, confirming that its drawing frame is closed by a polyline includes the steps of:

[0026] Traverse all the polylines in the CAD drawing whose total length exceeds the preset value, and obtain the coordinates of each point of each polyline;

[0027] According to the coordinates of each point of the obtained polyline, check whether the polyline is in a closed state;

[0028] According to the coordinates of each point of the closed polyline, screen out the polylines that conform to the characteristics of a rectangular drawing frame from the closed polylines;

[0029] According to the coordinates of each point of the polyline that conforms to the characteristics of a rectangular drawing frame, judge whether the lengths of its segments are the same as the requirements of the preset drawing frame size range. If so, the drawing frame is closed by a polyline.

[0030] Furthermore, judging the block and non-block attributes of the drawing frame of the CAD drawing includes:

[0031] Traverse all the blocks in the CAD drawing, extract the minimum and maximum point coordinates of each block, and calculate the size of each block;

[0032] Based on the minimum standard drawing frame size, screen the blocks, and screen out the blocks whose size is greater than or equal to the minimum standard drawing frame;

[0033] Compare the size of the screened blocks with the preset drawing frame size. If there is a match between the block size and the preset drawing frame size, the drawing frame of the CAD drawing is of block attribute; if not, the drawing frame of the CAD drawing is of non-block attribute.

[0034] Further, for the CAD drawing whose drawing frame is a block, the calculation formula for the drawing format of the drawing frame is:

[0035] , ,

[0036] where L is the length of the drawing frame, B is the width of the drawing frame, , are the horizontal and vertical coordinate values of the maximum point of the drawing frame respectively, , are the horizontal and vertical coordinate values of the minimum point of the drawing frame respectively, and β is the allowable deviation value.

[0037] Further, the coordinate conversion algorithm is:

[0038] The actual coordinates of the upper left point of the title block information area Start(X,Y):

[0039] Start(X,Y) = right(X1,Y1)+offset(X2,Y2);

[0040] The actual coordinates of the lower right point of the title block information area End(X,Y):

[0041] End(X,Y) = right(X1,Y1)+offset(X3,Y3);

[0042] where:

[0043] right(X1,Y1) is the coordinate of the lower right corner point of the drawing frame;

[0044] offset(X2,Y2) is the relative coordinate of the upper left corner point of the title block information area;

[0045] offset(X3,Y3) is the relative coordinate of the lower right corner point of the title block information area.

[0046] A system for batch modifying the drawing frames and title blocks of CAD drawings according to the present invention includes:

[0047] An attribute judgment module for performing the above S3 step;

[0048] An information extraction module for performing the above S4 step; and,

[0049] A modification module for performing the above S5 step.

[0050] The beneficial effects of the present invention are as follows: In the method for batch modifying the title blocks and drawing labels of CAD drawings of the present invention, after classifying the CAD drawings according to the title block format, and then aiming at the possible different attributes of the title blocks and drawing labels of each type of CAD drawing, first perform block or non-block attribute judgment, and then process according to different attribute situations. Finally, modify and replace the title block and drawing label of the drawing in the form of a block, and input and assign the text information of each area of the drawing label of each drawing to the attribute value of the corresponding attribute label of the newly inserted and modified title block of the drawing, realizing that the entire processing process mainly relies on the program to complete automatically, and can accurately identify, extract and modify the information of each area of the title block and drawing label with different attributes of different CAD drawings, ensuring the accuracy and comprehensiveness of the processing results, solving the problems of low efficiency and easy errors in manual processing of the modification of CAD drawing title blocks and drawing labels, and improving the modification efficiency and accuracy of the drawing title block and drawing label. Description of the Drawings

[0051] Figure 1 is the flowchart of the method of the present invention; Detailed Embodiments

[0052] The present invention will be further described below with reference to the drawings and embodiments.

[0053] As Figure 1 shown, a method for batch modifying the title blocks and drawing labels of CAD drawings of the present invention includes:

[0054] S1. Classify the CAD drawings whose title blocks or / and drawing labels need to be modified according to the classification principle of grouping into one category with the same title block format (CAD drawings with the same title block format are classified into the same category);

[0055] S2. Batch load any category of CAD drawings with the same title block format among the CAD drawings that need to be modified;

[0056] S3. Perform block and non-block attribute judgment on the title blocks and drawing labels of the loaded CAD drawings to judge whether the title blocks and drawing labels of the loaded CAD drawings are block or non-block attributes;

[0057] S4. Calculate the drawing format of the CAD drawing according to the detected drawing frame attributes of the CAD drawing, and identify the title block information of the CAD drawing according to the detected title block attributes of the CAD drawing; wherein:

[0058] When calculating the drawing format of the drawing frame of the CAD drawing according to the detected drawing frame attributes of the CAD drawing, for the CAD drawing with the drawing frame being a block, by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing, and then using the coordinate values of the minimum and maximum points, the drawing format of the CAD drawing can be calculated; for the CAD drawing with the drawing frame being non-block, first confirm the composition form of the drawing frame of the CAD drawing to confirm whether it is enclosed by 4 straight line segments or formed by a polyline closure, and then calculate its drawing format according to its drawing frame composition form; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, then first obtain the starting and ending point coordinates of each component line segment of the drawing frame of the CAD drawing, and then use the corresponding subtraction of the starting and ending point coordinates (subtracting the abscissa value from the abscissa value, and subtracting the ordinate value from the ordinate value) to calculate the length and width of the drawing frame of the CAD drawing, and further judge the drawing format; if the drawing frame of the CAD drawing is formed by a polyline closure, then first extract the coordinates of each point of the polyline, and then calculate the length of each side through the coordinate values of each point, and further judge the drawing format of the CAD drawing;

[0059] When identifying the title block information of the CAD drawing according to the detected title block attributes of the CAD drawing, for the CAD drawing with the title block attribute being a block, identify each information category according to the attribute labels (such as "project name", "drawing number", "scale", etc.) of the title block, and extract the attribute values corresponding to each information category (such as project name, drawing number, scale, etc.), and this attribute value is the title block information of the CAD drawing; for the CAD drawing with the title block attribute being non-block, the steps are as follows:

[0060] a. Arbitrarily select a CAD drawing from the CAD drawings with the title block attribute being non-block, and calculate the relative coordinates of the regions where each information category of the title block of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing;

[0061] b. According to the relative coordinates and the coordinates of the lower right corner point of the drawing frame of each CAD drawing, use the coordinate conversion algorithm to calculate the actual region coordinates of each information region of the title block of each CAD drawing, and locate and extract the text information (such as project name, drawing number, scale, etc.) corresponding to the regions where each information category of the title block of each CAD drawing is located according to the calculated actual region coordinates of each information region of the title block of each CAD drawing;

[0062] S5. Insert the modified drawing frame and title block into the CAD drawing in the form of blocks respectively to modify and replace the drawing frame and title block whose formats do not meet the requirements, and output the information attribute values of each title block of the extracted CAD drawings or the text information set by the user to the corresponding attribute values of the title block corresponding to it;

[0063] S6. Repeat steps S2 to S5 to replace and modify the drawing frames and title blocks of the remaining types of CAD drawings in turn until the modification of the remaining types of CAD drawings is completed.

[0064] For the convenience of uniformly modifying the project name, date, and design stage data in the later stage, in this step, the modified drawing frame and title block can also be inserted into the CAD drawing in the form of an external reference block to modify and replace the drawing frame and title block whose formats do not meet the requirements. At this time, the information attribute values of each title block of the extracted CAD drawings (except for the project name, date, and design stage that may need to be modified in the later stage, and these data will be uniformly placed in the external reference block) will be output in text form to the corresponding positions in the modified title block.

[0065] Step S1 of the present invention is completed by manual recognition. In practice, the same design institute or unit usually uses the same format of title blocks and drawing frames. When classifying CAD drawings, the drawings of the same design institute or unit can usually be classified into one category, and the workload completed manually is also small.

[0066] In step S4: The sheet size calculation based on the judged drawing frame attributes of the CAD drawing and the recognition of the title block information of the CAD drawing based on the judged title block attributes of the CAD drawing can be carried out successively or synchronously. For the purpose of improving the processing speed, it is preferred to carry them out synchronously.

[0067] The method for batch modifying the drawing frames and title blocks of CAD drawings according to the present invention first classifies the CAD drawings according to the title block format, and then, for the possible different attribute situations of the drawing frames and title blocks of each type of CAD drawing, first judges the block or non-block attributes, and then processes according to different attribute situations. Finally, the modified drawing frames and title blocks are replaced and modified in the form of blocks to replace the drawing frame and title block of the drawing, and the text information of each area of each title block of the extracted drawings is correspondingly input and assigned to the attribute values of the attribute labels corresponding to the newly inserted and modified title block of the drawing. The entire processing process is mainly automatically completed by the program, which can accurately identify, extract, and modify the information of each area of the drawing frames and title blocks with different attributes of different CAD drawings, ensuring the accuracy and comprehensiveness of the processing results, and solving the problems of low efficiency and easy errors in manual processing of the modification of CAD drawing frames and title blocks.

[0068] Select a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks. The specific steps for calculating the relative coordinates of the regions where each information category of the drawing label of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing are as follows:

[0069] a1. Frame out the regions where each information category of the drawing label of the selected CAD drawing is located from the selected CAD drawing;

[0070] a2. Extract the actual coordinate data of the regions where each information category of the drawing label of the framed-out CAD drawing is located respectively;

[0071] a3. Obtain the coordinates of the lower right corner point of the drawing frame of the selected CAD drawing as the reference point for the regions where each information category of the drawing label of the CAD drawing is located;

[0072] a4. Calculate the relative coordinates of the regions where each information category of the drawing label of the selected CAD drawing is located by using the actual coordinate data of the regions where each information category is located in combination with the coordinates of the lower right corner point of the drawing frame.

[0073] Taking the calculation of the relative coordinates of the drawing name region of the drawing label of the selected CAD drawing as an example: Since each region of the drawing label is square, the upper left point coordinates and the lower right point coordinates of the drawing name region in the drawing label can be extracted to determine the project name region of the drawing label (the region enclosed by the horizontal and vertical coordinates of the upper left point coordinates and the lower right point coordinates is the drawing name region in the drawing label). Assume that the upper left point coordinates of the drawing name region in the drawing label of the selected CAD drawing are (2, 9), the lower right point coordinates are (17, 6), and the coordinates of the lower right corner point of the drawing frame of the drawing label are (20, 1), then the relative coordinates of the drawing name region in the drawing label are (-18, 8), (-3, 5).

[0074] The above step a1 is to manually take out the regions where each information category of the drawing label of the framed-out CAD drawing is located.

[0075] For the CAD drawing whose drawing frame is a block, by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing, and then subtracting the abscissa value from the abscissa value and the ordinate value from the ordinate value of the minimum and maximum points, the length and width of the drawing frame of the CAD drawing can be calculated, and then the drawing size of the drawing frame can be calculated.

[0076] Considering that there may be errors in the drawing label information region, in order to improve the accuracy, in the embodiments of the present invention, for the CAD drawing whose drawing frame is a block, the calculation formula for the drawing size of the drawing frame is:

[0077] , ,

[0078] where, L is the length of the drawing frame, B is the width of the drawing frame, 、 They are the horizontal and vertical coordinate values of the maximum point of the drawing frame respectively , 、 They are the horizontal and vertical coordinate values of the minimum point of the drawing frame respectively , and β is the allowable deviation value. The value of β can be set by the user, and generally takes 1 - 2 units

[0079] The present invention specifically adopts the following method to confirm that the drawing frame of a CAD drawing that is not a block is enclosed by 4 straight line segments:

[0080] c1. Traverse all the straight line segments in the CAD drawing, and obtain the starting and ending coordinates of the straight line segments and calculate their lengths

[0081] c2. According to the calculated lengths, screen out the straight line segments that can form a preset drawing frame from the straight line segments

[0082] c3. According to the starting and ending coordinates of the screened straight line segments, check whether there is a situation where 4 straight line segments are sequentially connected end to end and closed into a rectangular drawing frame. If so, the drawing frame is enclosed by 4 straight line segments

[0083] The preset drawing frame is set according to the drawing size of the CAD drawing frame to be modified as required, and generally adopts the national standard or industry standard drawing frame size

[0084] For example: Assume that the preset drawing frame is an A2 - sized drawing frame. If the calculated length of the straight line segment is 420mm, which meets the A2 drawing frame size (594×420mm), then select it

[0085] To determine whether 4 closed straight line segments form a rectangular drawing frame, specifically through the following method: The y - coordinates of two horizontal sides are the same, and the x - coordinates of two vertical sides are the same

[0086] The present invention adopts the following method to confirm that the drawing frame of a CAD drawing that is not a block is enclosed by a polyline:

[0087] d1. Traverse all the polylines in the CAD drawing whose total length exceeds a preset value, and obtain the coordinates of each point of each polyline. The preset value is generally the width of the smallest standard drawing frame

[0088] d2. According to the obtained coordinates of each point of the polyline, check whether the polyline is in a closed state (closed if the starting and ending point coordinates are the same)

[0089] d3. According to the coordinates of each point of the closed polyline, screen out the polyline that meets the characteristics of a rectangular drawing frame from the closed polylines. If the polyline has the y - coordinates of horizontal sides the same and the x - coordinates of two vertical sides the same, then it meets the rectangular drawing frame

[0090] d4. Determine whether the lengths of all segments of the polyline that conforms to the characteristics of the rectangular frame are the same as the requirements of the preset frame size range based on the coordinates of each point of the polyline. If they are the same, it means that the frame is formed by closing the polyline. This step is the same as step c3 in principle and will not be elaborated specifically.

[0091] In some embodiments, it is also possible to determine whether the non-block frame is formed by closing a polyline only by judging whether the non-block frame is enclosed by 4 straight line segments. If the non-block frame is not enclosed by 4 straight line segments, it is considered that the non-block frame is formed by closing a polyline.

[0092] In some embodiments, it is determined whether the frame is composed of blocks by checking whether the block contains the relevant attributes of the frame or by checking whether the block is located in the layer related to the frame. In the embodiments of the present invention, the following specific method is used to judge the block and non-block attributes of the CAD drawing frame:

[0093] S31. Traverse all blocks in the CAD drawing, extract the minimum and maximum point coordinates of each block, and calculate the size of each block;

[0094] S32. Based on the minimum standard frame size, screen the blocks, and screen out the blocks whose size is greater than or equal to the minimum standard frame;

[0095] S33. Compare the size of the screened blocks with the preset frame size. If there is a match between the block size and the preset frame size, the frame of the CAD drawing is of block attribute; if not, the frame of the CAD drawing is of non-block attribute.

[0096] If the title block is a block, it can be judged whether it is a block by checking the block name of the title block or the value of the title block attribute label. If the block name of the title block or the value of the title block attribute label exists, it can be judged as a block; otherwise, it is judged as a non-block.

[0097] The coordinate conversion algorithm of the present invention is specifically as follows:

[0098] The actual coordinates of the upper left point of the title block information area Start(X, Y):

[0099] Start(X, Y) = right(X1, Y1)+offset(X2, Y2);

[0100] The actual coordinates of the lower right point of the title block information area End(X, Y):

[0101] End(X, Y) = right(X1, Y1)+offset(X3, Y3);

[0102] Where:

[0103] right(X1, Y1) is the coordinate of the lower right corner point of the frame;

[0104] offset(X2, Y2) is the relative coordinate of the upper left corner point of the drawing label information area;

[0105] offset(X3, Y3) is the relative coordinate of the lower right corner point of the drawing label information area.

[0106] That is, by adding the abscissa and ordinate values of the relative coordinates of the upper left corner point and the lower right corner point of each information area in the drawing label to the abscissa and ordinate values of the lower right corner point coordinates of the drawing frame of this drawing respectively (abscissa value plus abscissa value, ordinate value plus ordinate value), the actual coordinate values of the upper left corner point and the lower right corner point of this information area can be obtained.

[0107] The present invention also provides a system for batch modifying the drawing frame and drawing label of CAD drawings, including:

[0108] An attribute judgment module for performing the above-mentioned step S3;

[0109] An information extraction module for performing the above-mentioned step S4; and,

[0110] A modification module for performing the above-mentioned step S5.

Claims

1. A method for batch modifying the title block and drawing label of CAD drawings, characterized in that, Including: S1. Classify the CAD drawings to be modified according to the classification principle of classifying them into one category with consistent drawing label formats; S2. Batch load the CAD drawings with consistent drawing label formats in any one category among the CAD drawings to be modified; S3. Judge the block and non-block attributes of the drawing frames and drawing labels of the loaded CAD drawings, and judge that the drawing frames and drawing labels of the loaded CAD drawings are block or non-block attributes; S4. Calculate the drawing size of the drawing frame of the CAD drawing according to the judged drawing frame attribute of the CAD drawing, and identify the drawing label information of the CAD drawing according to the judged drawing label attribute of the CAD drawing; where: When calculating the drawing size of the drawing frame of the CAD drawing according to the judged drawing frame attribute of the CAD drawing, for the CAD drawing with the drawing frame being a block, calculate the drawing size of the drawing frame of the CAD drawing by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing; for the CAD drawing with the drawing frame being non-block, first confirm the composition form of the drawing frame of the CAD drawing to confirm whether it is enclosed by 4 straight line segments or closed by a polyline, and then calculate its drawing size according to the composition form of its drawing frame; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, calculate the drawing size of the drawing frame of the CAD drawing by obtaining the starting and ending coordinates of each constituent line segment of the drawing frame of the CAD drawing; if the drawing frame of the CAD drawing is closed by a polyline, calculate the drawing size of the drawing frame of the CAD drawing by extracting the coordinates of each point of the polyline; When identifying the drawing label information of the CAD drawing according to the judged drawing label attribute of the CAD drawing, for the CAD drawing with the drawing label attribute being a block, identify each information category of its drawing label according to the attribute label of its drawing label, and extract the attribute values corresponding to each information category; for the CAD drawing with the drawing label attribute being non-block, the steps are: Arbitrarily select a CAD drawing from the CAD drawings with the drawing label attribute being non-block, and calculate the relative coordinates of the regions where each information category of the drawing label of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing; According to the calculated relative coordinates and the coordinates of the lower right corner point of the drawing frame of each CAD drawing, use the coordinate conversion algorithm to calculate the actual region coordinates of each information region of the drawing label of each CAD drawing, and locate and extract the text information corresponding to the regions where each information category of the drawing label of each CAD drawing is located according to the calculated actual region coordinates of each information region of the drawing label of each CAD drawing; S5. Insert the modified drawing frames and drawing labels into the CAD drawings in the form of blocks respectively to modify and replace the drawing frames and drawing labels with inconsistent formats and requirements, and output the attribute values of each information attribute of the drawing labels of each CAD drawing or the text information set by the user to the corresponding attribute values of their drawing labels; S6. Repeat steps S2 to S5 to replace and modify the drawing frames and drawing labels of the remaining various types of CAD drawings in turn until the modification of the remaining various types of CAD drawings is completed.

2. The method for batch modifying the title blocks and drawing labels of CAD drawings according to claim 1, characterized in that Arbitrarily select a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks, and calculate the relative coordinates of the regions where each information category of the drawing label of the selected CAD drawing is located with respect to the coordinates of the lower right corner point of the drawing frame of the CAD drawing, including: Frame the regions where each information category of the drawing label of the selected CAD drawing is located from the selected CAD drawing; Extract the actual coordinate data of the regions where each information category of the drawing label of the framed CAD drawing is located respectively; Obtain the coordinates of the lower right corner point of the drawing frame of the selected CAD drawing as the reference point for the regions where each information category of the drawing label of the CAD drawing is located; Calculate the relative coordinates of the regions where each information category of the drawing label of the selected CAD drawing is located by combining the actual coordinates of the regions where each information category is located with the coordinates of the lower right corner point of the drawing frame.

3. A method for batch modifying the title block and drawing label of CAD drawings as described in claim 1, characterized in that, For the CAD drawing whose drawing frame is non-block, the steps to confirm that its drawing frame is enclosed by 4 straight line segments include: Traverse all the straight line segments in the CAD drawing, and obtain their starting and ending point coordinates and calculate their lengths; According to the calculated lengths, screen out the straight line segments that can form a preset drawing frame from the straight line segments; According to the starting and ending point coordinates of the screened straight line segments, check whether there are 4 straight line segments that are sequentially connected end to end and closed into a rectangular drawing frame. If so, the drawing frame is enclosed by 4 straight line segments.

4. A method for batch modifying the title block and drawing label of CAD drawings according to claim 1, characterized in that, For the CAD drawing whose drawing frame is non-block, the steps to confirm that its drawing frame is closed by a polyline include: Traverse all the polylines in the CAD drawing whose total length exceeds the preset value, and obtain the coordinates of each point of each polyline; Check whether the polyline is in a closed state according to the coordinates of each point of the obtained polyline; Screen out the polylines that conform to the characteristics of the rectangular drawing frame from the closed polylines according to the coordinates of each point of the closed polyline; Judge whether the lengths of each segment are the same as the requirements of the preset drawing frame size range according to the coordinates of each point of the polyline that conforms to the characteristics of the rectangular drawing frame. If so, the drawing frame is closed by a polyline.

5. A method for batch modifying the title blocks and drawing labels of CAD drawings according to claim 1, characterized in that, Judge the block and non-block attributes of the drawing frame of the CAD drawing, including: Traverse all the blocks in the CAD drawing, extract the minimum and maximum point coordinates of each block and calculate the size of each block; Based on the minimum standard drawing frame size, screen the blocks and screen out the blocks whose sizes are greater than or equal to the minimum standard drawing frame; Compare the sizes of the screened blocks with the preset drawing frame size. If there is a match between the block size and the preset drawing frame size, the drawing frame of the CAD drawing is of block attribute. If not, the drawing frame of the CAD drawing is of non-block attribute.

6. A method for batch modifying the title blocks and drawing labels of CAD drawings according to claim 1, characterized in that, For the CAD drawing whose drawing frame is a block, the calculation formula for the drawing format of the drawing frame is: , , Among them, L is the length of the drawing frame, and B is the width of the drawing frame. and are the horizontal and vertical coordinate values of the maximum point of the drawing frame respectively, and are the horizontal and vertical coordinate values of the minimum point of the drawing frame respectively, and β is the allowable deviation value.

7. A method for batch modifying the title block and drawing label of CAD drawings according to claim 1, characterized in that, The coordinate conversion algorithm is: The actual coordinates of the upper left point of the drawing label information area Start(X,Y): Start(X,Y) = right(X1,Y1)+offset(X2,Y2); The actual coordinates of the lower right point of the drawing label information area End(X,Y): End(X,Y) = right(X1,Y1)+offset(X3,Y3); Where: right(X1, Y1) is the coordinate of the lower right corner point of the drawing frame; offset(X2, Y2) is the relative coordinate of the upper left corner point of the title block information area; offset(X3, Y3) is the relative coordinate of the lower right corner point of the title block information area.

8. A system for batch modifying the title blocks and drawing notes of CAD drawings, characterized in that, It includes: An attribute judgment module, which is used to execute step S3 of a method for batch modifying the drawing frame and title block of CAD drawings as described in any one of claims 1 to 7; An information extraction module, which is used to execute step S4 of a method for batch modifying the drawing frame and title block of CAD drawings as described in any one of claims 1 to 7; And, A modification module, which is used to execute step S5 of a method for batch modifying the drawing frame and title block of CAD drawings as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Drawing frame title block designing method based on BIM technology

    CN106844885A

  • Drawing label identification method, system and device of drawing

    CN118410196A