A method for automatically drawing building electrical distribution box system diagrams

The automated method for drawing building electrical distribution box system diagrams solves the problems of low efficiency and difficulty in ensuring quality in existing technologies, and achieves efficient and accurate electrical distribution box system diagram design.

CN123116381APending Publication Date: 2026-11-17ARCHITECTURAL DESIGN & RES INST OF SOUTHEAST UNIV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611610408.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The design of existing building electrical distribution box system diagrams relies on manual operation, which is inefficient and prone to errors. The lack of automation means makes it difficult to guarantee design quality.

Method used

A method for automatically drawing building electrical distribution box system diagrams is provided. By obtaining the electrical distribution box information input by the user, the method automatically creates a table of electrical distribution boxes using a pre-established database, updates the load calculation formula, and generates a DXF file of the electrical distribution box system diagram.

Benefits of technology

Significantly improves design efficiency, reduces human error, ensures consistent design quality, automatically maintains the connection relationship between upper and lower level distribution boxes, and supports intelligent identification and layout of multi-occupying devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123116381A_ABST
    Figure CN123116381A_ABST
Patent Text Reader

Abstract

This application relates to a method for automatically drawing building electrical distribution box system diagrams. The method includes: upon receiving a table creation instruction, obtaining the distribution box table type and distribution box information selected by the user in a pop-up creation dialog box; based on the distribution box table type and information, reading distribution box data from a pre-established distribution box database, and creating corresponding distribution box tables in a distribution box worksheet, which includes lighting distribution box worksheets and power distribution box worksheets; upon receiving a table update instruction, updating the distribution box worksheets according to the table update type carried in the update instruction, obtaining the updated distribution box worksheets; and upon receiving a system diagram drawing instruction, drawing the distribution box system diagram based on the updated distribution box worksheets and the pre-established distribution box database, and generating a DXF file of the distribution box system diagram, thereby improving the design quality and efficiency of building electrical distribution box system diagrams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of building electrical design automation technology, and in particular to a method for automatically drawing building distribution box system diagrams. Background Technology

[0002] Currently, the design of building electrical distribution box system diagrams (generally two to three levels of distribution, typically floor distribution boxes / cabinets and room-end distribution boxes) is mainly completed manually using traditional methods. Designers need to manually create a load calculation table in Excel based on the building's power requirements, fill in circuit parameters (including circuit number, circuit name, number of devices, phase sequence, rated power, demand factor, power factor, etc.), manually perform load calculations and equipment selection, and then manually draw the AutoCAD drawings of the distribution box system diagram based on the table data. The entire design process involves a large number of repetitive operations and is prone to human error.

[0003] The main drawbacks of existing technologies are:

[0004] 1) The creation of distribution box forms relies entirely on manual labor. Designers need to manually set the form format and fill in the circuit parameters, which is inefficient and prone to omissions.

[0005] 2) Load calculation and equipment selection lack automated methods, requiring manual calculation of parameters such as the calculated capacity (Pc) and calculated current (Ic) of each circuit, which is tedious and prone to errors.

[0006] 3) The circuit numbering needs to be manually arranged. When a circuit is added or removed, the numbering needs to be readjusted, which is time-consuming and laborious.

[0007] 4) The cascading connection between upper and lower level distribution boxes needs to be maintained manually. When the power distribution system scheme is changed, the parameters of the related incoming and outgoing power distribution equipment at the two levels cannot be updated automatically.

[0008] 5) The CAD drawing of the distribution box system diagram is done entirely manually. It requires drawing each incoming line block, outgoing circuit switch block, load parameter table, etc., which is a lot of work and the quality is difficult to be consistent.

[0009] 6) The entire design process lacks systematic integration, and there is no automatic link between Excel spreadsheet data and CAD drawings.

[0010] Overall, the design of building electrical distribution box system diagrams in existing technologies still relies heavily on manual operation, and the design quality and efficiency need to be improved. Summary of the Invention

[0011] Therefore, it is necessary to provide a method, system, and computer equipment for automatically drawing building electrical distribution box system diagrams that can improve the design quality and efficiency of building electrical distribution box system diagrams, in order to address the above-mentioned technical problems.

[0012] A method for automatically drawing building electrical distribution box system diagrams, the method comprising: When a table creation command is received, the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box are obtained. Based on the distribution box table type and the distribution box information, read the distribution box data in the pre-established distribution box database, and create a corresponding distribution box table in the distribution box worksheet. The distribution box worksheet includes a lighting distribution box worksheet and a power distribution box worksheet. Upon receiving a table update instruction, the distribution box worksheet is updated according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet. Upon receiving the instruction to draw a system diagram, the system diagram of the distribution box is drawn based on the updated distribution box worksheet and the pre-established distribution box database, and a DXF file of the distribution box system diagram is generated.

[0013] In one embodiment, when the distribution box type is a self-built lighting distribution box or a self-built power distribution box, the distribution box information includes the distribution box number, circuit information, and environmental information; when the distribution box type is a standard lighting distribution box or a standard power distribution box, the distribution box information includes the distribution box number. The step of reading distribution box data from a pre-established distribution box database based on the distribution box table type and the distribution box information, and creating a corresponding distribution box table in the distribution box worksheet, includes: If the type of the distribution box table is a self-built lighting distribution box or a self-built power distribution box, read the corresponding distribution box work table and locate the current insertion position according to the used area in the distribution box work table; Access the pre-established distribution box database, copy the table header template from the table creation template of the pre-established distribution box database, paste the table header template at the current insertion position, and fill in the distribution box number in the distribution box number position of the table header; Based on the circuit information, the corresponding circuit rows are sequentially searched in the table template of the pre-established distribution box database. The found circuit rows are copied and pasted into the circuit row area of ​​the distribution box worksheet, and the protection pipe type of the circuit row is adjusted based on the environmental information. Copy the table footer in the pre-established table template of the distribution box database, paste the table footer in the next row of the circuit row area, and inherit the load calculation formulas of subtotal, total, incoming line and ATS to complete the establishment of the corresponding distribution box table; If the type of the distribution box is a standard lighting distribution box or a standard power distribution box, read the corresponding distribution box worksheet and locate the current insertion position according to the used area in the distribution box worksheet; Access the pre-established distribution box database, copy the table header, loop row, and table footer from the standard distribution box library of the pre-established distribution box database according to the distribution box number, paste them to the current insertion position, and inherit the load calculation formulas for subtotal, total, incoming line, and ATS to complete the creation of the corresponding distribution box table.

