Method and system for modifying drawing frames and drawing labels of CAD drawings in batches
By sorting the format and attribute judgment of CAD drawings, and batch modifying their frames and drawings, the problems of inefficiency and error prone in the existing technology are solved, and efficient and accurate drawing modifications are achieved.
Patent Information
- Application Number
- CN202510307762.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-03-17
AI Technical Summary
In the prior art, manual batch modification of CAD drawing frames and drawings is inefficient and prone to errors, making it difficult to achieve comprehensive and accurate modification and replacement.
By sorting the CAD drawings in a consistent format, loading in batches and judging block and non-block attributes, calculating the diagram frame and identifying the diagram information, and finally modifying the diagram frame and diagram of the replacement drawing in the form of blocks.
It realizes batch modification of CAD drawing frames and drawing signs, improves processing efficiency and accuracy, and avoids errors and omissions in manual operations.
Smart Images

Figure CN119830114A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for batch modifying drawing frames and drawing labels of CAD drawings. Background Art
[0002] With the rapid development of the power industry, the number of transmission line projects is increasing day by day, especially the widespread layout of UHV projects, which has led to an explosive growth in the delivery of transmission line engineering drawings. In joint design projects such as UHV, the sources of drawings are diversified and involve multiple design institutes. When project drawings are delivered, the drawings of other design institutes need to be uniformly converted into the standard drawing frame and drawing label format of the using institute. However, each design institute has different styles in the design of drawing frames and drawing labels, and the formats and style specifications are also very different. The traditional processing method relies on manual modification and replacement of each drawing. This operation method not only consumes a lot of manpower and time, but is also extremely inefficient. In addition, due to the limitations of manual operation, it is very easy to make mistakes, and it is not uncommon to miss some information. Although some simple text information can be processed through conventional search and replace functions, in the face of a large number of various drawing frame and drawing label formats, the traditional method seems to be unable to cope with it and it is difficult to achieve comprehensive and accurate modification and replacement. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and system for batch modifying CAD drawing frames and drawing labels, so as to solve the problem that the existing manual batch modification of CAD drawing frames and drawing labels is low in efficiency and prone to errors.
[0004] The technical solution adopted by the present invention to solve the technical problem is: a method for batch modifying CAD drawing frames and drawing labels, comprising: S1. Classify the CAD drawings that need to be modified according to the classification principle that the drawing labels are classified into the same category; S2. Batch load any type of CAD drawings that need to be modified and have the same drawing label format; S3, performing block and non-block attribute judgment on the drawing frame and drawing label of the loaded CAD drawing, and judging whether the drawing frame and drawing label of the loaded CAD drawing are block or non-block attributes; S4, calculating the drawing frame of the CAD drawing according to the determined drawing frame attributes of the CAD drawing, and identifying the drawing label information of the CAD drawing according to the determined drawing label attributes of the CAD drawing; wherein: When calculating the drawing width of the drawing frame of the CAD drawing according to the determined drawing frame attribute of the CAD drawing, for the CAD drawing whose drawing frame is a block, the drawing width of the drawing frame of the CAD drawing is calculated by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing; for the CAD drawing whose drawing frame is not a 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 polylines, and then calculate its drawing width according to its drawing frame composition form; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, the drawing width of the drawing frame of the CAD drawing is calculated by obtaining the starting point and end point coordinates of each line segment of the drawing frame of the CAD drawing; if the drawing frame of the CAD drawing is closed by polylines, the drawing width of the drawing frame of the CAD drawing is calculated by extracting the coordinates of each point of the polylines; When identifying the drawing label information of the CAD drawing according to the determined drawing label attribute of the CAD drawing, for the CAD drawing whose drawing label attribute is a block, identify each information category of the drawing label according to the attribute label of the drawing label, and extract the attribute value corresponding to each information category; for the CAD drawing whose drawing label attribute is a non-block, the steps are: Selecting a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks, and calculating the relative coordinates of the area where each information category of the drawing label of the selected CAD drawing is located relative 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, the actual area coordinates of each information area of the drawing label of each CAD drawing are calculated using a coordinate conversion algorithm, and the text information corresponding to the area where each information category of the drawing label of each CAD drawing is located is located and extracted according to the calculated actual area coordinates of each information area of the drawing label of each CAD drawing; S5, inserting the modified drawing frame and drawing label into the CAD drawing in the form of blocks to modify and replace the drawing frame and drawing label whose formats are inconsistent with the requirements, and outputting the extracted information attribute values of the drawing label of each CAD drawing or the text information set by the user to the attribute values corresponding to the drawing label; S6. Repeat steps S2 to S5 to replace and modify the drawing frames and drawing labels of the remaining types of CAD drawings in turn, until the modification of the remaining types of CAD drawings is completed.
[0005] Further, a CAD drawing is selected from the CAD drawings whose drawing label attributes are non-block, and the relative coordinates of the area where each information category of the drawing label of the selected CAD drawing is located relative to the coordinates of the lower right corner point of the drawing frame of the CAD drawing are calculated, including: Select from the selected CAD drawing the area where each information category of the drawing label is located; Respectively extract the actual coordinate data of the area where each information category of the drawing label of the CAD drawing selected by the box is located; Obtaining the coordinates of the lower right corner point of the selected CAD drawing frame as a reference point for the area where each information category of the drawing label of the CAD drawing is located; The actual coordinates of the extracted areas where the various information categories are located are combined with the coordinates of the lower right corner point of the drawing frame to calculate the relative coordinates of the areas where the various information categories of the drawing label of the selected CAD drawing are located.
[0006] Further, for the CAD drawing whose frame is not a block, confirming that its frame is enclosed by 4 straight line segments comprises the steps of: Traverse all straight line segments in the CAD drawing, obtain the coordinates of their starting and ending points and calculate their lengths; According to the calculated length, the straight line segments that can form a preset frame are selected from the straight line segments; According to the starting point and end point coordinates of the screened straight line segments, check whether there are four straight line segments that overlap end to end and close into a rectangular frame. If so, the frame is enclosed by four straight line segments.
[0007] Furthermore, for the CAD drawing whose drawing frame is not a block, confirming that its drawing frame is closed by polylines comprises the steps of: Traversing all polylines in the CAD drawing whose total length exceeds a preset value, and obtaining the coordinates of each point of each polyline; Checking whether the polyline is in a closed state according to the acquired coordinates of each point of the polyline; Filter out polylines that meet the rectangular frame characteristics from the polylines in the closed state according to the coordinates of each point of the polylines in the closed state; According to the coordinates of each point of the polyline that meets the characteristics of the rectangular frame, it is determined whether the length of each segment is the same as the preset frame size range requirement. If they are the same, the frame is formed by the closed polyline.
[0008] Furthermore, the block and non-block attributes of the drawing frame of the CAD drawing are judged, including: Traversing all blocks in the CAD drawing, extracting the minimum and maximum point coordinates of each block and calculating the size of each block; Based on the minimum standard frame size, the blocks are screened to select blocks whose size is greater than or equal to the minimum standard frame; The filtered block size is compared with the preset frame size. If the block size matches the preset frame size, the frame of the CAD drawing is a block attribute. If not, the frame of the CAD drawing is a non-block attribute.
[0009] Furthermore, for the CAD drawing whose frame is a block, the calculation formula of the frame size is: , , Where L is the length of the frame, B is the width of the frame, , The maximum points of the frame The horizontal and vertical coordinate values of , The minimum points of the frame The horizontal and vertical coordinate values are as follows, and β is the allowable deviation value.
[0010] Furthermore, the coordinate conversion algorithm is: The actual coordinates of the upper left point of the 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 label information area End(X,Y): End(X,Y) = right(X1,Y1)+offset(X3,Y3); in: right(X1,Y1) is the coordinate of the lower right corner of the frame; Offset(X2,Y2) is the relative coordinate of the upper left corner of the label information area; offset(X3,Y3) is the relative coordinate of the lower right corner of the label information area.
[0011] A system for batch modifying CAD drawing frames and drawing labels of the present invention comprises: An attribute judgment module, used to execute the above step S3; An information extraction module, used to execute the above step S4; and The module is modified to execute the above step S5.
[0012] The beneficial effect of the present invention is as follows: the method for batch modifying CAD drawing frames and labels of the present invention first classifies CAD drawings according to the label format, and then for each type of CAD drawing, the frames and labels may have different attributes, first performs block or non-block attribute judgment, and then processes the different attribute situations, and finally modifies the frames and labels in the form of blocks to replace the frames and labels of the drawings, and inputs and assigns the corresponding text information of each area of the extracted drawing labels to the attribute value of the corresponding attribute label of the newly inserted and modified label block of the drawing, so that the entire processing process is mainly completed automatically by the program, and can accurately identify, extract and modify the regional information of frames, sheets and labels of different attributes of different CAD drawings, thereby ensuring the accuracy and comprehensiveness of the processing results, solving the problem of low efficiency and error-proneness in manual processing of CAD drawing frame and label modification, and improving the modification efficiency and accuracy of drawing frames and labels. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flow chart of the method of the present invention; DETAILED DESCRIPTION
[0014] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0015] like Figure 1 As shown, a method for batch modifying CAD drawing frames and drawing labels of the present invention comprises: S1. Classify the CAD drawings whose drawing frames and / or drawing labels need to be modified according to the classification principle that the drawing labels with the same format are classified into one category (CAD drawings with the same drawing label format are classified into the same category); S2. Batch load any type of CAD drawings that need to be modified and have the same drawing label format; S3, performing block and non-block attribute judgment on the drawing frame and drawing label of the loaded CAD drawing, and judging whether the drawing frame and drawing label of the loaded CAD drawing are block or non-block attributes; S4, calculating the frame and width of the CAD drawing according to the determined frame attributes of the CAD drawing, and identifying the label information of the CAD drawing according to the determined label attributes of the CAD drawing; wherein: When calculating the drawing width of the drawing frame of the CAD drawing according to the determined drawing frame attributes of the CAD drawing, for the CAD drawing whose drawing frame is a block, the drawing width of the drawing frame of the CAD drawing can be calculated 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; for the CAD drawing whose drawing frame is not a 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 polylines, and then calculate the drawing width of the drawing frame according to its drawing frame composition form. The drawing width is calculated by the formula; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, the starting point and end point coordinates of each line segment of the drawing frame of the CAD drawing are firstly obtained, and then the length and width of the drawing frame of the CAD drawing are calculated by subtracting the corresponding coordinates of the starting point and the end point (the horizontal coordinate value minus the horizontal coordinate value, and the vertical coordinate value minus the vertical coordinate value), and then the drawing width is determined; if the drawing frame of the CAD drawing is closed by polyline, the coordinates of each point of the polyline are firstly extracted, and then the length of each side is calculated by the coordinate values of each point, and then the drawing width of the drawing frame of the CAD drawing is determined; When identifying the drawing label information of the CAD drawing according to the determined drawing label attribute of the CAD drawing, for the CAD drawing whose drawing label attribute is a block, identify its various information categories according to the attribute labels of its drawing label (such as "project name", "drawing number", "scale", etc.), and extract the attribute values corresponding to its various information categories (such as project name, drawing number, scale, etc.), and the attribute values are the drawing label information of the CAD drawing; for the CAD drawing whose drawing label attribute is non-block, the steps are: a. Selecting a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks, and calculating the relative coordinates of the area where each information category of the drawing label of the selected CAD drawing is located relative to the coordinates of the lower right corner point of the CAD drawing frame; b. Calculate the actual area coordinates of each information area of the drawing label of each CAD drawing using a coordinate conversion algorithm according to the relative coordinates and the coordinates of the lower right corner point of the drawing frame of each CAD drawing, and locate and extract the text information (such as project name, drawing number, scale, etc.) corresponding to the area where each information category of the drawing label of each CAD drawing is located according to the calculated actual area coordinates of each information area of the drawing label of each CAD drawing; S5, inserting the modified drawing frame and drawing label into the CAD drawing in the form of blocks to modify and replace the drawing frame and drawing label whose formats are inconsistent with the requirements, and outputting the extracted information attribute values of the drawing label of each CAD drawing or the text information set by the user to the attribute values corresponding to the drawing label; S6. Repeat steps S2 to S5 to replace and modify the drawing frames and drawing labels of the remaining types of CAD drawings in turn, until the modification of the remaining types of CAD drawings is completed.
[0016] In order to facilitate the unified modification of the project name, date and design stage data in the later stage, this step can also insert the modified drawing frame and drawing label into the CAD drawing in the form of an external reference block to modify and replace the drawing frame and drawing label whose format is inconsistent with the requirements. At this time, the information attribute values of each CAD drawing label extracted (except the project name, date, and design stage that may need to be modified later, these data will be uniformly placed in the external reference block) will be output in the form of text to the corresponding position in the modified drawing label.
[0017] The step S1 of the present invention relies on manual identification. In practice, the same design institute or unit usually uses the same format of drawing labels and drawing frames. When classifying CAD drawings, the drawings of the same design institute or unit are usually classified into one category, and the workload of manual work is also small.
[0018] In step S4, the drawing size calculation according to the determined drawing frame attributes of the CAD drawing and the identification of the drawing label information of the CAD drawing according to the determined drawing label attributes of the CAD drawing can be performed successively or simultaneously. In order to increase the processing speed, the two are preferably performed simultaneously.
[0019] The method for batch modifying CAD drawing frames and labels of the present invention first classifies CAD drawings according to label formats, and then for each type of CAD drawing frame and label that may have different attributes, first performs block or non-block attribute judgment, and then processes according to different attribute situations, and finally replaces the modified drawing frame and label with the modified drawing frame and label in the form of blocks, and inputs and assigns corresponding values to the attribute values of the attribute labels of the newly inserted and modified label blocks of the drawings. The entire processing process is mainly completed automatically by the program, and can accurately identify, extract and modify the information of each area of the frames, sheets and labels of different attributes of different CAD drawings, thereby ensuring the accuracy and comprehensiveness of the processing results, and solving the problems of low efficiency and easy errors in manual processing of CAD drawing frame and label modification.
[0020] The specific steps of selecting a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks and calculating the relative coordinates of the areas where the drawing labels of the selected CAD drawing are located relative to the coordinates of the lower right corner point of the drawing frame of the CAD drawing are: a1. Select the area where each information category of the drawing label is located from the selected CAD drawing; a2. respectively extracting the actual coordinate data of the area where each information category of the drawing label of the CAD drawing selected by the frame is located; a3. Obtain the coordinates of the lower right corner of the drawing frame of the selected CAD drawing as the reference point of the area where each information category of the CAD drawing label is located; a4. Calculate the relative coordinates of the areas where each information category of the selected CAD drawing label is located by using the actual coordinate data of the areas where each information category is located in combination with the coordinates of the lower right corner point of the drawing frame.
[0021] Take the relative coordinate calculation of the name area of the selected CAD drawing label as an example: since each area of the label is square, the project name area of the label can be determined by extracting the coordinates of the upper left point and the lower right point of the name area in the label (the area enclosed by the horizontal and vertical coordinates of the upper left point and the lower right point is the name area in the label). Assuming that the coordinates of the upper left point of the name area in the selected CAD drawing label are (2,9), the coordinates of the lower right point are (17,6), and the coordinates of the lower right corner of the label frame are (20,1), the relative coordinates of the name area in the label are (-18,8), (-3,5).
[0022] The above step a1 is to manually select the area where each information category is located in the CAD drawing label by taking out the box.
[0023] For the CAD drawing whose frame is a block, the length and width of the CAD drawing frame can be calculated by obtaining the minimum and maximum point coordinates of the CAD drawing frame block, and then subtracting the horizontal coordinate value from the horizontal coordinate value of the minimum and maximum points and subtracting the vertical coordinate value from the vertical coordinate value, thereby calculating the size of the frame.
[0024] Considering that there may be errors in the frame drawing signature information area, in order to improve the accuracy, in the embodiment of the present invention, for the CAD drawing in which the frame is a block, the calculation formula of the frame drawing is: , , Where L is the length of the frame, B is the width of the frame, , The maximum points of the frame The horizontal and vertical coordinate values of , The minimum points of the frame The horizontal and vertical coordinate values of the measurement are shown in Figure 1, and β is the allowable deviation value. The β value can be set by the user and is generally 1-2 units.
[0025] The present invention specifically adopts the following method to confirm that the drawing frame is a non-block CAD drawing whose drawing frame is surrounded by 4 straight line segments: c1. Traverse all straight line segments in the CAD drawing, obtain the coordinates of the starting point and the end point of the straight line segment and calculate its length; c2. selecting straight line segments that can form a preset frame from the straight line segments according to the calculated length; c3. Based on the starting point and end point coordinates of the screened straight line segments, check whether there are four straight line segments that overlap end to end and close into a rectangular frame. If so, the frame is enclosed by four straight line segments.
[0026] The preset drawing frame is set according to the drawing size of the CAD drawing frame that needs to be modified, and generally adopts the national standard or industry standard frame size.
[0027] For example: Assuming the preset drawing frame is an A2 size frame, if the calculated length of the straight line segment is 420mm, which meets the A2 frame size (594×420mm), it will be selected.
[0028] Determine whether the four closed straight line segments form a rectangular frame, specifically in the following way: the y coordinates of the two horizontal sides are the same, and the x coordinates of the two vertical sides are the same.
[0029] The present invention uses the following method to confirm that the drawing frame is a non-block CAD drawing whose drawing frame is closed by polylines: d1. Traverse all 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 minimum standard drawing frame; d2. Check whether the polyline is in a closed state according to the obtained coordinates of each point of the polyline (if the coordinates of the first and last points are the same, the polyline is closed); d3. According to the coordinates of each point of the polyline in the closed state, a polyline that meets the characteristics of a closed rectangular frame is selected from the polyline in the closed state. If the polyline has the same horizontal edge y coordinate and the same two vertical edges x coordinate, it meets the rectangular frame; d4. According to the coordinates of each point of the polyline that meets the characteristics of the rectangular frame, determine whether the length of each segment is the same as the preset frame size range. If they are the same, the frame is closed by the polyline. This step has the same principle as step c3 and will not be elaborated on again.
[0030] In some embodiments, whether the non-block frame is enclosed by a polyline can also be determined only by determining 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 enclosed by a polyline.
[0031] In some embodiments, whether a frame is composed of blocks is determined by checking whether the block contains the relevant attributes of the frame or checking whether the block is located in a layer related to the frame. In an embodiment of the present invention, the following method is specifically used to determine the block and non-block attributes of the CAD drawing frame: S31, traversing all blocks in the CAD drawing, extracting the minimum and maximum point coordinates of each block and calculating the size of each block; S32, screening the blocks based on the minimum standard frame size, and screening out blocks whose size is greater than or equal to the minimum standard frame; S33, comparing the screened block size with the preset frame size, if the block size matches the preset frame size, the frame of the CAD drawing is a block attribute, if not, the frame of the CAD drawing is a non-block attribute.
[0032] The block name or attribute tag value of the tag can be checked to determine whether it is a block. If the block name or attribute tag value of the tag exists, it can be determined to be a block, otherwise it is determined to be non-block.
[0033] The coordinate conversion algorithm of the present invention is specifically: The actual coordinates of the upper left point of the 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 label information area End(X,Y): End(X,Y) = right(X1,Y1)+offset(X3,Y3); in: right(X1,Y1) is the coordinate of the lower right corner of the frame; Offset(X2,Y2) is the relative coordinate of the upper left corner of the label information area; offset(X3,Y3) is the relative coordinate of the lower right corner of the label information area.
[0034] That is, the relative coordinates of the upper left corner point and the lower right corner point of each information area in the drawing label are added to the horizontal and vertical coordinate values of the coordinates of the lower right corner point of the drawing frame (horizontal coordinate value plus horizontal coordinate value, vertical coordinate value plus vertical coordinate value) to obtain the actual coordinate values of the upper left corner point and the lower right corner point of the information area.
[0035] The present invention also provides a system for batch modifying CAD drawing frames and drawing labels, comprising: An attribute judgment module, used to execute the above step S3; An information extraction module, used to execute the above step S4; and The module is modified to execute the above step S5.
Claims
1. A method for batch modifying CAD drawing frames and drawing labels, characterized in that: include: S1. Classify the CAD drawings that need to be modified according to the classification principle that the drawing labels are classified into the same category; S2. Batch load any type of CAD drawings that need to be modified and have the same drawing label format; S3, performing block and non-block attribute judgment on the drawing frame and drawing label of the loaded CAD drawing, and judging whether the drawing frame and drawing label of the loaded CAD drawing are block or non-block attributes; S4, calculating the drawing frame of the CAD drawing according to the determined drawing frame attributes of the CAD drawing, and identifying the drawing label information of the CAD drawing according to the determined drawing label attributes of the CAD drawing; wherein: When calculating the drawing width of the drawing frame of the CAD drawing according to the determined drawing frame attribute of the CAD drawing, for the CAD drawing whose drawing frame is a block, the drawing width of the drawing frame of the CAD drawing is calculated by obtaining the minimum and maximum point coordinates of the drawing frame block of the CAD drawing; for the CAD drawing whose drawing frame is not a 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 polylines, and then calculate its drawing width according to the composition form of its drawing frame; if the drawing frame of the CAD drawing is enclosed by 4 straight line segments, the drawing width of the drawing frame of the CAD drawing is calculated by obtaining the starting point and end point 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 polylines, the drawing width of the drawing frame of the CAD drawing is calculated by extracting the coordinates of each point of the polylines; When identifying the drawing label information of the CAD drawing according to the determined drawing label attribute of the CAD drawing, for the CAD drawing whose drawing label attribute is a block, identify each information category of the drawing label according to the attribute label of the drawing label, and extract the attribute value corresponding to each information category; for the CAD drawing whose drawing label attribute is a non-block, the steps are: Selecting a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks, and calculating the relative coordinates of the area where each information category of the drawing label of the selected CAD drawing is located relative 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, the actual area coordinates of each information area of the drawing label of each CAD drawing are calculated using a coordinate conversion algorithm, and the text information corresponding to the area where each information category of the drawing label of each CAD drawing is located is located and extracted according to the calculated actual area coordinates of each information area of the drawing label of each CAD drawing; S5, inserting the modified drawing frame and drawing label into the CAD drawing in the form of blocks to modify and replace the drawing frame and drawing label whose formats are inconsistent with the requirements, and outputting the extracted information attribute values of the drawing label of each CAD drawing or the text information set by the user to the attribute values corresponding to the drawing label; S6. Repeat steps S2 to S5 to replace and modify the drawing frames and drawing labels of the remaining types of CAD drawings in turn, until the modification of the remaining types of CAD drawings is completed.
2. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: Selecting a CAD drawing from the CAD drawings whose drawing label attributes are non-blocks, and calculating the relative coordinates of the area where each information category of the drawing label of the selected CAD drawing is located relative to the coordinates of the lower right corner point of the drawing frame of the CAD drawing, including: Select from the selected CAD drawing the area where each information category of the drawing label is located; Respectively extract the actual coordinate data of the area where each information category of the drawing label of the CAD drawing selected by the box is located; Obtaining the coordinates of the lower right corner point of the drawing frame of the selected CAD drawing as reference points for the areas where each information category of the drawing label of the CAD drawing is located; The actual coordinates of the extracted areas where the various information categories are located are combined with the coordinates of the lower right corner point of the drawing frame to calculate the relative coordinates of the areas where the various information categories of the drawing label of the selected CAD drawing are located.
3. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: For the CAD drawing whose drawing frame is not a block, confirming that its drawing frame is enclosed by 4 straight line segments comprises the following steps: Traverse all straight line segments in the CAD drawing, obtain the coordinates of their starting and ending points and calculate their lengths; According to the calculated length, the straight line segments that can form a preset frame are selected from the straight line segments; According to the starting point and end point coordinates of the screened straight line segments, check whether there are four straight line segments that overlap end to end and close into a rectangular frame. If so, the frame is enclosed by four straight line segments.
4. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: For the CAD drawing whose drawing frame is not a block, confirming that its drawing frame is closed by a polyline comprises the following steps: Traversing all polylines in the CAD drawing whose total length exceeds a preset value, and obtaining the coordinates of each point of each polyline; Checking whether the polyline is in a closed state according to the acquired coordinates of each point of the polyline; Filter out polylines that meet the rectangular frame characteristics from the polylines in the closed state according to the coordinates of each point of the polylines in the closed state; According to the coordinates of each point of the polyline that meets the characteristics of the rectangular frame, it is determined whether the length of each segment is the same as the preset frame size range requirement. If they are the same, the frame is formed by the closed polyline.
5. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: Determine the block and non-block attributes of the drawing frame of the CAD drawing, including: Traversing all blocks in the CAD drawing, extracting the minimum and maximum point coordinates of each block and calculating the size of each block; Based on the minimum standard frame size, the blocks are screened to select blocks whose size is greater than or equal to the minimum standard frame; The filtered block size is compared with the preset frame size. If the block size matches the preset frame size, the frame of the CAD drawing is a block attribute. If not, the frame of the CAD drawing is a non-block attribute.
6. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: For the CAD drawing whose frame is a block, the calculation formula of the frame size is: , , Where L is the length of the frame, B is the width of the frame, , The maximum points of the frame The horizontal and vertical coordinate values of , The minimum points of the frame The horizontal and vertical coordinate values are as follows, and β is the allowable deviation value.
7. A method for batch modifying CAD drawing frames and drawing labels as claimed in claim 1, characterized in that: The coordinate transformation algorithm is: The actual coordinates of the upper left point of the 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 label information area End(X,Y): End(X,Y) = right(X1,Y1)+offset(X3,Y3); in: right(X1,Y1) is the coordinate of the lower right corner of the frame; Offset(X2,Y2) is the relative coordinate of the upper left corner of the label information area; offset(X3,Y3) is the relative coordinate of the lower right corner of the label information area.
8. A system for batch modifying CAD drawing frames and labels, characterized in that: include: An attribute judgment module, used to execute the S3 step; An information extraction module, used to execute the S4 step; as well as, The modification module is used to execute the S5 step.
Citation Information
Patent Citations
Drawing frame title block designing method based on BIM technology
CN106844885A
River course engineering plan partitioning method, electronic device and storage medium
CN109165409A
Drawing label identification method, system and device of drawing
CN118410196A
Method and system for automatically generating drawing catalog based on CAD (Computer Aided Design)
CN119202179A
Deep learning-based picture frame information intelligent identification method and system, and storage medium
CN119418359A
Cited By
DWG-to-PDF conversion and batch printing method and system based on database
CN120578350A
Electronic drawing label area positioning method and system and storage medium
CN121637599A