Batch Recognition Method for Electrical Secondary Schematic Diagrams
By automatically recognizing graphic and textual elements in electrical secondary schematic diagrams in Autodesk AutoCAD, the problems of low efficiency and poor accuracy of traditional manual recognition have been solved. This has enabled automatic modeling and data sharing of electrical systems, improving the level of design intelligence and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWEST ENGINEERING CORPORATION LIMITED
- Filing Date
- 2026-04-24
- Publication Date
- 2026-05-26
AI Technical Summary
The drawing, modification, data extraction, and analysis of traditional electrical secondary schematic diagrams mainly rely on manual operation, resulting in low efficiency and poor accuracy. Furthermore, the lack of unified standards among different design units and equipment manufacturers makes it difficult to meet the requirements of project construction cycle and data collaboration.
A batch recognition method for electrical secondary schematic diagrams based on Autodesk AutoCAD is adopted. By selecting the target area of the drawing, graphic and text elements are extracted by category, terminal symbols are identified, and a structured database file is output to realize automated electrical system logic modeling and data sharing.
It has significantly improved the intelligence level and production efficiency of electrical secondary design, enhanced the identification accuracy and fault tolerance, and enabled convenient storage and cross-platform reuse of electrical system information.
Smart Images

Figure CN122090465A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electrical secondary engineering design and BIM application technology, specifically involving a batch recognition method for electrical secondary schematic diagrams based on Autodesk AutoCAD. Background Technology
[0002] Electrical secondary circuit diagrams are crucial design documents in power engineering design, used to describe the logical relationships of protection, control, signaling, measurement, and interlocking systems. They serve as essential bases for equipment manufacturing, installation, commissioning, operation, maintenance, and fault analysis. These diagrams comprehensively express the logical relationships of the secondary circuits in an electrical system through elements such as symbols, wires, terminal numbers, and functional identifiers.
[0003] In traditional electrical design work, the drawing, modification, verification, and subsequent data extraction and analysis of secondary schematic diagrams mainly rely on manual operation. Designers need to manually identify symbols, connections, text annotations, and drawing frame information in CAD and other drafting software for logical analysis and circuit verification. This process is not only time-consuming and labor-intensive, but also easily affected by differences in design habits, drawing complexity, and human error, resulting in low work efficiency, poor accuracy, and difficulty in information reuse.
[0004] Meanwhile, the lack of unified standards among different design units and equipment manufacturers in areas such as schematic drawing standards, symbol library systems, and naming conventions results in fragmented data structures and difficulties in automated processing. With the rapid increase in the number of projects in fields such as hydropower, pumped storage, and power grid automation, traditional design and verification processes based on manual identification are no longer sufficient to meet the requirements of project construction cycles and data collaboration.
[0005] To keep pace with the trend of digitalization and intelligentization in electrical design, there is an urgent need for a technical solution that can automatically identify, extract in a structured manner, and perform semantic analysis on the graphic elements and logical information in electrical secondary schematic diagrams within a CAD drawing environment. This would enable automatic modeling of electrical system logic, data sharing, and cross-platform collaboration, thereby significantly improving the level of intelligence and production efficiency of electrical secondary design work. Summary of the Invention
[0006] The purpose of this invention is to provide a method for batch identification of electrical secondary schematic diagrams, which solves the problems of low efficiency and poor accuracy of existing manual identification of electrical secondary schematic diagrams.
[0007] The technical solution adopted in this invention is: a method for batch identification of electrical secondary schematic diagrams, comprising the following steps: Step 1: Open the CAD drawing containing the electrical secondary schematic diagram and start the plugin; Step 2: Select the CAD basic element objects in the target area of the drawing, and extract and remove objects outside the drawing frame area according to graphic elements and text elements; Step 3: Process the boundaries of the drawing frame to define the recognition area; Step 4: Divide the graphic elements within the drawing frame into sub-views according to their connection relationships and merge overlapping views; assign text elements to their corresponding views; identify terminal symbols composed of circles and straight lines and match terminal names. Step 5: Display the recognition results in a tree structure and list, allowing users to edit them. After confirmation, output a batch recognition database file of electrical secondary schematic diagrams in DB format.
[0008] The invention is further characterized in that, Step 1 specifically involves opening the CAD drawing containing the electrical secondary schematic in Autodesk AutoCAD software, starting and initializing the plug-in's user interface, including a tree diagram control for displaying the terminal assembly structure, and a list control for displaying information for each group of terminals.
[0009] Step 2 specifically includes the following steps: Step 2.1: Using the selection function of Autodesk AutoCAD software, select the CAD basic element objects of the target area on the drawing to obtain the object set; Step 2.2: Turn off the highlighted properties of all objects in the object collection; Step 2.3: Classify and extract objects from the set: For each identified frame area, extract all graphic objects contained within the frame and classify and store them into two main categories: graphic elements and text elements. During the classification process, determine whether the geometric center of the object is within the frame area. Only retain objects whose geometric center is within the frame area and remove objects whose geometric center is not within the frame area.
[0010] The graphic elements in step 2 include line segments, polylines, arcs, circles, and block references, while the text elements include single-line text, multi-line text, and block attributes.
[0011] Step 3 is as follows: If the frame is a closed rectangular border drawn with polylines, check whether there is an overlapping inner frame with an area similar to that of the outer frame. When the area difference between the inner and outer frames is within a preset threshold range, it is determined that there is a redundant nested border. Remove the inner duplicate border from the graphic element set and delete all graphic elements and text elements outside the remaining inner frame, keeping only the content within the area enclosed by the inner frame.
[0012] Step 3 is as follows: If the drawing frame is defined in the form of a block reference, the drawing size is obtained by reading the geometric range of the block reference, and the placement direction of the drawing is determined according to the ratio of the width and height of the drawing frame. If the width is greater than the height, it is determined to be horizontal; if the width is less than or equal to the height, it is determined to be vertical.
[0013] Step 4 specifically includes the following steps: Step 4.1: Divide the graphic elements inside the drawing frame into several sub-view units according to their connection relationship: The basis for determining whether two graphic elements belong to the same view is whether their spatial positions are adjacent or intersecting. If the outer boundaries of two graphic elements overlap or touch, they are considered connected. Step 4.2: Traverse all graphic elements in the current drawing frame and add each element to an existing view or create a new view in turn: For a graphic element to be assigned, if its boundary intersects with any graphic element in an existing view, then the graphic element to be assigned is assigned to the existing view; if it does not intersect with any existing view, then a new view module is created starting with the graphic element to be assigned, and the graphic element to be assigned is added to the view list. Step 4.3: Iterative processing, creating independent views for each of the independent electrical circuits within the drawing frame that are not directly connected to each other, and assigning a unique number or name to each view during generation; Step 4.4: Check the initially constructed view set: When overlapping boundary ranges of different views are detected, it is determined that the views with overlapping boundary ranges actually belong to the same circuit module and a merging process is performed; if the boundary rectangles of two views intersect, the graphic element sets of the two views with intersecting boundary rectangles are merged into one view, and the original redundant view entities are deleted. The check is performed in a loop iteration method until there are no overlapping views. Step 4.5: Renumber and reorganize the views to ensure that the view numbers are consecutive and unique; Step 4.6: Assign the extracted text elements to the corresponding view modules: For each text element, determine whether its geometric center point falls within the boundary of a certain view. If the geometric center point of the text element falls within the boundary of the view, the text element is considered to belong to the corresponding view, and the text element is added to the text set of the corresponding view. For the remaining text elements that have not yet been assigned, calculate the distance of each unassigned text element to the boundary of each view, select the view with the closest distance as the assigned view, and add the unassigned text element to the view with the closest distance. Step 4.7: Analyze and identify electrical terminal symbols in each view: First, check if there are block reference objects containing circles and lines in the view. If a block reference contains both a single circle and a single line, it is considered a combination unit of terminal symbols. Extract the circle and line primitives in the block reference, and combine the transformation matrix and insertion point coordinates of the block reference to restore it to the global coordinate system of the view for geometric analysis. Determine if the line and the circle have two intersection points. If there are two intersection points, calculate the ratio of the actual length of the line to the diameter of the circle, and determine if the length ratio difference is within the allowable range. At the same time, check the angle direction of the line relative to the circle. The line segment should be diagonally intersecting the circle with the center as the center. If the judgment condition is met, it is confirmed that the circle and the line constitute a set of terminal symbols. Generate a terminal object in the current view to record it and save its spatial position attributes. Next, perform terminal search on other graphic elements in the view except for block references: extract the set of all independently drawn circles and lines in the view, traverse each circle, and find the line that intersects with it in the set of lines. The line and the circle must have two intersection points and the length is equivalent to the diameter of the circle, and the angle intersecting condition must be met. After finding the line-circle pair that meets the conditions, identify it as a new terminal symbol, generate the corresponding terminal object and record it. Step 4.8: Perform name matching for each identified terminal symbol: filter the text elements in the view, find the text containing the colon character as the candidate set of terminal names, calculate the distance between the center position of each terminal symbol and each candidate text, select the text element with the closest distance as the name label of the terminal, and associate the text element with the name attribute of the terminal object.
[0014] Step 5 specifically includes the following steps: Step 5.1: Export the identified drawings, views, and all element information contained therein into a structured data format; Step 5.2: Establish the data table structure corresponding to drawings, views, and various graphic and text elements, and store the drawing number, drawing frame parameters, view statistics, attribute information and geometric parameters of each element into the corresponding data table; Step 5.3: Users view and edit the analysis results data displayed in tree and list structures through the user interface. After editing, users confirm and output a database file in DB format.
[0015] The beneficial effects of this invention are as follows: The batch recognition method for electrical secondary schematic diagrams of this invention achieves batch recognition of electrical secondary schematic diagrams by automatically extracting the frame area and segmenting independent views based on the connection relationship of graphic elements, without the need for manual intervention one by one; at the same time, it uses the geometric features of circles and lines to accurately identify terminal symbols and automatically matches and annotates them with adjacent text, which greatly improves the recognition accuracy and fault tolerance; finally, the recognition results are structured and output as a database file, making the schematic diagram information easy to store, retrieve and reuse across platforms, which significantly improves the intelligence level and production efficiency of electrical design. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the method for batch identification of electrical secondary schematic diagrams according to the present invention; Figure 2 The electrical secondary schematic diagrams supported by the batch identification method of the present invention are electrical secondary schematic diagrams. Figure 3 This is a partial detailed view of the electrical secondary terminal diagrams that the batch identification method for electrical secondary schematic diagrams of the present invention supports for identification; Figure 4 This is a program interface diagram of the batch identification method for electrical secondary schematic diagrams of the present invention. Figure 5 This is a program execution completion status diagram when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 6 This is a schematic diagram of the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 7 This is a schematic diagram of the Arc table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 8 This is a schematic diagram of the BlockAttribute table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 9 This is a schematic diagram of the Circle table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 10 This is a schematic diagram of the Draw table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 11 This is a schematic diagram of the Ellipse table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 12 This is a schematic diagram of the Line table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 13 This is a schematic diagram of the MText table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 14 This is a schematic diagram of the Multiline table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 15 This is a schematic diagram of the Terminal table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 16 This is a schematic diagram of the Text table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied; Figure 17 This is a schematic diagram of the View table in the DB file output by the program when the batch identification method for electrical secondary schematic diagrams of the present invention is applied. Detailed Implementation
[0017] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0018] Example 1 This invention provides a method for batch identification of electrical secondary schematic diagrams, such as... Figure 1 As shown, it includes the following steps: Step 1: Open the CAD drawing containing the electrical secondary schematic diagram and start the plugin.
[0019] Step 2: Select the CAD basic element objects in the target area of the drawing to obtain the object collection.
[0020] Step 3: Analyze the frame data, sort out any redundant or irregular frame data, and determine a unique and logically consistent set of frames.
[0021] Step 4: Using the data analyzed in Step 3, reorganize the data structure to conform to the professional logic of the source diagram.
[0022] Step 5: Display the analysis results data in both tree and list structures, and make them editable. The user confirms the output of a database file in DB format.
[0023] Compared with existing technologies, this invention significantly improves the batch recognition efficiency and accuracy of electrical secondary schematic diagrams through the above methods. By automatically extracting the frame area and segmenting sub-circuit views, it achieves "one-click" recognition of the entire drawing, eliminating the need for manual intervention and saving significant manpower and time costs. Based on a geometric feature-driven adaptive recognition strategy, this invention exhibits excellent adaptability to drawings of different sizes and layouts. Regardless of the drawing method (polyline or block) or the changing positions of electrical symbols and labels, this invention can effectively recognize them using parameters such as area thresholds, distance, and angle, demonstrating strong robustness and versatility. Furthermore, this invention introduces an error tolerance mechanism during the recognition process, such as allowing a certain range of border repetition and symbol size deviation, and using nearest-neighbor text matching for terminal labels, improving the tolerance for drawing errors and subtle symbol differences, ensuring the completeness and accuracy of the final recognition results. Finally, the recognition results are output in structured data format, facilitating integration with databases and other electrical design software, enabling convenient retrieval and reuse of electrical schematic diagram information, further improving the efficiency of engineering design and management.
[0024] Example 2 This invention provides a method for batch identification of electrical secondary schematic diagrams. Based on Embodiment 1, step 1 specifically includes the following steps: Step 1.1: Initialize the software's UI and related controls.
[0025] Step 1.2: Display the terminal assembly structure in a tree diagram and display the information of each terminal group in a list.
[0026] Example 3 This invention provides a method for batch identification of electrical secondary schematic diagrams. Based on embodiment 1, step 2 specifically includes the following steps: Step 2.1: Select the CAD basic element objects in the target area of the drawing.
[0027] Step 2.2: Turn off the highlight property of all objects.
[0028] Step 2.3: Object Classification and Extraction. For each identified bounding box region, extract all graphic objects contained within it and classify and store them into two main categories: graphic elements and text elements. Graphic elements include geometric entities such as line segments, polylines, arcs, circles, and block references, while text elements include single-line text, multi-line text, and block attributes.
[0029] During the classification process, it is determined whether the geometric center of the object is within the drawing frame. Only objects within the drawing frame are retained, while objects outside the frame are discarded. This step completes the initial screening and classification of the original CAD data, providing a data foundation for subsequent identification.
[0030] Example 4 This invention provides a method for batch identification of electrical secondary schematic diagrams. Based on embodiment 1, step 3 specifically includes the following steps: Step 3.1: Further process the drawing frame itself and its boundary area to ensure that the recognition range is accurately limited to the effective drawing area. If the drawing frame is a closed rectangular border drawn with polylines, it is necessary to detect whether there is an overlapping inner frame (double border) structure with a similar area. When the area difference between the inner and outer frames is detected to be within a preset threshold range (e.g., within 5%), it can be determined that there is a redundant nested border. At this time, the inner duplicate border is removed from the graphic element set.
[0031] Delete all graphic and text elements outside the remaining inner frame, retaining only the content within the area enclosed by the inner frame. This process eliminates the interference of the double borders on the recognition area, thus limiting the actual recognition range.
[0032] Step 3.2: For drawing frames defined in block reference form (such as title block), obtain the drawing dimensions by reading its geometric extent and determine the drawing's placement direction (horizontal or vertical). For example, the horizontal or vertical orientation can be determined based on the ratio of the drawing frame's width to its height: if the width is greater than the height, it is horizontal; otherwise, it is vertical.
[0033] Step 3.3: The lower left corner of the drawing frame can be selected as the reference point to unify the coordinate reference for subsequent identification. After the drawing frame standardization process, the effective area, dimension direction, and other information of each drawing are clarified, laying the foundation for the subsequent view splitting.
[0034] Example 5 This invention provides a method for batch identification of electrical secondary schematic diagrams. Based on embodiment 1, step 4 specifically includes the following steps: Step 4.1: The graphic elements inside the drawing frame are divided into several sub-view units (i.e., independent circuit modules) according to their connection relationships. The criterion for determining whether two graphic elements belong to the same view is whether their spatial positions are adjacent or intersecting: if the outer boundaries of two graphic elements overlap or touch, they are considered connected.
[0035] Step 4.2: The algorithm iterates through all graphic elements in the current frame, adding each element to an existing view or creating a new view in turn: For a graphic element to be assigned, if its boundary intersects with any graphic element in an existing view, then the element is assigned to that view; if it does not intersect with any existing view, then a new view module is created starting with that element and added to the view list.
[0036] Step 4.3: Iterative processing, ultimately creating separate views for each independent (non-directly connected) electrical circuit section within the drawing frame. Each view is assigned a unique number or name for identification and indexing during generation.
[0037] Step 4.4: Inspect the initially constructed view set to avoid over-division causing the same circuit unit to be split into different views. When overlapping boundary ranges of different views are detected, it is determined that these views actually belong to the same circuit module and should be merged.
[0038] If two views are found to have intersecting boundary rectangles (overlapping areas), the graphic element sets of these two views are merged into one view, and the original redundant view entities are deleted. The merging operation may not be able to complete all corrections in one go, so a loop iterative method is used to check until there are no more overlapping views.
[0039] Step 4.5: Renumber and reorganize the views to ensure the continuity and uniqueness of the view sequence numbers. After view construction, merging, and correction, several independent electrical secondary schematic diagram views are finally obtained, each view corresponding to a relatively independent circuit area in the original drawing.
[0040] Step 4.6: Assign the extracted text elements to the corresponding view modules to establish a link between graphics and text information. First, determine whether the geometric center point of each text element falls within the boundary of a view. If so, the text is considered to belong to that view and added to its text set. Through this iterative assignment, most text descriptions located inside or near the boundaries of views can be initially categorized into the corresponding views.
[0041] For the remaining unassigned text elements, a secondary matching process is performed using the nearest distance principle: the distance from each unassigned text to the boundary of each view is calculated, and the view with the closest distance is selected as its assigned view, which is then directly added to that view. This strategy ensures that even if some text is not contained within a bounding box due to a slightly off-center position, it can still be correctly attached to the corresponding view based on the distance relationship. After text assignment is completed, each view is associated with its internal text annotations or numbering information, preparing for subsequent terminal identification and structured data export.
[0042] Step 4.7: Analyze and identify electrical terminal symbols in each view. Terminals in electrical schematics are usually represented by a symbol of "a straight line through a circle," that is, a short line passing through a small circle, representing a terminal. This terminal symbol may be drawn directly in the drawing or inserted in the form of a block (e.g., half of the terminal is drawn as a block, and the other half is drawn on the drawing). The method of this invention handles the above two cases separately: First, detect whether there is a block reference object containing a circle and a straight line in the view. If a block is found to contain both a single circle object and a single straight line object, it is considered as a combination unit of terminal symbols. Extract the circle and straight line primitives in the block, and combine the block's transformation matrix and the coordinates of the insertion point to restore it to the global coordinate system of the view for geometric analysis. Determine whether the straight line and the circle have two intersection points, that is, whether the straight line passes through the center of the circle; if the intersection points exist, calculate the ratio of the actual length of the straight line to the diameter of the circle, and determine whether the length ratio difference is within the allowable range (e.g., not exceeding 50% of the circle's diameter). Simultaneously, the approximate angular direction of the line relative to the circle is detected, requiring it to conform to the drawing conventions of terminal symbols (e.g., the line segment diagonally intersects the circle's center, rather than horizontally or vertically). If all the above conditions are met, the circle and line are confirmed to form a set of terminal symbols, and a terminal object is generated in the current view for recording, saving its spatial position (center coordinates) and other attributes. Next, a terminal search is performed on other graphic elements in the view, excluding block references: the set of all independently drawn circles and lines in the view is extracted, and then a similar method is used to match line-circle pairs. Specifically, each circle is traversed, and a line intersecting with it is found in the set of lines. The line must have two intersection points with the circle and its length is approximately equal to the circle's diameter (within a predetermined range of proportional deviation), and the angular intersection condition must be met, as described above. After finding a line-circle pair that meets the conditions, a new terminal symbol is identified, and a corresponding terminal object is generated for recording.
[0043] Step 4.8: Iterate through the process to identify and extract all possible terminal symbols in the view, ensuring that the geometric information of the electrical terminals is correctly captured. Then, perform name matching for each identified terminal symbol: filter the text elements in the view, find text containing the colon ":" character, and use this as a candidate set for terminal names (terminal numbers usually appear in the form of "equipment code:terminal number"). For each terminal symbol, calculate the distance between its center position and each candidate text, select the text with the closest distance as the name label for that terminal, and associate this text element with the name attribute of the terminal object. Through the above matching, the equipment code and terminal number to which the terminal belongs are finally determined, realizing the correspondence between graphic symbols and electrical wiring meanings.
[0044] If no colon-formatted text is found near a terminal, the terminal will not be named, but its geometric position will still be recorded for reference during manual review.
[0045] Example 6 This invention provides a method for batch identification of electrical secondary schematic diagrams. Based on embodiment 1, step 5 specifically includes the following steps: Step 5.1: Export the identified drawings, views, and all element information contained therein into a structured data format for easy storage and subsequent use. This invention preferably uses a database table or XML file to store the extracted information.
[0046] Step 5.2: Under the database scheme, create corresponding data table structures for drawings, views, and various graphic / text elements.
[0047] Each drawing entry records the drawing number, as well as the dimensions and orientation of the drawing frame.
[0048] Each view entry includes the view number, the drawing number to which it belongs, and a count of the number of various elements in the view (such as the number of line segments, polylines, circles, text, terminals, etc.).
[0049] Each specific element (line, circle, text, terminal, etc.) entry stores detailed attribute information and geometric parameters, such as coordinate position, color, size, or text content, as well as the drawing and view number associated with that element. Taking the terminal table as an example, its fields include the terminal's device code, terminal number name, and the coordinates of the terminal's location.
[0050] Step 5.3: Through structured export, the identification results of the electrical secondary schematic diagram can be separated from the original diagram and saved in a standardized data format. This result data can be easily imported into other systems or used for subsequent applications such as electrical connection verification and report generation, improving the automation level of engineering data processing.
[0051] Example 7 This invention provides a method for batch identification of electrical secondary schematic diagrams based on Autodesk AutoCAD, such as... Figure 1 As shown, please follow these steps: S1: Drawings that this invention can recognize, such as... Figure 2 As shown, it includes a standard box, and the selected elements should contain elements such as... Figure 3 The "terminal" symbol shown is a combination of a circle and a diagonal line segment. The correct drawing should be opened in AutoCAD before launching the add-in.
[0052] S2: After starting the plugin, as shown Figure 4As shown, the plugin displays the logical structure tree of all terminals on the left and a list of terminal names on the right. The left side includes three functions: "Add Drawing," "Delete Node," and "Merge Node." "Add Drawing" allows users to select elements multiple times, and the new and old data are displayed together in the structure tree. "Delete Node" allows users to delete nodes in the structure tree. "Merge Node" allows users to merge different branches of the structure tree into a single branch. The right side includes an "Output File" function, allowing users to output the current information as a DB file.
[0053] S3: Using the CAD selection function, multiple elements or multiple drawings can be selected at once. The selected elements are then organized into a set through Autodesk's development interface for processing. This set is stored in a specific data structure, reorganized to conform to the professional logic of the original drawings, and the analysis results are displayed in tree and list structures respectively. For example... Figure 5 The plugin displays a terminal logic structure tree diagram on the left and the terminal names contained in the currently selected logic area on the right.
[0054] S4: User operation functions such as merging and deleting nodes, adjusting the terminal logic structure tree to meet professional needs.
[0055] S5: After the user completes the operation, clicking "Output File" will summarize the current information into a database file in DB format and save it to the hard drive, such as... Figure 6 As shown.
[0056] S6: Open the DB file using DB Browser (SQLite) software to view the file's detailed structure. Figure 7 This displays a collection of ARC objects and their associated properties; Figure 8 It displays a collection of BlockAttribute objects and their related properties; Figure 9 It displays a collection of Circle objects and their related properties; Figure 11 This table displays a collection of Ellipse objects and their related properties. Since the test graph does not contain any Ellipse objects, this table is empty. Figure 12 The collection of Line objects and their related properties are displayed; Figure 13 It displays a collection of MText objects and their related properties; Figure 14 The collection of Multiline objects and their related properties are displayed; Figure 16 This displays a collection of Text objects and their related properties. These objects are all native Autodesk CAD object types, read directly from the CAD drawing database.
[0057] S7: Figure 10This displays a collection of Draw objects and their related attributes. Draw represents the drawing frame, not a native CAD type, but a logical type composed of ordinary lines or blocks, determined through algorithmic analysis. Finally, the obtained drawing frame geometry and orientation are recorded in the Draw table. This is represented as a root node in the tree structure.
[0058] S8: Figure 17 This displays a collection of View objects and their associated properties. A View represents a viewpoint; it's not a native CAD type, but rather a grouping of graphic objects based on proximity, with each group called a View object. In the tree structure, it's represented as a child node.
[0059] S9: Figure 15 This displays a collection of Terminal objects and their related properties. A Terminal represents a terminal block, not a native CAD type, but rather a combination of a circle and a diagonal line segment. The algorithm analyzes the composition of the current terminal; for example, it might be composed of a circle and a diagonal line segment, or it might be combined into a block reference, or multiple identical patterns superimposed on each other and need to be recognized as a single symbol. Overall, it distinguishes terminals based on visual effect and creates Terminal objects.
[0060] S10: The user will use the DB file for subsequent professional applications.
Claims
1. A method for batch recognition of electrical secondary schematic diagrams, characterized in that, Includes the following steps: Step 1: Open the CAD drawing containing the electrical secondary schematic diagram and start the plugin; Step 2: Select the CAD basic element objects in the target area of the drawing, and extract and remove objects outside the drawing frame area according to graphic elements and text elements; Step 3: Process the boundaries of the drawing frame to define the recognition area; Step 4: Divide the graphic elements within the drawing frame into sub-views according to their connection relationships and merge overlapping views; assign text elements to their corresponding views; identify terminal symbols composed of circles and straight lines and match terminal names. Step 5: Display the recognition results in a tree structure and list, allowing users to edit them. After confirmation, output a batch recognition database file of electrical secondary schematic diagrams in DB format.
2. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 1 specifically involves: opening the CAD drawing containing the electrical secondary schematic in Autodesk AutoCAD software, starting and initializing the plugin's user interface, including a tree diagram control for displaying the terminal assembly structure, and a list control for displaying information for each group of terminals.
3. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 2 specifically includes the following steps: Step 2.1: Using the selection function of Autodesk AutoCAD software, select the CAD basic element objects of the target area on the drawing to obtain the object set; Step 2.2: Turn off the highlighted properties of all objects in the object collection; Step 2.3: Classify and extract objects from the set: For each identified frame area, extract all graphic objects contained within the frame and classify and store them into two main categories: graphic elements and text elements. During the classification process, determine whether the geometric center of the object is within the frame area. Only retain objects whose geometric center is within the frame area and remove objects whose geometric center is not within the frame area.
4. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, The graphic elements in step 2 include line segments, polylines, arcs, circles, and block references, while the text elements include single-line text, multi-line text, and block attributes.
5. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 3 specifically involves: if the frame is a closed rectangular border drawn with polylines, detecting whether there is an overlapping inner frame with an area similar to that of the outer frame. When the area difference between the inner and outer frames is within a preset threshold range, it is determined that there is a redundant nested border. The inner duplicate border is removed from the graphic element set, and all graphic elements and text elements outside the remaining inner frame are deleted, leaving only the content within the area enclosed by the inner frame.
6. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 3 specifically involves: if the drawing frame is defined in the form of a block reference, obtaining the drawing size by reading the geometric range of the block reference, and determining the placement direction of the drawing based on the ratio of the width to the height of the drawing frame. If the width is greater than the height, it is determined to be horizontal; if the width is less than or equal to the height, it is determined to be vertical.
7. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 4 specifically includes the following steps: Step 4.1: Divide the graphic elements inside the drawing frame into several sub-view units according to their connection relationship: The basis for determining whether two graphic elements belong to the same view is whether their spatial positions are adjacent or intersecting. If the outer boundaries of two graphic elements overlap or touch, they are considered connected. Step 4.2: Traverse all graphic elements in the current drawing frame and add each element to an existing view or create a new view in turn: For a graphic element to be assigned, if its boundary intersects with any graphic element in an existing view, then the graphic element to be assigned is assigned to the existing view; if it does not intersect with any existing view, then a new view module is created starting with the graphic element to be assigned, and the graphic element to be assigned is added to the view list. Step 4.3: Iterative processing, creating independent views for each of the independent electrical circuits within the drawing frame that are not directly connected to each other, and assigning a unique number or name to each view during generation; Step 4.4: Check the initially constructed view set: When overlapping boundary ranges of different views are detected, it is determined that the views with overlapping boundary ranges actually belong to the same circuit module and a merging process is performed; if the boundary rectangles of two views intersect, the graphic element sets of the two views with intersecting boundary rectangles are merged into one view, and the original redundant view entities are deleted. The check is performed in a loop iteration method until there are no overlapping views. Step 4.5: Renumber and reorganize the views to ensure that the view numbers are consecutive and unique; Step 4.6: Assign the extracted text elements to the corresponding view modules: For each text element, determine whether its geometric center point falls within the boundary of a certain view. If the geometric center point of the text element falls within the boundary of the view, the text element is considered to belong to the corresponding view, and the text element is added to the text set of the corresponding view. For the remaining text elements that have not yet been assigned, calculate the distance of each unassigned text element to the boundary of each view, select the view with the closest distance as the assigned view, and add the unassigned text element to the view with the closest distance. Step 4.7: Analyze and identify electrical terminal symbols in each view: First, check if there are block reference objects containing circles and lines in the view. If a block reference contains both a single circle and a single line, it is considered a combination unit of terminal symbols. Extract the circle and line primitives in the block reference, and combine the transformation matrix and insertion point coordinates of the block reference to restore it to the global coordinate system of the view for geometric analysis. Determine if the line and the circle have two intersection points. If there are two intersection points, calculate the ratio of the actual length of the line to the diameter of the circle, and determine if the length ratio difference is within the allowable range. At the same time, check the angle direction of the line relative to the circle. The line segment should be diagonally intersecting the circle with the center as the center. If the judgment condition is met, it is confirmed that the circle and the line constitute a set of terminal symbols. Generate a terminal object in the current view to record it and save its spatial position attributes. Next, perform terminal search on other graphic elements in the view except for block references: extract the set of all independently drawn circles and lines in the view, traverse each circle, and find the line that intersects with it in the set of lines. The line and the circle must have two intersection points and the length is equivalent to the diameter of the circle, and the angle intersecting condition must be met. After finding the line-circle pair that meets the conditions, identify it as a new terminal symbol, generate the corresponding terminal object and record it. Step 4.8: Perform name matching for each identified terminal symbol: filter the text elements in the view, find the text containing the colon character as the candidate set of terminal names, calculate the distance between the center position of each terminal symbol and each candidate text, select the text element with the closest distance as the name label of the terminal, and associate the text element with the name attribute of the terminal object.
8. The method for batch identification of electrical secondary schematic diagrams as described in claim 1, characterized in that, Step 5 specifically includes the following steps: Step 5.1: Export the identified drawings, views, and all element information contained therein into a structured data format; Step 5.2: Establish the data table structure corresponding to drawings, views, and various graphic and text elements, and store the drawing number, drawing frame parameters, view statistics, attribute information and geometric parameters of each element into the corresponding data table; Step 5.3: Users view and edit the analysis results data displayed in tree and list structures through the user interface. After editing, users confirm and output a database file in DB format.