[0014] In one embodiment, updating the distribution box worksheet according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet includes: When the table update instruction carries the table update type of updating all tables, it iterates through all circuit rows of all distribution box tables in all distribution box worksheets, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box connection relationship, and obtains the updated distribution box worksheet. When the table update instruction carries the table update type of updating the lighting table or updating the power table, it traverses all circuit rows of all distribution box tables in the lighting or power distribution box worksheet, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box connection relationship, and obtains the updated distribution box worksheet.

[0015] In one embodiment, the automatic maintenance of the distribution box connection relationship includes: An index dictionary is created based on the distribution box number. All loop rows of all distribution box tables in the corresponding distribution box worksheet are traversed. When a loop row is encountered where the equipment name field is the distribution box number of another distribution box table, the other distribution box table is used as the linked distribution box table. The total parameters in the linked distribution box table are copied to the loop row using formula references. At the same time, the distribution box number and loop number of the current distribution box table are written to the incoming line position of the linked distribution box table, thus establishing a cascading link relationship between the current distribution box table and other distribution box tables.

[0016] In one embodiment, upon receiving the system diagram drawing instruction, drawing the distribution box system diagram based on the updated distribution box worksheet and the pre-established distribution box database, and generating a DXF file of the distribution box system diagram, includes: Upon receiving the instruction to draw a system diagram, the system reads the outgoing line block table, incoming line block table, load calculation table width definition, and configuration table from the pre-established distribution box database through the DXF file interface. Load the DXF drawing template and parse all the distribution box tables in the lighting distribution box worksheet and the power distribution box worksheet. According to the preset layout rules of the distribution box diagram, determine the corresponding drawing frame and the layout position of the corresponding block of each circuit in each distribution box table; Scan and perform keyword matching on the series of fields in the component specification column of each circuit row of each distribution box table in the updated distribution box worksheet to identify multi-occupying devices in the distribution box table, and assign block names according to the number of circuits occupied by the multi-occupying devices; Based on the layout of each circuit in each distribution box table and the block name of the multi-occupying equipment, draw the incoming line block, outgoing switch block, and load parameter table for each distribution box diagram in the corresponding drawing frame, fill in the distribution box electrical equipment selection list, and generate a DXF file of the distribution box system diagram.

[0017] In one embodiment, the step of scanning and keyword matching of a series of fields in the component specification column of each circuit row of each distribution box table in the updated distribution box worksheet to determine multi-occupying devices in the distribution box table, and assigning block names according to the number of circuits occupied by the multi-occupying devices, includes: The series of fields in the component specification column of each circuit row of each distribution box table in the updated distribution box worksheet are scanned, and the scan results are matched with the preset multi-occupying device keywords to determine the multi-occupying devices in the distribution box table; In the power distribution box table, find the circuit sequence that continuously occupies the same multi-occupying device, and count the length n of the circuit sequence; When n equals 1, assign a tile name to the multi-occupying device with an independent tile; When n equals 2, assign tile names for the left and right tiles to the multi-occupying device; When n is greater than 2, assign the names of the left block, m intermediate blocks and the right block to the multi-occupying device, where the number of intermediate blocks m = n - 2.

[0018] In one embodiment, the preset distribution box layout rules include: Following the updated distribution box worksheet's arrangement order, the corresponding distribution box diagrams are first arranged from left to right and top to bottom within the preset primary view frame. If the preset primary view frame cannot accommodate all the distribution box diagrams, they are then arranged from left to right and top to bottom within the preset secondary view frame. If the preset secondary view frame cannot accommodate all the distribution box diagrams, the lighting distribution box diagrams corresponding to the lighting distribution box diagrams and the power distribution box diagrams corresponding to the power distribution box diagrams in the updated distribution box worksheet are arranged separately. Within their respective drawing frames, if the preset primary drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams arranged from left to right and from top to bottom, then the preset secondary drawing frame will arrange each lighting distribution box diagram or each power distribution box diagram from left to right and from top to bottom. If the current preset secondary drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams, a new preset secondary drawing frame will be added to arrange the remaining lighting distribution box diagrams or power distribution box diagrams, and so on, until all the lighting distribution box diagrams or all the power distribution box diagrams are arranged. When arranging the distribution box diagrams corresponding to each distribution box table, it is determined whether the current row of the current frame has already been arranged with other distribution box diagrams and the remaining width. Based on the preset block width corresponding to the circuit row of the distribution box table to be arranged, the total width of the distribution box diagram corresponding to that distribution box table is calculated. It is then determined whether the total width of the distribution box diagram is less than or equal to the remaining width of the current row. If it is less than or equal to the remaining width of the current row, and other distribution box diagrams have already been arranged, the corresponding blocks for each circuit in that distribution box table are arranged sequentially starting at a preset distance from the right edge of the previously arranged distribution box diagram. Based on the arrangement of the blocks, if the block is less than or equal to the current distribution box and no other distribution box diagrams are arranged, start from the leftmost side of the current row and arrange the corresponding blocks for each circuit in the distribution box table sequentially to determine the arrangement position of the corresponding blocks for each circuit in the distribution box table; if the block is greater than the current row, start from the leftmost side of the next row and arrange the corresponding blocks for each circuit in the distribution box table sequentially. If one row is not enough, arrange the circuits that are not arranged in the current distribution box diagram to the next row after the next row, and so on, until all the corresponding blocks for each circuit in the distribution box table are arranged, thus determining the arrangement position of the corresponding blocks for each circuit in the distribution box table. If the total width of the distribution box diagram is greater than the remaining width of the current row and no other distribution box diagrams are arranged, the corresponding blocks of each circuit in the distribution box table shall be arranged starting from the leftmost position of the next row after the current row. The corresponding blocks of the circuits not arranged in the distribution box diagram shall be arranged starting from the leftmost position of the next row after the current row, and so on, until all the corresponding blocks of the circuits in the distribution box table are arranged.

[0019] In one embodiment, an automatic drawing system for building electrical distribution box system diagrams includes: The distribution box information acquisition module is used to acquire the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box when a table creation instruction is received; The distribution box worksheet generation module is used to read the distribution box data in the pre-established distribution box database according to the distribution box table type and the distribution box information, and to create the corresponding distribution box table in the distribution box worksheet. The distribution box worksheet includes a lighting distribution box worksheet and a power distribution box worksheet. The distribution box worksheet update module is used to update the distribution box worksheet according to the table update type carried in the table update instruction when a table update instruction is received, so as to obtain the updated distribution box worksheet. The DXF file generation module is used to draw a distribution box system diagram based on the updated distribution box worksheet and the pre-established distribution box database when a system diagram drawing instruction is received, and to generate a DXF file of the distribution box system diagram.

[0020] In one embodiment, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method.

[0021] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method.

