Water conservancy project CAD drawing examination method and system based on ezdxf library
Through the CAD drawing review method of water conservancy engineering based on the ezdxf library, clustering and automatic detection algorithms are used to solve the problem that existing tools cannot handle water conservancy engineering drawings, achieving efficient and accurate review, which is suitable for the review needs of complex projects.
Patent Information
- Application Number
- CN202410997160.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The existing automated CAD drawing review tools lack professional systems for water conservancy projects and cannot effectively deal with specific structures and specifications in water conservancy engineering drawings, resulting in low review efficiency, poor accuracy, and difficulty in meeting the needs of complex projects.
The CAD drawing review method for water conservancy engineering developed based on the ezdxf library, split the drawings through clustering algorithm, combine the automatic detection algorithm to check size, scale and elevation marks to identify technical errors, and generate detailed review reports to provide visual markings and error summary Function.
It improves the efficiency and accuracy of water conservancy engineering drawing review, can identify specific structural and specification errors in complex projects, enhances the systematicity and visualization of the review, and is suitable for engineering drawing review in different fields.
Smart Images

Figure CN118965507A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water conservancy project design and construction, and in particular to a water conservancy project CAD drawing review method and system based on an ezdxf library. Background Art
[0002] In the field of water conservancy projects, CAD drawings are key documents for engineering design and construction, and their accuracy directly affects the quality and safety of the project. For a long time, the review of water conservancy project CAD drawings has mainly relied on the inspection of professionals. This project is not only time-consuming and labor-intensive, but also difficult to avoid omissions and errors due to the existence of human factors. First, manual review is slow and cannot meet the needs of large-scale or emergency projects; second, manual review is easily affected by personal experience and status, resulting in unstable review quality; and traditional methods are difficult to systematically record and track problems found during the review process, which is not conducive to subsequent analysis and improvement; finally, with the increasing complexity of water conservancy projects, manual review is increasingly difficult to deal with subtle errors and complex problems in drawings.
[0003] With the development of computer-aided design technology, especially the advancement of graphics processing and artificial intelligence technology, automated CAD drawing review methods have gradually become possible. Automated review can not only significantly improve review efficiency, but also reduce human errors through algorithms to ensure the accuracy and consistency of drawing review. However, existing automated review tools are mostly concentrated in the field of construction. There are significant professional differences between water conservancy projects and construction projects in terms of design and construction. Water conservancy project drawings may contain specific structures and components, such as dam bodies, wave walls, corridors, reservoirs, etc., which are basically uncommon in the field of construction and are handled differently. The walls, beams, columns and other structures of construction projects are mostly regular geometric shapes, and the overall frame structure is simpler. The scale and complexity of water conservancy projects may far exceed that of general construction projects. The number of dimensional standards and elevations on the drawings of water conservancy projects far exceeds that of general construction projects, and there are more contents to be checked. At the same time, the specifications and standards followed by water conservancy projects are different from those in the construction field. The design and construction of water conservancy projects must follow a series of specifications and standards specifically formulated for hydraulic structures and hydrological environments. The existing automated review tools lack a professional review system for the characteristics of water conservancy projects, especially a solution for using the ezdxf library to review professional water conservancy project drawings. Developing an automated CAD drawing review system and method using the ezdxf library specifically for water conservancy projects has important practical significance for improving design quality, shortening project cycles, and reducing costs. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a method and system for reviewing water conservancy project CAD drawings based on the ezdxf library, so as to realize automated review of water conservancy project drawings, improve review efficiency and enhance review accuracy.
[0005] Technical solution: In order to achieve the above-mentioned invention object, the water conservancy project CAD drawing review method based on ezdxf library proposed by the present invention comprises the following steps:
[0006] Open and read the DXF format water conservancy project CAD drawing file, pre-process the drawing file, filter out the area representing the drawing frame by identifying the polyline entities in the drawing, calculate the coordinate range of each drawing frame, cluster the primitive points in the drawing frame using the clustering algorithm, and split the DXF drawing into independent small drawings according to the clustering results;
[0007] Use automatic detection algorithms to check errors on the entire set of drawings, including general error checks and technical error checks. The general error checks include dimensioning checks, scale checks and elevation checks. The dimensioning checks extract dimensioning information from the drawings and compare them with actual measurements to identify and record errors of inconsistent dimensions. The scale checks check whether the scale markings in the drawings are consistent and whether the scale descriptions are correct, identify and record inconsistent scales and incorrect scale descriptions. The elevation checking checks the elevation markings in the drawings to identify and record error information. The technical error checking examines specific hydraulic structures in the drawings, outputs the dimensions of the specific hydraulic structures, identifies and records technical parameters that do not meet the design specifications for hydraulic projects, and visually marks the errors identified in the inspection.
[0008] The review results are presented to the user via a graphical interface that provides error summary and detailed information query functions, and generates a detailed review report containing an error list, impact analysis, and suggested corrective actions.
[0009] Preferably, clustering the primitive points in the frame using a clustering algorithm specifically includes:
[0010] The DBSCAN clustering algorithm is used to perform cluster analysis on the primitive points in the frame, and the primitive points are encrypted to increase the density; based on the clustering results, a unique identifier is generated for each small image, and the name points are extracted.
[0011] Preferably, the specific method for checking the dimensioning includes:
[0012] The start of the dimensioning check is clearly marked by logging, and all drawings are traversed, with each drawing being checked individually. The inspection process is as follows:
[0013] Extract key attributes of each annotation entity, including the annotation text entered by the user, the actual measurement value calculated according to the DXF file attributes, and the starting position of the annotation; verify the validity of the actual measurement value and compare it with the annotation text entered by the user to ensure the consistency between the two; if the actual measurement value does not match the manual annotation, the problem is automatically recorded and relevant detailed information is output on the console, including the displayed size of the annotation, the actual measurement size, and possible causes of the problem, and a visual rectangular mark is added to the drawing object for the problem annotation; record the location information of the problem annotation, including its absolute position in the drawing and its relative position relative to the drawing and thumbnails;
[0014] After completing the marking check of a single drawing, record the time when the inspection is completed and calculate the time taken for the entire inspection process to evaluate the inspection efficiency.
[0015] Preferably, the specific method of checking the scale includes:
[0016] First, perform a scale consistency check: first, group the design entities by drawing name to ensure that each drawing is processed independently; then extract the unit information from the description of each drawing, and then group the small pictures in the drawing, and extract the scale information of the annotated entities from the small pictures; find the most common scale in each small picture by deduplication and statistics, that is, the mode of the scale, and use it as the main scale; check whether the scales of all annotated entities in the small pictures are consistent with the main scale. If there is any inconsistency, add a mark to the drawing object and record the main scale in the drawing name attribute; finally, record the inspection results and efficiency, and return the updated entity containing the scale information of each small picture of each drawing;
[0017] Then, check the scale description: first, filter out all the drawing name entities, and then traverse these entities to determine the corresponding drawing and small drawing names; then search for possible scale information in the text below the drawing name entity, and if found, extract and use the nearest relevant text as the scale reference; if not found, log the missing scale; compare the extracted scale information with the main scale comparison obtained in the scale consistency, check whether the scale description is correct, and print the scale description and main scale if inconsistent;
[0018] Finally, inconsistent scales and incorrect scale descriptions are highlighted on the drawings using visual means, while the details of the error are recorded, including type, location and possible cause.
[0019] Preferably, the specific method for checking elevation marking includes:
[0020] First, create an empty DataFrame data structure to store each elevation text and its coordinates, then filter out the elevation text from the drawing entities and traverse them to determine the center point coordinates; then, filter out the relevant entities within the specified range based on these coordinates, and select the entities that meet the conditions as elevation points;
[0021] Then, all acquired elevations are sorted to determine the benchmark elevation and converted to numerical values according to the scale and units of the drawing. After that, the difference between each elevation and the benchmark is calculated and compared with the difference in the text annotation to identify any inconsistencies. If the elevation difference is found to be inconsistent with the annotation, visual marks are added to these problem elevations on the drawing, and detailed inconsistency information is recorded for user review.
[0022] Finally, a DataFrame data structure containing all the inspection results is returned. If no suitable primitive is found as the elevation point or the scale information is missing during the process, the corresponding log information is recorded.
[0023] Preferably, the screening out qualified graphics elements as elevation points includes: for block-inserted and non-block-inserted graphics elements, different strategies are adopted to determine the elevation points, wherein, block-inserted processing: checking the properties of the graphics element of the block-inserted type to determine whether it contains elevation information, and directly using the insertion point of the block as the elevation point; non-block-inserted processing: for graphics elements of the non-block-inserted type, finding a straight line segment whose length is within a specific range, and selecting the straight line segment closest to the elevation text as the elevation point.
[0024] Preferably, the technical error checking specifically includes:
[0025] Get all non-text point coordinates, including the point coordinates of the elevation insertion point and the point coordinates of the main entity; then get the benchmark elevation value and scale from the entity information to compare and judge the drawing size, identify the dam section outline according to the drawing line type and geometric features to filter out the main graphics, compare the point coordinates and determine the position of the wave-breaking wall top, dam top, and dam bottom folding point, and then identify the dam bottom, wave-breaking wall, dam top and folding point; combine the elevation insertion point, limit the y coordinate to determine the corridor position and calculate the corridor interlayer height difference and upstream wall distance; filter out the records containing the "drainage hole" text, and extract the diameter and spacing of the drainage hole; according to the provisions of the water conservancy project design specification, check whether the settings of the wave-breaking wall, folding point, drainage hole, and corridor in the water conservancy project drawings meet the requirements of the specification, and record the corresponding information.
[0026] The present invention proposes a water conservancy project CAD drawing review system based on the ezdxf library, comprising:
[0027] The file information processing module is used to process the file information of the CAD drawing, including: opening and reading the water conservancy project CAD drawing file in DXF format, pre-processing the drawing file, filtering out the area representing the drawing frame by identifying the polyline entities in the drawing, calculating the coordinate range of each drawing frame, clustering the primitive points in the drawing frame using a clustering algorithm, and splitting the DXF drawing into independent small drawings according to the clustering results;
[0028] The error checking module is used to use an automatic detection algorithm to perform error checking on the entire set of drawings, including general error checking and technical error checking. The general error checking includes dimensioning checking, scale checking and elevation checking. The dimensioning checking extracts dimensioning information in the drawings and compares it with actual measured values to identify and record errors of inconsistent dimensions; the scale checking checks whether the scale markings in the drawings are consistent and whether the scale descriptions are correct, identifies and records inconsistent scales and incorrect scale descriptions; the elevation checking verifies the elevation markings in the drawings to identify and record error information; the technical error checking examines specific hydraulic structures in the drawings, outputs the dimensions of the specific hydraulic structures, identifies and records technical parameters that do not meet the design specifications for hydraulic projects; and visually marks the errors identified in the inspection;
[0029] The result output and display module is used to display the review results to the user through a graphical interface. The graphical interface provides error summary and detailed information query functions, and generates a detailed review report containing an error list, impact analysis and suggested corrective measures.
[0030] The present invention also provides a computer device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the water conservancy project CAD drawing review method based on the ezdxf library are implemented as described above.
[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the water conservancy project CAD drawing review method based on the ezdxf library as described above are implemented.
[0032] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0033] 1. The scale and complexity of water conservancy projects may far exceed those of general construction projects. The number of dimensional standards and elevations on the drawings of water conservancy projects far exceeds that of general construction projects, and the contents that need to be checked are more numerous. In view of the cumbersomeness of the drawing review of water conservancy projects, the present invention targets this feature of water conservancy projects. By converting the entities in the drawings into data that can be recognized by the ezdxf library, an automatic detection algorithm is constructed based on the ezdxf library to perform error checking on the entire set of drawings. Among them, for the three cumbersome review contents of dimensioning, scale marking and elevation, the general error checking of the present invention can efficiently and quickly complete these cumbersome review matters and improve the efficiency of drawing review.
[0034] 2. The present invention specifically targets the characteristics of water conservancy project drawings and can identify specific hydraulic structures of water conservancy projects that are generally uncommon in the construction field, such as wave-breaking walls, corridors, drainage holes, folded slope surfaces, etc., output the dimensions of these hydraulic structures, and compare and review these technical errors in accordance with the corresponding provisions of the specification documents required by the water conservancy project.
[0035] 3. The present invention can perform more accurate compliance checks based on the unique design specifications and construction standards of water conservancy projects through customized algorithms, solving the problem that automated tools in the prior art are difficult to adapt to specific industry specifications. In addition, the present invention has strong applicability, and general error checks are basically applicable to any drawings with drawing frames and drawing name annotations. This versatility makes the general error review method of the present invention widely applicable to engineering drawing reviews in different fields.
[0036] 4. The present invention makes problems easier to discover and track through systematic error recording and visual marking. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of the method of the present invention.
[0038] Figure 2 It is a flow chart of dimensioning inspection.
[0039] Figure 3 It is a flow chart of scale check.
[0040] Figure 4 It is a flow chart of elevation marking inspection.
[0041] Figure 5 It is a record of dimensioning inspection results.
[0042] Figure 6 It is a record of scale marking inspection results.
[0043] Figure 7 It is a record of elevation marking inspection results.
[0044] Figure 8It is a record of technical error check results.
[0045] Fig. 9 This is an example of incorrect annotation after reviewing the drawing. DETAILED DESCRIPTION
[0046] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0047] Existing automated review tools are mostly concentrated in the field of construction, lacking a professional review system for the characteristics of water conservancy projects, especially a lack of solutions for using the ezdxf library for professional water conservancy project drawing review. As a powerful Python development tool, the ezdxf library provides unique advantages for automated CAD drawing review. It is open source and free, easy to integrate into various Python projects, supports cross-platform operations, and provides convenience for developers of different operating systems. The rich functions of the ezdxf library, including creating, editing, and reading DXF files, as well as complex operations on layers, blocks, and geometric properties, greatly simplify the development process and improve development efficiency. In addition, the detailed documentation and active community support of the ezdxf library provide beginners and experienced developers with a quick way to get started and help solve problems. Regular updates ensure the modernity and security of the library, making it an indispensable part of education, prototyping, and commercial software development.
[0048] The water conservancy project CAD drawing review system developed using the ezdxf library can automatically perform dimensioning, scale and elevation marking checks, as well as technical error checks, to improve the efficiency and accuracy of the review. It supports batch processing of multiple drawings, simplifies data-driven drawing review methods, and allows integration with modern design tools to provide a comprehensive drawing review solution. These advantages of the ezdxf library make it an ideal choice for developing an automated CAD drawing review system specifically for water conservancy projects, which will help promote the development of the water conservancy project industry towards automation and intelligence.
[0049] In view of this, the present invention provides a water conservancy project CAD drawing review method based on ezdxf library, referring to Figure 1 , the method comprises the following steps:
[0050] Step 1: Drawing preprocessing: Open and read the CAD drawing file in DXF format, perform cleanup operations to delete hidden or unnecessary entities such as non-printing layers or block definitions in the drawing, and convert the remaining entities such as lines and circles into data structures that are easy to process, such as DataFrame.
[0051] Step 2: Frame identification and extraction: In this step, the system will identify the polyline entities in the drawing, filter out the rectangular areas that constitute the frame, and calculate the coordinate range of each frame to prepare for subsequent drawing splitting and analysis.
[0052] Step 3: Cluster analysis of small images: Use the DBSCAN clustering algorithm to cluster the primitive points in the drawing frame, increase the density by encrypting the primitive points, improve the accuracy of cluster analysis, generate a unique identifier for each small image, and extract the name points. The purpose of clustering is to logically group the primitive points in the drawing according to their spatial distribution and attributes, so as to provide a structured view for subsequent drawing splitting and detailed review.
[0053] Step 4: Split and output drawings: Based on the clustering results, use the identified frame information to split the DXF drawings into independent small drawings, and use the graphics library to draw the image of each small drawing and save it as a PNG or other image format file.
[0054] In addition to a large drawing in a drawing frame, a water conservancy project drawing often has an indefinite number of detailed drawings and small sectional views next to the large drawing. These small drawings are often partial enlargements of the large drawing, with inconsistent scales and repeated drawing contents, and cannot be reviewed together. The drawings can only be reviewed after the small drawings are split.
[0055] Step 5: Dimensioning check: The system automatically goes through the dimensioning in each drawing, extracts the dimensioning text and the actual measurement values calculated from the DXF attributes, and compares the two to identify inconsistencies. All errors found during the check will be automatically marked and highlighted on the drawing using visual means such as adding a rectangular box, while recording the error details, including type, location and possible cause.
[0056] Figure 2 This is a flow chart for dimensioning inspection. The specific steps are as follows:
[0057] Step 5.1, Start Dimensioning Check: Start the review process and record log information to mark the start of the dimensioning check.
[0058] Step 5.2, traverse the drawings: The system automatically traverses each drawing file and prepares to review the dimensioning.
[0059] Step 5.3, Print drawing information: Print the name and related information of the current drawing in the console or log file so that the user can understand the drawing currently being checked.
[0060] Step 5.4, traverse the drawing annotations: traverse each annotation entity in the drawing and check the dimension annotations one by one.
[0061] Step 5.5, extract annotation attributes: extract key attributes from each annotation entity, including manually annotated text and actual measurement values calculated based on DXF file attributes.
[0062] Step 5.6, Compare with manual dimensions: Compare the extracted manual annotation text with the actual measurement value to check whether the two are the same.
[0063] Step 5.7, record relevant information: If the manual marking is different from the actual measurement value, the system will automatically record the difference, including the marked display size, actual size, drawing name, marking position and other information.
[0064] Step 5.8, visual marking: To facilitate user review, the system will use visual means at the corresponding positions of the drawing, such as adding a rectangular box (through the add_rectangle custom function) to mark inconsistent annotations.
[0065] Step 6, scale check: The scale check is divided into scale consistency check and scale description check. First, the scale consistency check is performed: The process of the annotation scale check first involves grouping the design entities by drawing name to ensure that each drawing is processed independently. Next, the unit information is extracted from the description of each drawing, and then the small pictures in the drawing are grouped, and the scale information of the annotation entities is extracted from the small pictures. Through deduplication and statistics, the most common scale in each small picture, that is, the mode of the scale, is found, which is used as the main scale. Check whether the scales of all the annotation entities in the small pictures are consistent with the main scale. If there is any inconsistency, the system will add a mark to the drawing object and record the main scale in the drawing name attribute. Finally, the system will record the inspection results and efficiency, and return the updated entity containing the scale information of each small picture of each drawing. After the scale consistency check is completed, the scale description text check is performed to check the scale text description in the drawing to ensure that the number of scale descriptions in the drawing matches the number of drawing names. The scale description is compared with the main scale in the scale consistency check to check whether the scale description is correct. Finally, use visual tools such as adding rectangular boxes to highlight inconsistent scales and incorrect scale descriptions on the drawings, and record the details of the error, including type, location and possible cause.
[0066] The software will record the location information of the problem annotation in detail, including its absolute position in the drawing and its relative position relative to the drawing and the small drawing. After completing the annotation check of a single drawing, the program will record the time when the check ends and calculate the time spent in the entire inspection process to evaluate the inspection efficiency. This automated dimensioning check not only improves the speed and accuracy of the review of the CAD drawings of water conservancy projects, but also provides strong support for design review and correction through detailed records and visual markings, ensuring the efficiency of the design processing process and the accuracy of drawing errors.
[0067] Figure 3 This is a flow chart of scale checking. Scale checking is divided into two parts, namely, marking scale consistency checking and scale description checking. The specific steps are as follows:
[0068] Consistency check of annotation scale:
[0069] Step 6.a.1. Drawing unit acquisition: Extract unit information from the description part of the drawing, which will be used for subsequent scale verification.
[0070] Step 6.a.2, traverse the drawing: The system automatically traverses each drawing name entity in the drawing, and each drawing name represents an independent design part.
[0071] Step 6.a.3. Extract annotation scale: Extract all annotation scale information from the drawing elements.
[0072] Step 6.a.4: By removing duplicates and counting, take the mode of the scales of the annotated entities extracted from the small image as the main scale.
[0073] Step 6.a.5, consistency check: Compare the scales of all the annotated entities extracted from the small image with the main scale to ensure the consistency of all scales.
[0074] Step 6.a.6, record the scale: if the scales are consistent, record the scale information; if they are inconsistent, record it as an error message.
[0075] Then do a scale description check:
[0076] Step 6.b.1. Traverse drawing names: The system filters all drawing name entities in the drawing, and then traverses these entities to determine the corresponding drawing and small drawing names, and determine the range of scale descriptions that need to be checked.
[0077] Step 6.b.12, obtain the scale description below the figure name: For each figure name entity, the system searches the text below it to obtain the scale description.
[0078] Step 6.b.13, scale information processing: If a scale description is found, the system will verify its validity and extract the scale information; use the nearest relevant text as a scale reference; if not found, record the log information and record it as missing scale information.
[0079] Step 6.b.14, Compare and record: Compare the extracted scale information with the main scale obtained in the scale consistency to check whether the scale description is correct. The system will record the consistency of the scale description and the main scale, and print out the marked scale description and actual scale when inconsistency is found, so as to facilitate subsequent review and correction.
[0080] Step 6.b.15, Visual marking: To facilitate user review, the system will use visual means in the inconsistent scale inspection and scale description of the drawing, add a rectangular box (through the add_rectangle custom function) to mark the inconsistent scale.
[0081] Step 7: Check the accuracy of elevation marking: Verify the accuracy of elevation marking in the drawing by comparing the height marked with the actual measured height on the drawing to ensure their consistency. All errors found during the check will be automatically marked and highlighted on the drawing using visual means such as adding a rectangular box, while recording the error details, including type, location and possible cause.
[0082] Figure 4 This is a flowchart of the elevation labeling check. The process first creates an empty DataFrame to store each elevation text and its coordinates, and then performs the following steps:
[0083] Step 7.1. Filter elevation text: Filter out all text entities marked as elevations from the drawings. These usually represent important height information in the drawings.
[0084] Step 7.2, get the center point coordinates: For each elevation text filtered out, get its center point coordinates on the drawing, which will be used as a reference point for subsequent operations.
[0085] Step 7.3, filter related graphics: According to the center point coordinates of the elevation text, filter out specific elevation annotation graphics in the water conservancy project drawings within a certain range.
[0086] Step 7.4, determine the elevation point: The program provides two processing methods for block insertion and non-block insertion. Block insertion processing: Check the properties of the block insertion type to determine whether it contains elevation information, and directly use the insertion point of the block as the elevation point; non-block insertion processing: For non-block insertion type entities, find a straight line segment with a length within a specific range, and select the straight line segment closest to the elevation text as the elevation point.
[0087] Step 7.5, sort the elevations and determine the base elevation: sort all the determined elevation points by height, take the lowest elevation as the base elevation, and calculate the actual elevation difference by combining the y-coordinate difference between the elevations with the scale.
[0088] Step 7.6, calculate the elevation difference: For each non-benchmark elevation, calculate the difference between it and the benchmark elevation.
[0089] Step 7.7, calculate the text annotation difference: calculate the height difference of the annotation extracted from the elevation text.
[0090] Step 7.8, compare differences: check whether the calculated elevation difference is the same as the text annotation difference.
[0091] Step 7.9, store error information: If the elevation difference does not match the text annotation, record the error information, including the location of the elevation text, the actual measurement value and the annotation value.
[0092] Step 7.10, Visual marking: If it is found that the elevation difference is inconsistent with the marking, the inconsistent elevation shall be visually marked on the drawing and detailed inconsistency information shall be recorded for user identification and review.
[0093] Finally, a DataFrame containing all the inspection results is returned. If no suitable primitive is found as the elevation point or the scale information is missing during the process, the corresponding log information will also be recorded. This process not only improves the efficiency and accuracy of elevation marking inspection, but also enhances the readability and reviewability of the results through visualization and logging.
[0094] The three error checks in steps 5 to 7 above are for the entire water conservancy drawing. The annotation check is checked together, and the scale and elevation are checked for each small drawing. The three error checks will check the entire set of drawings. And it is basically applicable to any drawing.
[0095] The review of water conservancy project drawings involves more than these three items, so this system cannot completely replace manual review. However, due to the complexity and large scale of water conservancy projects, there are many dimensions and elevations that need to be reviewed, and manual review is very cumbersome. The present invention can help manual reviewers to check less of the three cumbersome review contents of dimensioning, scale marking and elevation, thereby improving the efficiency of review.
[0096] Furthermore, the present invention also provides inspections for technical errors in water conservancy projects, such as the height of the wave-breaking wall, the width of the dam crest, the elevation of the downstream fold point, the slopes of the upstream and downstream fold points, the height difference between corridor layers, the distance between the upstream wall of the corridor and the upstream dam surface, and the diameter and spacing of the drainage holes.
[0097] Step 8, technical error check: Identify and check technical errors such as wave wall height, dam crest width, downstream fold point elevation, upstream and downstream fold slopes, corridor layer height difference, distance from the upstream wall of the corridor to the upstream dam surface, and drainage hole diameter and spacing. The specific steps are as follows:
[0098] Step 8.1, filter specific drawings: filter out drawings whose names contain "typical cross-section of retaining dam section" from the entity information.
[0099] Step 8.2, Get point coordinates: Get all non-text type point coordinates, including the point coordinates of the "elevation insertion point" and the point coordinates of the main entity.
[0100] Step 8.3: Obtain the reference elevation value and scale from the entity information for comparison and judgment of the drawing size.
[0101] Step 8.4, determine the dam bottom, wave-breaking wall, dam top and folding points: First, identify the dam section contour according to the line type and geometric features of the drawing to filter out the main elements, and compare the coordinates of the points to determine the positions of the wave-breaking wall top, dam top and folding points of the dam bottom.
[0102] Step 8.5, determine the height difference between corridor layers and upstream wall distance: Combined with the "elevation insertion point", limit the y coordinate to determine the corridor position and calculate the height difference between corridor layers and upstream wall distance.
[0103] Step 8.6: Filter out the records containing the text "drain hole" and extract the diameter and spacing of the drainage holes.
[0104] Step 8.7, output calculation results: print out the wave-breaking wall height, dam crest width, downstream fold point elevation, upstream and downstream fold slopes, corridor layer height difference, distance from the upstream corridor wall to the upstream dam surface, drainage hole diameter, spacing and other information.
[0105] Step 8.8, specification check: Based on the calculation results and specification requirements, determine whether it meets the specifications and print the corresponding information.
[0106] Step 9. Result output and presentation: The review results are presented to the user through a graphical interface, including error reports and drawing images, and a user interface is provided to enable the user to view, navigate and understand the review results.
[0107] The graphical user interface displays the review results and provides error summary and detailed information query functions, generating a detailed review report containing an error list, impact analysis, and suggested corrective measures.
[0108] An example of checking the results is Figure 5-Figure 9 It is shown that Figure 5 It is a record of dimensioning inspection results, recording the specific coordinates where there may be problems with the dimensioning of each drawing. Figure 6 It is a record of scale marking inspection results, recording the scales used in each drawing in the drawing, and providing a basis for judging the consistency of scales. Figure 7 It is a record of the elevation marking check results, recording the difference between the calculated elevation and the text. If the difference is not 0, the elevation is considered to be incorrect. Figure 8 It is a record of the results of technical error checks, which records the dimensions of specific hydraulic structures and compares them with the provisions of relevant water conservancy code documents. If they do not comply with the provisions of the code, the dimensions of the hydraulic structure are considered to be incorrect. Fig. 9 This is an example of incorrect marking after reviewing the drawing. The size, scale and elevation marking positions with problems are as follows. Fig. 9 The present invention makes it easier to find and track problems through systematic error recording and visual marking.
[0109] Based on the same technical concept as the method embodiment, the present invention also provides a water conservancy project CAD drawing review system based on the ezdxf library, including a file information processing module, an error checking module and a result output and display module:
[0110] The file information processing module is used to process the file information of the CAD drawing, including: opening and reading the water conservancy project CAD drawing file in DXF format, pre-processing the drawing file, filtering out the area representing the drawing frame by identifying the polyline entities in the drawing, calculating the coordinate range of each drawing frame, clustering the primitive points in the drawing frame using a clustering algorithm, and splitting the DXF drawing into independent small drawings according to the clustering results;
[0111] The error checking module is used to use an automatic detection algorithm to perform error checking on the entire set of drawings, including general error checking and technical error checking. The general error checking includes dimensioning checking, scale checking and elevation checking. The dimensioning checking extracts dimensioning information in the drawings and compares it with actual measured values to identify and record errors of inconsistent dimensions; the scale checking checks whether the scale markings in the drawings are consistent and whether the scale descriptions are correct, identifies and records inconsistent scales and incorrect scale descriptions; the elevation checking verifies the elevation markings in the drawings to identify and record error information; the technical error checking examines specific hydraulic structures in the drawings, outputs the dimensions of the specific hydraulic structures, identifies and records technical parameters that do not meet the design specifications for water conservancy projects; and visually marks the errors identified in the inspection;
[0112] The result output and display module is used to display the review results to the user through a graphical interface. The graphical interface provides error summary and detailed information query functions, and generates a detailed review report including an error list, impact analysis and suggested corrective measures.
[0113] It should be understood that the water conservancy project CAD drawing review system based on the ezdxf library in the embodiment of the present invention can implement all the technical solutions in the above-mentioned method embodiment, and the functions of its various functional modules can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description in the above-mentioned embodiments, which will not be repeated here.
[0114] The present invention also provides a computer device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the water conservancy project CAD drawing review method based on the ezdxf library are implemented as described above.
[0115] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the water conservancy project CAD drawing review method based on the ezdxf library as described above are implemented.
[0116] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices (systems), computer equipment or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0117] The present invention is described with reference to a flowchart of a method according to an embodiment of the present invention. It should be understood that each process in the flowchart and a combination of processes in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A device that specifies functions in a process or multiple processes.
[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.
[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 The steps of a specified function in a process or multiple processes.
Claims
1. A water conservancy project CAD drawing review method based on ezdxf library, characterized in that: The following steps are involved: Open and read the DXF format water conservancy project CAD drawing file, pre-process the drawing file, filter out the area representing the drawing frame by identifying the polyline entities in the drawing, calculate the coordinate range of each drawing frame, cluster the primitive points in the drawing frame using the clustering algorithm, and split the DXF drawing into independent small drawings according to the clustering results; Use automatic detection algorithms to check errors on the entire set of drawings, including general error checks and technical error checks. The general error checks include dimensioning checks, scale checks and elevation checks. The dimensioning checks extract dimensioning information from the drawings and compare them with actual measurements to identify and record errors of inconsistent dimensions. The scale checks check whether the scale markings in the drawings are consistent and whether the scale descriptions are correct, identify and record inconsistent scales and incorrect scale descriptions. The elevation checking checks the elevation markings in the drawings to identify and record error information. The technical error checking examines specific hydraulic structures in the drawings, outputs the dimensions of the specific hydraulic structures, identifies and records technical parameters that do not meet the design specifications for hydraulic projects, and visually marks the errors identified in the inspection. The review results are presented to the user via a graphical interface that provides error summary and detailed information query functions, and generates a detailed review report containing an error list, impact analysis, and suggested corrective actions.
2. The method according to claim 1, characterized in that The clustering algorithm is used to cluster the primitive points in the frame, specifically including: The DBSCAN clustering algorithm is used to perform cluster analysis on the primitive points in the frame, and the primitive points are encrypted to increase the density; based on the clustering results, a unique identifier is generated for each small image, and the name points are extracted.
3. The method according to claim 1, characterized in that: The specific method of dimensioning inspection includes: The start of the dimensioning check is clearly marked by logging, and all drawings are traversed, with each drawing being checked individually. The inspection process is as follows: Extract key attributes of each annotation entity, including the annotation text entered by the user, the actual measurement value calculated according to the DXF file attributes, and the starting position of the annotation; verify the validity of the actual measurement value and compare it with the annotation text entered by the user to ensure the consistency between the two; if the actual measurement value does not match the manual annotation, the problem is automatically recorded and relevant detailed information is output on the console, including the displayed size of the annotation, the actual measurement size, and possible causes of the problem, and a visual rectangular mark is added to the drawing object for the problem annotation; record the location information of the problem annotation, including its absolute position in the drawing and its relative position relative to the drawing and thumbnails; After completing the marking check of a single drawing, record the time when the inspection is completed and calculate the time taken for the entire inspection process to evaluate the inspection efficiency.
4. The method according to claim 1, characterized in that: The specific method of the scale inspection includes: First, perform a scale consistency check: first, group the design entities by drawing name to ensure that each drawing is processed independently; then extract the unit information from the description of each drawing, and then group the small pictures in the drawing, and extract the scale information of the annotated entities from the small pictures; find the most common scale in each small picture by deduplication and statistics, that is, the mode of the scale, and use it as the main scale; check whether the scales of all annotated entities in the small pictures are consistent with the main scale. If there is any inconsistency, add a mark to the drawing object and record the main scale in the drawing name attribute; finally, record the inspection results and efficiency, and return the updated entity containing the scale information of each small picture of each drawing; Then, check the scale description: first, filter out all the drawing name entities, and then traverse these entities to determine the corresponding drawing and small drawing names; then search for possible scale information in the text below the drawing name entity, and if found, extract and use the nearest relevant text as the scale reference; if not found, log the missing scale; compare the extracted scale information with the main scale comparison obtained in the scale consistency, check whether the scale description is correct, and print the scale description and main scale if inconsistent; Finally, inconsistent scales and incorrect scale descriptions are highlighted on the drawings using visual means, while the details of the error are recorded, including type, location and possible cause.
5. The method according to claim 1, characterized in that The specific method for checking the elevation marking includes: First, create an empty DataFrame data structure to store each elevation text and its coordinates, then filter out the elevation text from the drawing entities and traverse them to determine the center point coordinates; then, filter out the relevant entities within the specified range based on these coordinates, and select the entities that meet the conditions as elevation points; Then, all acquired elevations are sorted to determine the benchmark elevation and converted to numerical values according to the scale and units of the drawing. After that, the difference between each elevation and the benchmark is calculated and compared with the difference in the text annotation to identify any inconsistencies. If the elevation difference is found to be inconsistent with the annotation, visual marks are added to these problem elevations on the drawing, and detailed inconsistency information is recorded for user review. Finally, a DataFrame data structure containing all the inspection results is returned. If no suitable primitive is found as the elevation point or the scale information is missing during the process, the corresponding log information is recorded.
6. The method according to claim 5, characterized in that The screening out of qualified graphics elements as elevation points includes: for block-inserted and non-block-inserted graphics elements, different strategies are adopted to determine the elevation points, wherein, block-inserted processing: checking the properties of the graphics element of the block-inserted type to determine whether it contains elevation information, and directly using the insertion point of the block as the elevation point; non-block-inserted processing: for non-block-inserted graphics elements, finding a straight line segment whose length is within a specific range, and selecting the straight line segment closest to the elevation text as the elevation point.
7. The method according to claim 1, characterized in that The technical error checking specifically includes: Get all non-text point coordinates, including the point coordinates of the elevation insertion point and the point coordinates of the main entity; then get the benchmark elevation value and scale from the entity information to compare and judge the drawing size, identify the dam section outline according to the drawing line type and geometric features, and filter out the main graphics elements, compare the point coordinates and determine the position of the wave-breaking wall top, dam top, and dam bottom folding point, and then identify the dam bottom, wave-breaking wall, dam top, and folding point; combine the elevation insertion point, limit the y coordinate to determine the corridor position and calculate the corridor interlayer height difference and upstream wall distance; filter out the records containing the "drain hole" text, and extract the diameter and spacing of the drainage hole; according to the provisions of the water conservancy project design specification, check whether the settings of the wave-breaking wall, folding point, drainage hole, and corridor in the water conservancy project drawings meet the requirements of the specification, and record the corresponding information.
8. A water conservancy project CAD drawing review system based on ezdxf library, characterized in that: Including file information processing module, error checking module and result output and display module: The file information processing module is used to process the file information of the CAD drawing, including: opening and reading the water conservancy project CAD drawing file in DXF format, pre-processing the drawing file, filtering out the area representing the drawing frame by identifying the polyline entities in the drawing, calculating the coordinate range of each drawing frame, clustering the primitive points in the drawing frame using a clustering algorithm, and splitting the DXF drawing into independent small drawings according to the clustering results; The error checking module is used to use an automatic detection algorithm to perform error checking on the entire set of drawings, including general error checking and technical error checking. The general error checking includes dimensioning checking, scale checking and elevation checking. The dimensioning checking extracts dimensioning information in the drawings and compares it with actual measured values to identify and record errors of inconsistent dimensions; the scale checking checks whether the scale markings in the drawings are consistent and whether the scale descriptions are correct, identifies and records inconsistent scales and incorrect scale descriptions; the elevation checking verifies the elevation markings in the drawings to identify and record error information; the technical error checking examines specific hydraulic structures in the drawings, outputs the dimensions of the specific hydraulic structures, identifies and records technical parameters that do not meet the design specifications for water conservancy projects; and visually marks the errors identified in the inspection; The result output and display module is used to display the review results to the user through a graphical interface. The graphical interface provides error summary and detailed information query functions, and generates a detailed review report including an error list, impact analysis and suggested corrective measures.
9. A computer device, characterized in that: include: one or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the water conservancy project CAD drawing review method based on the ezdxf library as described in any one of claims 1-7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the water conservancy project CAD drawing review method based on the ezdxf library are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Automatic checking method for dimension line marking error in engineering drawing
CN101446999A
A drawing verification system based on big data
CN109086735A
Rule-based CAD drawing automatic error detection method
CN110889214A
Visual editing and persistence implementation method and system for knowledge graph
CN114491073A
Method for scanning and converting paper electric power engineering drawing into electronic edition CAD drawing
CN114529936A
Cited By
Intelligent labeling method and plug-in for CAD (Computer Aided Design) drawing
CN120235989A
Artificial intelligence assistant for examining CAD drawing of transformer substation
CN120541896A
System and method for quickly changing drawing unit
CN120579356A
Two-dimensional roadway coordinate checking calculation method and system and storage medium
CN121809113A