[0022] The significant technical advantages of the automatic drawing method for building electrical distribution box system diagrams in this application are as follows: (1) Design efficiency is significantly improved. According to the experiment, when a typical building electrical project with 100 distribution boxes is designed using the method of this application, it only takes 2-3 hours from table creation to drawing output. Compared with the traditional manual method which takes 2-3 days, the drawing efficiency of this application is about 8 times that of traditional drawing.

[0023] (2) The design quality is more controllable. The automated circuit numbering, load calculation formula update and distribution box connection maintenance avoid the omissions and errors in manual operation, making the design results more accurate and reliable.

[0024] (3) The CAD drawings are of uniform quality. The distribution box system diagrams automatically drawn by the software all conform to the preset standards in terms of block position, parameter labeling, and table format, eliminating the differences in drawing styles among different designers.

[0025] (4) The connection relationship between the upper and lower level distribution boxes is automatically maintained. When the power distribution scheme is changed, the parameters of the incoming and outgoing power distribution equipment of the cascaded distribution boxes can be automatically updated synchronously.

[0026] (5) Intelligent identification of multi-occupying devices: Intelligent switch controllers, centralized meters and other multi-occupying devices can be automatically identified and correctly drawn.

[0027] (6) The layout of the drawing frame is automated. It can automatically select the appropriate drawing frame size according to the number of distribution boxes and the number of circuits, and realize automatic arrangement.

[0028] (7) It has high design flexibility. By modifying the named range definition and data lookup table in the Excel template, it can adapt to the design requirements of different projects. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating a method for automatically drawing a building electrical distribution box system diagram in one embodiment. Figure 2 This is a schematic diagram of the interface of the first-level table creation dialog box in one embodiment; Figure 3 This is a schematic diagram of the interface of a secondary meter creation dialog box for a distribution box of type self-built lighting distribution box or self-built power distribution box in one embodiment. Figure 4 This is a schematic diagram of the interface of a secondary table creation dialog box for a distribution box of type standard lighting distribution box or standard power distribution box in one embodiment; Figure 5 This is a schematic diagram of a portion of the standard distribution box table in a standard distribution box library in one embodiment; Figure 6 This is a schematic diagram of the contents of the incoming line block table in one embodiment; Figure 7 This is a schematic diagram of a distribution box table established in one embodiment; Figure 8 This is a schematic diagram illustrating the automatic establishment of cascading links in one embodiment; Figure 9 This is an example diagram of the left block, middle block, right block, and independent block of a centralized electricity meter in one embodiment; Figure 10 This is a diagram of a distribution box in one embodiment. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0031] In one embodiment, such as Figure 1 As shown, a method for automatically drawing building electrical distribution box system diagrams is provided. Taking the application of this method to a terminal as an example, the method includes the following steps: Step S220: When a table creation command is received, obtain the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box.

[0032] The types of distribution boxes can include self-built lighting distribution boxes, self-built power distribution boxes, standard lighting distribution boxes, or standard power distribution boxes.

[0033] The information obtained from the distribution box varies depending on the type of the distribution box meter. If the distribution box meter type is a self-built lighting distribution box or a self-built power distribution box, the distribution box information includes the distribution box number, circuit information, and environmental information; if the distribution box meter type is a standard lighting distribution box or a standard power distribution box, the distribution box information includes the distribution box number.

[0034] The circuit information may include the circuit name and number of circuits required for the current distribution box meter to be established.

[0035] Among them, environmental information may indicate whether the distribution box is used in a damp location.

[0036] The creation dialog box can include a first-level table creation dialog box and a second-level table creation dialog box.

[0037] Before receiving the table creation command, the software for automatically drawing building electrical distribution box system diagrams had already been started. After starting the software, the table creation template was opened, the row and column coordinates of the named areas in the template were read, and a global table structure definition was established (the row and column numbers corresponding to each named area were extracted and stored in global variables, forming a unified "table structure dictionary". Subsequent programs can directly reference this location information). The row and column numbers corresponding to each named area were stored in global variables. Two-way communication between the software and the Excel application was established through a programming interface to enable programmatic access to workbooks, worksheets, and cell ranges.

[0038] In one example, after the user opens the software via the terminal, the terminal display shows the following interface: Figure 2 The first-level table creation dialog box shown allows users to select the table creation type, such as creating a new table, a self-built lighting distribution box, a self-built power distribution box, a standard lighting distribution box, and a standard power distribution box. After selecting the table creation type, the software will open a second-level table creation dialog box based on the selected type. Figure 3The diagram shows a secondary table creation dialog box for self-built lighting or power distribution boxes. In the "Distribution Box Number" field of the dialog box, users can enter the distribution box number and select whether to check or uncheck "Damp Locations" as needed. Users can select the corresponding distribution box name from the template names in the dialog box. Based on the selected distribution box name, the software displays the circuit names belonging to that distribution box in the "Circuit Name" field. Users can select the circuits required for the current distribution box table creation in the "Circuit Name" field. The software arranges the selected circuits in the output circuit information field of the dialog box. Users can modify the quantity of each circuit in the dialog box and delete or rearrange the circuits in the output circuit information field. After completing the circuit selection, users can click the "Create Table" button in the dialog box to trigger the table creation command. The command includes the distribution box number, circuit information, and environmental information selected in the pop-up creation dialog box. Figure 4 The diagram shows a secondary table creation dialog box for standard lighting distribution boxes or standard power distribution boxes. Users can select the corresponding distribution box number in the standard template of the secondary table creation dialog box and trigger the table creation command. The table creation command carries the distribution box number selected by the user in the pop-up creation dialog box.

[0039] In the case of a self-built lighting distribution box or a self-built power distribution box, the names displayed in the template name and circuit name in the secondary table creation dialog box can be obtained by the software accessing the standard template distribution box tables stored in the table creation template, finding all standard template distribution box tables belonging to the lighting or power distribution box, and extracting the distribution box numbers of all standard template distribution box tables and arranging them in the template name in the secondary table creation dialog box. When the user selects the corresponding distribution box number in the template name in the secondary table creation dialog box according to the current distribution box table to be created, the software reads the standard template distribution box table corresponding to the selected distribution box number in the table creation template, and obtains the user equipment names of all circuits from it and arranges them in the circuit name in the secondary table creation dialog box, so that the user can select the required circuits and the corresponding number of circuits according to the actual situation.

[0040] Step S240: Based on the distribution box table type and distribution box information, read the distribution box data from the pre-established distribution box database and create the corresponding distribution box table in the distribution box worksheet.

[0041] Based on the type of distribution box selected by the user, the software obtains the corresponding distribution box information by creating a dialog box.

[0042] The distribution box worksheet automatically creates a distribution box table according to the table structure defined in the table creation template. The table consists of three parts: TableHeader, Circuit, and TableFooter.

[0043] The distribution box database can be manually entered and saved by the user in advance through an Excel application. The distribution box database includes at least a lighting distribution box worksheet, a power distribution box worksheet, a table creation template, a standard distribution box library, an outgoing line block table, an incoming line block table, a load calculation table width definition and configuration table.

[0044] The lighting distribution box worksheet is used to store the lighting distribution box tables that need to be created. The software can write to the lighting distribution box tables that need to be created or clear the existing lighting distribution box tables.

[0045] It should be understood that the lighting distribution box table is established within the lighting distribution box worksheet.

[0046] It should be understood that the type of lighting distribution box can be a self-built lighting distribution box or a standard lighting distribution box.

[0047] The power distribution box worksheet is used to store the power distribution box tables that need to be created. The power distribution box worksheet can be used by the software to write to the lighting distribution box tables that need to be created or to clear the existing lighting distribution box tables.

[0048] It should be understood that the power distribution box meter is established within the power distribution box worksheet.

[0049] It should be understood that the type of power distribution box can be a self-built power distribution box or a standard power distribution box.

[0050] The method for establishing the distribution box database is as follows: Create an Excel template file named Template.xlsm, set up a worksheet for the table creation template, and manually create and store standard template distribution box tables in the worksheet to construct the table creation template. The template format for the standard template distribution box tables in the table creation template is set to define the structural positioning information of the standard template distribution box tables using Excel's named range mechanism, including the distribution box number position, distribution box model position, header end position, footer start position, footer end position, and column position of each circuit's data column. Simultaneously, according to the drawing needs, pre-create data lookup tables such as a standard distribution box library, outgoing line block table, incoming line block table, load calculation table width definition, and configuration table.

[0051] It should be understood that a standard template distribution box table is a distribution box table manually created by the user in a table creation template. This standard template distribution box table includes a header, a circuit row area, and a footer. Each distribution box type corresponds to one standard template distribution box table. For example, if the distribution box type is an emergency lighting distribution box (lighting), there is a corresponding standard template distribution box table for the emergency lighting distribution box (lighting) in the table creation template. The header of this standard template distribution box table stores the distribution box number (i.e., emergency lighting distribution box (lighting)) and the distribution box model. The circuit row area stores the electrical parameters of all circuits that may be used in the emergency lighting distribution box (lighting). The footer stores information such as the subtotal, total, incoming lines, load calculation formula for the dual power automatic transfer switch (ATS) of the emergency lighting distribution box (lighting), and remarks.

[0052] The column positions for each circuit data column include the serial number, circuit number, circuit name (or electrical equipment name), number of equipment, phase sequence, rated power, equipment efficiency, demand factor, power factor (cosφ), installed power, calculated capacity (Pc), calculated current (Ic), component specifications (including series / model / setting value), and line specifications (including the number of parallel cables, conductor type, calculated cross-section, protection pipe type, and protection pipe specification).

[0053] The standard distribution box library stores various standard distribution box tables, such as elevator distribution boxes, substation general distribution boxes, and substation fire protection distribution boxes. The format of the standard distribution box tables is the same as that of the distribution box tables in the table creation template, including the location of the distribution box number, the location of the distribution box model, the end of the table header, the beginning of the table footer, the end of the table footer, and the column positions of the data columns for each circuit.

[0054] In one example, a schematic diagram of a portion of the standard distribution box table in a standard distribution box library is shown below. Figure 5 As shown, Figure 5 In the standard distribution box table for elevator distribution box (numbered as "one unit"), rows 1-5 of the Excel spreadsheet are the header of the standard distribution box table, rows 6-14 are the loop row areas of the standard distribution box table, and rows 15-22 are the footer of the standard distribution box table.

[0055] The format of each distribution box table in the table creation template is the same as that of the distribution box tables in the standard distribution box library, so it will not be described again.

[0056] The incoming line block table defines the relevant parameters of the incoming line blocks. In one example, the incoming line block table is as follows: Figure 6 As shown.

[0057] The outgoing line block table defines the relevant parameters of the outgoing line blocks.

[0058] The width of the load calculation table defines the width of each row displayed in the calculation table of the special load block in the CAD drawing.

[0059] The configuration table defines the location of the reference models for the electrical equipment selection table of the distribution box, which is used to determine the location of the reference models for the electrical equipment selection table of the distribution box when drawing the distribution box diagram.

[0060] In one embodiment, when the distribution box type is a self-built lighting distribution box or a self-built power distribution box, the distribution box information includes the distribution box number, circuit information, and environmental information; when the distribution box type is a standard lighting distribution box or a standard power distribution box, the distribution box information includes the distribution box number.

[0061] In one embodiment, based on the distribution box table type and distribution box information, distribution box data is read from a pre-established distribution box database, and a corresponding distribution box table is created in the distribution box worksheet, including: If the distribution box table type is a self-built lighting distribution box or a self-built power distribution box, read the corresponding distribution box worksheet, locate the current insertion position based on the used area in the distribution box worksheet; access the pre-established distribution box database, copy the table header template from the pre-established table creation template, paste the table header template at the current insertion position, and fill in the distribution box number in the distribution box number position of the table header; according to the circuit information, sequentially search for the corresponding circuit row in the pre-established table creation template of the distribution box database, copy and paste the found circuit row into the circuit row area of ​​the distribution box worksheet, and adjust the protection pipe type of the circuit row based on the environmental information; copy the table footer from the pre-established table creation template of the distribution box database, paste the table footer in the next row of the circuit row area, and inherit the load calculation formulas and remarks of subtotal, total, incoming line, ATS, etc., to complete the creation of the corresponding distribution box table.

[0062] It should be understood that if the distribution box table type is a self-built lighting distribution box, then the lighting distribution box worksheet should be read; if the distribution box table type is a self-built power distribution box, then the power distribution box worksheet should be read.

[0063] The distribution box model field in the distribution box table is used to fill in the distribution box model. This field can be set in advance based on the distribution box model in the table template and standard distribution box library. Alternatively, the distribution box model can be left unset, in which case the distribution box model in the established distribution box table does not need to be filled in. Or, the distribution box model can be pre-set in the software based on the manufacturer or purpose of the distribution box, and the distribution box model can be filled in at the same time when the distribution box number is entered into the table header.

[0064] In one embodiment, based on the distribution box table type and distribution box information, distribution box data is read from a pre-established distribution box database, and a corresponding distribution box table is created in the distribution box worksheet, including: If the distribution box table type is a standard lighting distribution box or a standard power distribution box, read the corresponding distribution box worksheet, locate the current insertion position based on the used area in the distribution box worksheet, access the pre-established distribution box database, copy the table header, loop row, and table footer from the standard distribution box library of the pre-established distribution box database according to the distribution box number, paste them to the current insertion position, and inherit the load calculation formulas for subtotal, total, incoming line, and automatic transfer switch (ATS) to complete the creation of the corresponding distribution box table.

[0065] When creating a distribution box table, you can either add a new distribution box table based on an existing one in the distribution box worksheet, or add a new one after clearing the existing worksheet. Table creation can be based on the user's work progress. For example, if you are creating a distribution box table for a new building distribution box system project while drawing the building distribution box system diagram, you can click the "Create New Table" button in the first-level table creation dialog box to clear all distribution box tables in the current lighting and power distribution box worksheets, and then click the distribution box type in the first-level table creation dialog box to complete the subsequent table creation steps. If you are adding a new distribution box table to the current distribution box worksheet, you can directly add a new distribution box table by clicking the "Self-built Lighting Distribution Box," "Self-built Power Distribution Box," "Standard Lighting Distribution Box," or "Standard Power Distribution Box" buttons in the first-level table creation dialog box.

[0066] It should be understood that if a distribution box table is created for a new building distribution box system project, and there is no used area in the distribution box worksheet, the current insertion position is the first row; if a new distribution box table is added to the current distribution box worksheet, the current insertion position is the row below, two rows below, or three rows below the used area in the current distribution box worksheet, etc. The specific settings can be adjusted according to the actual situation.

[0067] In one example, the software automatically creates a lighting distribution box table in the lighting distribution box worksheet, locates the insertion position, and automatically fills in the distribution box number and model in the header of the table based on the distribution box number obtained from the creation dialog box. It then copies and pastes circuit rows from the table template to the current circuit row area based on the circuit information obtained from the creation dialog box, fills in the electrical parameters for each circuit, and completes the copying and pasting of all circuits. Finally, it copies and pastes the load calculation formula from the table template to the footer. When filling in the electrical parameters for each circuit, for single-phase circuits, the phase sequence is allocated sequentially according to L1, L2, L3, and the protection pipe type is automatically filled in according to the environmental information. Here, L1, L2, and L3 refer to the three phase wires of a three-phase AC power supply. The completed distribution box representation is, for example... Figure 7 As shown.

[0068] Step S260: Upon receiving a table update instruction, update the distribution box worksheet according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet.

[0069] The table update function can update a single distribution box worksheet individually, or update the lighting distribution box worksheet and the power distribution box worksheet with one click.

[0070] In one embodiment, the distribution box worksheet is updated according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet, including: When the table update type carried in the table update instruction is to update all tables, it iterates through all circuit rows of all distribution box tables in all distribution box worksheets, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box connection relationship, and obtains the updated distribution box worksheet. When the table update instruction carries the table update type of updating the lighting table or updating the power table, it traverses all circuit rows of all distribution box tables in the lighting or power distribution box worksheet, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box link relationship, and obtains the updated distribution box worksheet.

[0071] In one embodiment, the method for automatically maintaining the connection relationship of the distribution box includes: An index dictionary is created based on the distribution box number. All loop rows of all distribution box tables in the corresponding distribution box worksheet are traversed. When a loop row is encountered where the equipment name field is the distribution box number of another distribution box table, the other distribution box table is used as the linked distribution box table. The total parameters in the linked distribution box table are copied to the loop row using formula references. At the same time, the distribution box number and loop number of the current distribution box table are written to the incoming line position of the linked distribution box table, thus establishing a cascading link relationship between the current distribution box table and other distribution box tables.

[0072] The process can begin by identifying all distribution box tables in the distribution box worksheet using a "serial number with a number above it" identifier. Then, the summation range row numbers of each custom summary function in the distribution box table are synchronized with the row numbers of the first and last circuit rows. The load calculation formula at the end of the table is updated. Further, the circuit numbers are numbered according to their letter prefixes (e.g., WL01, WL02). Continuing rows do not participate in the numbering; circuit numbers are automatically assigned. Finally, for circuit rows with cascading relationships, the total parameters of the lower-level distribution box table are copied to this circuit row. The distribution box information of this distribution box table is then backfilled to the incoming line 1 or step 2 of the lower-level distribution box table.

[0073] The software iterates through all the circuit rows in the distribution box worksheet, automatically assigns circuit numbers (e.g., when multiple devices using the same electrical equipment are used in one distribution box worksheet, the circuit numbers for the multiple devices need to be assigned), and updates the load calculation formula at the end of the table to ensure that the row range in the formula matches the actual circuit rows precisely.

[0074] In one example, a user clicks the "Update All Tables" button in the first-level table creation dialog box. The software receives a table update instruction, which carries the information that the table update type is "Update All Tables." Based on the table update type, the software performs the following operations on each distribution box table in the lighting and power distribution box worksheets: automatically assigning circuit numbers (e.g., WL01, WL02), updating the summation formula range for the subtotal and total rows at the end of the table, etc. It also automatically maintains the distribution box link relationships: an index dictionary is built based on the distribution box number, and all circuit rows in each distribution box table are traversed. When the equipment name field is another distribution box number, a cascading link relationship is automatically established. The total parameters (i.e., the data at the end of the table) of the linked distribution box table are copied to the circuit row of the current distribution box table using formula references. Simultaneously, the information of the current distribution box table (distribution box number + circuit number) is written to the incoming line position of the linked distribution box table.

[0075] In one instance, such as Figure 8 As shown, when the distribution box table with the current distribution box number 1AL is traversed, if it is found that the name of the electrical equipment in a certain circuit row of the distribution box table ...

[0076] When updating the distribution box worksheet, if the electrical parameter information (such as rated power, circuit number, etc.) of individual circuits in the circuit row of the distribution box worksheet changes, after changing the parameters, the program refresh function will use the function of automatically establishing cascading links to rewrite the data changes into the distribution box worksheet, so as to realize timely updates of the table data.

[0077] Step S280: Upon receiving the instruction to draw a system diagram, draw the distribution box system diagram based on the updated distribution box worksheet and the pre-established distribution box database, and generate a DXF file of the distribution box system diagram.

[0078] DXF files are an open and readable graphic file format for AutoCAD design. A DXF file can include global drawing settings, such as drawing extent, units, layers, line types, text styles, block definitions (entry and exit blocks, etc.), the actual drawn graphics (lines, circles, block references, etc.), and file end markers, among other information.

[0079] In one embodiment, upon receiving a system diagram drawing instruction, a distribution box diagram is drawn based on the updated distribution box worksheet and a pre-established distribution box database, and a DXF file of the distribution box system diagram is generated, including: Upon receiving the system diagram drawing instruction, the system reads the outgoing line block table, incoming line block table, load calculation table width definition, and configuration table from the pre-established distribution box database via the DXF file interface; loads the DXF drawing template and parses all distribution box tables in the lighting distribution box worksheet and power distribution box worksheet; determines the corresponding drawing frame and the arrangement position of the corresponding blocks for each circuit in each distribution box table according to the preset distribution box diagram layout rules; scans and performs keyword matching on the series fields of the component specification column of each circuit row in each distribution box table of the updated distribution box worksheet to identify multi-occupying devices in the distribution box table, and assigns block names according to the number of circuits occupied by the multi-occupying devices; based on the arrangement position of each circuit in each distribution box table and the block names of multi-occupying devices, draws the incoming line block, outgoing line switch block, and load parameter table for each distribution box diagram in the corresponding drawing frame, fills in the distribution box electrical equipment selection list, and generates the DXF file of the distribution box system diagram.

[0080] The distribution box system diagram may include the distribution box diagrams corresponding to all the distribution box tables in the lighting distribution box worksheet and the power distribution box worksheet.

[0081] The electrical equipment selection list for the distribution box includes all electrical equipment selections in the distribution box system diagram, and may also include notes on the electrical equipment selections.

[0082] This includes pre-establishing a database of manufacturer references to record notes on the selection of various electrical equipment. The corresponding notes can be retrieved from this database and entered into the electrical equipment selection overview table for the distribution box.

[0083] The process involves creating AutoCAD drawing files via the DXF file interface and generating a distribution box system diagram using the following sub-steps: calculating the width of the distribution box diagram based on the number of circuits in each distribution box table and automatically splitting distribution boxes exceeding the drawing frame capacity; managing drawing frame dimensions through drawing frame classes and automatically arranging the layout; finding and inserting corresponding CAD blocks based on the incoming line type and switch series; labeling switch models and setting values; traversing circuit rows to draw outgoing switch blocks; drawing a load parameter table and automatically adjusting column widths; and saving the DXF file.

[0084] In one example, when a user clicks the "Draw System Diagram" button in the first-level table creation dialog box of the creation dialog box, the software reads data lookup tables such as the outgoing line block table, incoming line block table, load calculation table width definition, and configuration table; parses all distribution box tables in the lighting and power distribution box worksheet; calculates the graphic width of the distribution box diagram for each distribution box table based on the number of circuit rows and automatically splits it; automatically arranges the distribution box diagrams according to the preset distribution box diagram layout rules in the diagram layout algorithm; sequentially draws the incoming line blocks of the distribution box diagram, labels the switch models and setting values, traverses the circuit rows of the distribution box table to draw outgoing switch blocks and labels the models and setting values, automatically adjusts the column widths of the load parameter table according to the load name, and saves it as a DXF file.

[0085] The diagram layout algorithm can be an algorithm that prioritizes arranging the distribution box system diagram in a preset first-level diagram frame. If the preset first-level diagram frame cannot accommodate the distribution box system diagram, then a preset second-level diagram frame is used to arrange the distribution box system diagram, and the diagram is automatically wrapped within the diagram frame.

[0086] The preset first-level title block is smaller than the preset second-level title block.

[0087] The sizes of the preset first-level drawing frame and the preset second-level drawing frame can be set according to the user's drawing experience.

[0088] In one embodiment, the preset distribution box layout rules include: Following the updated distribution box worksheet's arrangement order, the corresponding distribution box diagrams are first arranged from left to right and top to bottom within the preset primary view frame. If the preset primary view frame cannot accommodate all the distribution box diagrams, they are then arranged from left to right and top to bottom within the preset secondary view frame. If the preset secondary view frame cannot accommodate all the distribution box diagrams, the lighting distribution box diagrams corresponding to the lighting distribution box table and the power distribution box diagrams corresponding to the power distribution box table in the updated distribution box worksheet are arranged separately within their respective secondary view frames. In the drawing frame, if the preset first-level drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams from left to right and from top to bottom, then when arranging the lighting distribution box diagrams or all the power distribution box diagrams in the preset second-level drawing frame from left to right and from top to bottom, if the current preset second-level drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams, a new preset second-level drawing frame is added to arrange the remaining lighting distribution box diagrams or power distribution box diagrams, and so on, until all the lighting distribution box diagrams or all the power distribution box diagrams are arranged. When arranging the distribution box diagrams corresponding to each distribution box table, it is determined whether the current row of the current frame has already been arranged with other distribution box diagrams and the remaining width. Based on the preset block width corresponding to the circuit row of the distribution box table to be arranged, the total width of the distribution box diagram corresponding to that distribution box table is calculated. It is then determined whether the total width of the distribution box diagram is less than or equal to the remaining width of the current row. If it is less than or equal to the remaining width of the current row, and other distribution box diagrams have already been arranged, the corresponding blocks for each circuit in that distribution box table are arranged sequentially starting at a preset distance from the right edge of the previously arranged distribution box diagram. Based on the arrangement of the blocks, if the block size is less than or equal to the specified value and no other distribution box diagrams are arranged, start from the leftmost position of the current row and arrange the corresponding blocks for each circuit in the distribution box table sequentially to determine the arrangement position of the corresponding blocks for each circuit in the distribution box table; if the block size is greater than the specified value, start from the leftmost position of the next row in the current row and arrange the corresponding blocks for each circuit in the distribution box table sequentially. If one row is not enough, arrange the unarranged circuits of the distribution box diagram to the next row after the current row, and so on, until all the corresponding blocks for each circuit in the distribution box table are arranged, thus determining the arrangement position of the corresponding blocks for each circuit in the distribution box table.

[0089] The remaining width can be determined by starting at a preset distance from the right edge of the previous distribution box diagram and ending at the edge of the current row.

[0090] It should be understood that the rightmost and leftmost positions refer to the edges of the drawable blocks within the drawing frame.

[0091] If the total width of the distribution box diagram is greater than the remaining width of the current row, and the current row is the last row of the diagram frame, then a new diagram frame is added and arranged in the newly added diagram frame.

[0092] In one embodiment, the component specification column of each circuit row in each distribution box table of the updated distribution box worksheet is scanned and keyword matched to identify multi-occupying devices in the distribution box table. Block names are then assigned based on the number of circuits occupied by the multi-occupying devices, including: The system scans the component specification column of each loop row in the updated distribution box worksheet, matching the scan results with preset multi-occupying device keywords to identify multi-occupying devices in the distribution box table. Within the distribution box table, it identifies loop sequences that continuously occupy the same multi-occupying device and counts the length n of these sequences. When n equals 1, it assigns an independent block name to the multi-occupying device. When n equals 2, it assigns left and right block names to the multi-occupying device. When n is greater than 2, it assigns left block, m intermediate blocks, and right block names to the multi-occupying device, where the number of intermediate blocks is m = n - 2. When drawing the multi-occupying device, it calls the corresponding blocks according to the assigned block names and sequentially assembles and draws the graphic of the multi-occupying device.

[0093] When drawing a multi-occupying device, the corresponding block is called according to the assigned block name, and the graphic of the multi-occupying device is drawn by splicing them together in sequence.

[0094] Among them, the intelligent identification of multi-occupying devices: scans the series of fields in the component specification column of each loop row, identifies multi-occupying devices such as intelligent switch controllers and centralized meters through keyword matching, and automatically assigns block names such as left block, middle block, right block or independent block according to the number of loops occupied by the multi-occupying devices.

[0095] The software reads the multi-block parameters from the outgoing line block table, scans the three-line switch series fields of each circuit, identifies multi-occupying devices such as smart switches, automatically assigns block names of left / middle / right / independent blocks to continuous smart switch circuits, and records the multi-occupying device labels and display positions.

[0096] It should be understood that the block name is used to call the block corresponding to the block name when drawing the multi-occupancy device. In one example, such as Figure 9 The examples shown are of the left block, middle block, right block, and independent block of a centralized meter. In one example, as shown... Figure 10 In the distribution box diagram shown, the 10-digit centralized meter spans 10 circuits. When drawing the block of the 10-digit centralized meter, it is necessary to piece together one left block, eight middle blocks, and one right block.

[0097] The above-mentioned automatic drawing method for building electrical distribution box system diagrams, through Excel template-based table creation, automated calculation, and automatic generation of DXF drawings, can reduce a lot of repetitive work, avoid errors caused by manual operation, and realize the intelligent and automated design process of building electrical distribution box system diagrams. It solves the problems of low table creation efficiency, error-prone load calculation, and large workload of CAD drawing in the existing design process, and realizes full-process automation from the input of distribution box parameters to the output of CAD drawings, which greatly improves design efficiency and quality.

[0098] The aforementioned method for automatically drawing building electrical distribution box system diagrams utilizes Excel templates for table creation, automated programming for calculations, and automatic generation of DXF drawings. It eliminates the need for manual table creation, numbering, parameter calculation, and drawing. This achieves full automation from inputting distribution box parameters to outputting CAD drawings, significantly reducing repetitive work and avoiding errors caused by manual operation. It realizes intelligent and automated design processes for building electrical distribution box system diagrams, significantly simplifying the process, reducing errors, and improving efficiency and quality.

[0099] To verify the beneficial effects of the automatic drawing method for building electrical distribution box system diagrams in this application, tests were conducted. Using this method, a commercial building project containing 15 lighting distribution boxes and 8 power distribution boxes was designed. From table creation to generating DXF drawings, it took only about 1 hour, compared to about 8 hours using the traditional manual method, reducing the time by approximately 87.5%. The generated DXF drawings had a uniform format and accurate parameters.

[0100] This method for automatically drawing building electrical distribution box system diagrams achieves a high degree of automation in the design process, significantly simplifying the design workflow and greatly improving efficiency and quality. This automated design technology is applicable to the design of electrical distribution box system diagrams for various types of buildings.

[0101] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0102] In one embodiment, an automatic drawing system for building electrical distribution box system diagrams is provided, comprising: The distribution box information acquisition module is used to acquire the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box when a table creation instruction is received; The distribution box worksheet generation module is used to read the distribution box data in the pre-established distribution box database according to the distribution box table type and distribution box information, and create the corresponding distribution box table in the distribution box worksheet. The distribution box worksheet includes the lighting distribution box worksheet and the power distribution box worksheet. The distribution box worksheet update module is used to update the distribution box worksheet according to the table update type carried in the table update instruction when a table update instruction is received, so as to obtain the updated distribution box worksheet. The DXF file generation module is used to draw a distribution box system diagram based on the updated distribution box worksheet and the pre-established distribution box database when a system diagram drawing instruction is received, and to generate a DXF file of the distribution box system diagram.

[0103] Specific limitations regarding the automatic drawing system for building electrical distribution box system diagrams can be found in the above-mentioned limitations section and will not be repeated here. Each module in the aforementioned automatic drawing system for building electrical distribution box system diagrams can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0104] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method for automatically drawing building distribution box system diagrams.

[0105] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method for automatically drawing building electrical distribution box system diagrams.

[0106] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0107] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0108] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for automatically drawing a system diagram of a building distribution panel, characterized by, The method for automatically drawing building electrical distribution box system diagrams includes: When a table creation command is received, the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box are obtained. Based on the distribution box table type and the distribution box information, read the distribution box data in the pre-established distribution box database, and create the corresponding distribution box table in the distribution box worksheet. The distribution box worksheet includes a lighting distribution box worksheet and a power distribution box worksheet. Upon receiving a table update instruction, the distribution box worksheet is updated according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet. Upon receiving the instruction to draw a system diagram, the system diagram of the distribution box is drawn based on the updated distribution box worksheet and the pre-established distribution box database, and a DXF file of the distribution box system diagram is generated.

2. The method of claim 1, wherein, When the type of the distribution box is a self-built lighting distribution box or a self-built power distribution box, the distribution box information includes the distribution box number, circuit information, and environmental information; when the type of the distribution box is a standard lighting distribution box or a standard power distribution box, the distribution box information includes the distribution box number. The step of reading distribution box data from a pre-established distribution box database based on the distribution box table type and the distribution box information, and creating a corresponding distribution box table in the distribution box worksheet, includes: If the type of the distribution box table is a self-built lighting distribution box or a self-built power distribution box, read the corresponding distribution box work table and locate the current insertion position according to the used area in the distribution box work table; Access the pre-established distribution box database, copy the table header template from the table creation template of the pre-established distribution box database, paste the table header template at the current insertion position, and fill in the distribution box number in the distribution box number position of the table header; Based on the circuit information, the corresponding circuit rows are sequentially searched in the table template of the pre-established distribution box database. The found circuit rows are copied and pasted into the circuit row area of ​​the distribution box worksheet, and the protection pipe type of the circuit row is adjusted based on the environmental information. Copy the table footer in the pre-established table template of the distribution box database, paste the table footer in the next row of the circuit row area, and inherit the load calculation formulas of subtotal, total, incoming line and ATS to complete the establishment of the corresponding distribution box table; If the type of the distribution box is a standard lighting distribution box or a standard power distribution box, read the corresponding distribution box worksheet and locate the current insertion position according to the used area in the distribution box worksheet; Access the pre-established distribution box database, copy the table header, loop row, and table footer from the standard distribution box library of the pre-established distribution box database according to the distribution box number, paste them to the current insertion position, and inherit the load calculation formulas for subtotal, total, incoming line, and ATS to complete the creation of the corresponding distribution box table.

3. The method of claim 1, wherein, The step of updating the distribution box worksheet according to the table update type carried in the table update instruction to obtain the updated distribution box worksheet includes: When the table update instruction carries the table update type of updating all tables, it iterates through all circuit rows of all distribution box tables in all distribution box worksheets, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box connection relationship, and obtains the updated distribution box worksheet. When the table update instruction carries the table update type of updating the lighting table or updating the power table, it traverses all circuit rows of all distribution box tables in the lighting or power distribution box worksheet, automatically assigns circuit numbers, updates the load calculation formula in the end of the distribution box table, automatically maintains the distribution box connection relationship, and obtains the updated distribution box worksheet.

4. The method for automatically drawing building electrical distribution box system diagrams according to claim 3, characterized in that, The automatic maintenance distribution box connection methods include: An index dictionary is created based on the distribution box number. All loop rows of all distribution box tables in the corresponding distribution box worksheet are traversed. When a loop row is encountered where the equipment name field is the distribution box number of another distribution box table, the other distribution box table is used as the linked distribution box table. The total parameters in the linked distribution box table are copied to the loop row using formula references. At the same time, the distribution box number and loop number of the current distribution box table are written to the incoming line position of the linked distribution box table, thus establishing a cascading link relationship between the current distribution box table and other distribution box tables.

5. The method for automatically drawing building electrical distribution box system diagrams according to claim 1, characterized in that, Upon receiving the instruction to draw a system diagram, the system diagram of the distribution boxes is drawn based on the updated distribution box worksheet and the pre-established distribution box database, and a DXF file of the distribution box system diagram is generated, including: Upon receiving the instruction to draw a system diagram, the system reads the outgoing line block table, incoming line block table, load calculation table width definition, and configuration table from the pre-established distribution box database through the DXF file interface. Load the DXF drawing template and parse all the distribution box tables in the lighting distribution box worksheet and the power distribution box worksheet. According to the preset layout rules of the distribution box diagram, determine the corresponding drawing frame and the layout position of the corresponding block of each circuit in each distribution box table; Scan and perform keyword matching on the series of fields in the component specification column of each circuit row of each distribution box table in the updated distribution box worksheet to identify multi-occupying devices in the distribution box table, and assign block names according to the number of circuits occupied by the multi-occupying devices; Based on the layout of each circuit in each distribution box table and the block name of the multi-occupying equipment, draw the incoming line block, outgoing switch block, and load parameter table for each distribution box diagram in the corresponding drawing frame, fill in the distribution box electrical equipment selection list, and generate a DXF file of the distribution box system diagram.

6. The method for automatically drawing building electrical distribution box system diagrams according to claim 5, characterized in that, The process involves scanning and keyword matching of the component specification column in each loop row of each distribution box table in the updated distribution box worksheet to identify multi-occupying devices in the distribution box table. Based on the number of loops occupied by these multi-occupying devices, block names are assigned, including: The series of fields in the component specification column of each circuit row of each distribution box table in the updated distribution box worksheet are scanned, and the scan results are matched with the preset multi-occupying device keywords to determine the multi-occupying devices in the distribution box table; In the power distribution box table, find the circuit sequence that continuously occupies the same multi-occupying device, and count the length n of the circuit sequence; When n equals 1, assign a tile name to the multi-occupying device with an independent tile; When n equals 2, assign tile names for the left and right tiles to the multi-occupying device; When n is greater than 2, assign the names of the left block, m intermediate blocks and the right block to the multi-occupying device, where the number of intermediate blocks m = n - 2.

7. The method for automatically drawing building electrical distribution box system diagrams according to claim 5, characterized in that, The preset distribution box layout rules include: Following the updated distribution box worksheet's arrangement order, the corresponding distribution box diagrams are first arranged from left to right and top to bottom within the preset primary view frame. If the preset primary view frame cannot accommodate all the distribution box diagrams, they are then arranged from left to right and top to bottom within the preset secondary view frame. If the preset secondary view frame cannot accommodate all the distribution box diagrams, the lighting distribution box diagrams corresponding to the lighting distribution box diagrams and the power distribution box diagrams corresponding to the power distribution box diagrams in the updated distribution box worksheet are arranged separately. Within their respective drawing frames, if the preset primary drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams arranged from left to right and from top to bottom, then the preset secondary drawing frame will arrange each lighting distribution box diagram or each power distribution box diagram from left to right and from top to bottom. If the current preset secondary drawing frame cannot accommodate all the lighting distribution box diagrams or all the power distribution box diagrams, a new preset secondary drawing frame will be added to arrange the remaining lighting distribution box diagrams or power distribution box diagrams, and so on, until all the lighting distribution box diagrams or all the power distribution box diagrams are arranged. When arranging the distribution box diagrams corresponding to each distribution box table, it is determined whether the current row of the current frame has already been arranged with other distribution box diagrams and the remaining width. Based on the preset block width corresponding to the circuit row of the distribution box table to be arranged, the total width of the distribution box diagram corresponding to that distribution box table is calculated. It is then determined whether the total width of the distribution box diagram is less than or equal to the remaining width of the current row. If it is less than or equal to the remaining width of the current row, and other distribution box diagrams have already been arranged, the corresponding blocks for each circuit in that distribution box table are arranged sequentially starting at a preset distance from the right edge of the previously arranged distribution box diagram. Based on the arrangement of the blocks, if the block size is less than or equal to the specified value and no other distribution box diagrams are arranged, start from the leftmost position of the current row and arrange the corresponding blocks for each circuit in the distribution box table sequentially to determine the arrangement position of the corresponding blocks for each circuit in the distribution box table; if the block size is greater than the specified value, start from the leftmost position of the next row in the current row and arrange the corresponding blocks for each circuit in the distribution box table sequentially. If one row is not enough, arrange the unarranged circuits of the distribution box diagram to the next row after the current row, and so on, until all the corresponding blocks for each circuit in the distribution box table are arranged, thus determining the arrangement position of the corresponding blocks for each circuit in the distribution box table.

8. An automatic drawing system for building electrical distribution box system diagrams, characterized in that, include: The distribution box information acquisition module is used to acquire the distribution box table type and distribution box information selected by the user in the pop-up creation dialog box when a table creation instruction is received; The distribution box worksheet generation module is used to read the distribution box data in the pre-established distribution box database according to the distribution box table type and the distribution box information, and to create the corresponding distribution box table in the distribution box worksheet. The distribution box worksheet includes a lighting distribution box worksheet and a power distribution box worksheet. The distribution box worksheet update module is used to update the distribution box worksheet according to the table update type carried in the table update instruction when a table update instruction is received, so as to obtain the updated distribution box worksheet. The DXF file generation module is used to draw a distribution box system diagram based on the updated distribution box worksheet and the pre-established distribution box database when a system diagram drawing instruction is received, and to generate a DXF file of the distribution box system diagram.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.