A method for automatically filling in attribute information of the frame title bar of a CAD drawing in batches
By storing drawing attribute information in the database table and using Python programming automation processing, the problem of low efficiency in filling the information of the drawing frame title bar in the power design industry is solved, and the automatic filling of large batches of drawings is realized, which improves efficiency and quality and reduces costs.
Patent Information
- Application Number
- CN202111410810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-11-19
AI Technical Summary
In the power design industry, the information filling of CAD drawing frame title bar information is inefficient and susceptible to human factors. Especially when PDM management software is not used, it is impossible to automatically fill in the attribute information of large batches of drawing files, resulting in large workload and low efficiency.
By storing drawing attribute information in the database table, using Python programming automation, traversing the drawings and inserting attribute information at the specified location, including drawing names, signatures, etc., to automatically fill the drawing box title bar in batches.
It improves the work efficiency of drawing design, reduces the workload, ensures the quality of filling in, and realizes comprehensive attribute information filling without using PDM software, reducing costs.
Smart Images

Figure CN114398857B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of methods for filling in information of CAD drawing frame title bars, and in particular to a method for automatically filling in batches of information of drawing frame title bars of CAD drawings. Background Art
[0002] Due to its versatility and ease of use, CAD software is primarily used in the power design industry to create design drawings. In the final design phase, drawing frame information needs to be filled in, a task currently accomplished manually. Due to the large number of drawings and the large amount of information and data in the drawing frame title bars during the construction drawing design phase, manual form filling is not only inefficient and time-consuming, but also highly susceptible to human error, requiring designers to expend considerable effort on repetitive tasks and checks.
[0003] At present, with the widespread application of PDM software, the technology of automatically filling in drawing frames in batches has been relatively widely used. However, this automatic filling technology is mainly implemented in the review stage of the PDM system, and is only for the personnel signature module. PDM is expensive, the implementation workload is large, and the use limitations are large. When PDM management software is not used, it is impossible to solve the problem of automatically filling in various attribute information of a large number of drawing files. Various attribute information and personnel signatures can only be filled in manually, which results in a large workload and low work efficiency. Summary of the Invention
[0004] The technical problem to be solved and the technical task proposed by the present invention are to improve and perfect the existing technical solutions and provide a method for automatically filling in the frame title bar information of CAD drawings in batches, so as to reduce the workload of filling in the frame title bar of CAD drawings. To this end, the present invention adopts the following technical solutions.
[0005] A method for automatically batch filling attribute information of a drawing frame title bar of a CAD drawing comprises the following steps:
[0006] 1) All the attribute information required to fill in the drawing frame and title bar of all drawings, including the drawing name and drawing number, are stored in the database table file. The signature blocks related to the names of the personnel are stored in the folders named according to the personnel names in DWG format through the mapping relationship in the database table;
[0007] 2) Traverse the database table, read the drawing numbers of all drawings, and store them in a collection;
[0008] 3) Traverse the drawing numbers in the collection, obtain the drawing file opening path by combining the drawing storage folder path with the drawing number, and open the corresponding drawing according to the drawing file path;
[0009] 4) In the open drawing, traverse all "Text" type objects in the drawing. If the string content of the traversed "Text" object is consistent with our fill target, record its coordinates;
[0010] 5) Determine the insertion position by increasing the horizontal coordinate value according to the fill target coordinate;
[0011] 6) Extract each attribute information from the database table storing the association relationship according to the drawing number and store it in the set of mapping relationships;
[0012] 7) Extracting attribute information from the set according to the corresponding relationship, inserting the corresponding attribute information at the insertion position calculated in step 5), wherein the inserted attribute information includes the signature block obtained according to the mapping relationship, and saving and closing the current drawing;
[0013] 8) Check whether the currently completed drawing is the last drawing in the set. If so, the process ends; if not, the process returns to step 3. This method can conveniently and automatically fill in the attributes of the title blocks and drawing frames in a large number of drawings. Compared with the traditional method of manually opening drawings one by one and filling in the drawing frame title blocks, it improves the efficiency and filling quality of drawing design work, reduces the workload of filling in the drawing frame title blocks of CAD drawings, and can fully fill in the attribute information of the drawing frame title blocks without the use of PDM software, which can effectively reduce costs.
[0014] As a preferred technical means: in step 1), the database table file adopts an EXCEL table, which is widely used and easy to maintain.
[0015] As a preferred technical approach: In step 1), attribute information includes the construction unit, project name, drawing title, drawing size, approval, design, review, verification, date, scale, drawing number, and the signatures of the corresponding approval, design, review, and verification personnel. This allows for comprehensive attribute information entry.
[0016] Beneficial effects: The method can conveniently realize the automatic filling of attributes in the title blocks and drawing frames in a large number of drawings. Compared with the traditional method of manually opening drawings one by one to fill in the drawing frame title blocks, it improves the efficiency and filling quality of drawing design work, reduces the workload of filling in the drawing frame title blocks of CAD drawings, and can realize the comprehensive filling of attribute information in the drawing frame title blocks without the use of PDM software, which can effectively reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic flow chart of the present invention. DETAILED DESCRIPTION
[0018] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings.
[0019] like Figure 1 As shown, a method for automatically batch filling attribute information of the drawing frame title bar of a CAD drawing includes the following steps:
[0020] 1) All the attribute information required to fill in the drawing frame and title bar of all drawings, including the drawing name and drawing number, are stored in the database table file. The signature blocks related to the names of the personnel are stored in the folders named according to the personnel names in DWG format through the mapping relationship in the database table;
[0021] 2) Run the CAD software, call the automatic drawing frame filling program, traverse the database table, import the corresponding drawings, read the drawing numbers of all drawings, and save them into a collection;
[0022] 3) Traverse the drawing numbers in the collection, obtain the drawing file opening path by combining the drawing storage folder path with the drawing number, and open the corresponding drawing according to the drawing file path;
[0023] 4) In the open drawing, traverse all "Text" type objects in the drawing. If the string content of the traversed "Text" object is consistent with our fill target, record its coordinates;
[0024] 5) Determine the insertion position by increasing the horizontal coordinate value based on the fill target coordinates. Taking the text object named "Approved" as an example, obtain its coordinates (x, y). Add the value to the x coordinate as the new x coordinate x1, which should remain unchanged, to obtain the insertion coordinates. Then, obtain the insertion coordinates of its signature attribute.
[0025] 6) Extract each attribute information from the database table storing the association relationship according to the drawing number and store it in the set of mapping relationships;
[0026] 7) Extracting attribute information from the set according to the corresponding relationship, inserting the corresponding attribute information at the insertion position calculated in step 5), wherein the inserted attribute information includes the signature block obtained according to the mapping relationship, and saving and closing the current drawing;
[0027] 8) Check whether the currently completed drawing is the last drawing in the collection. If so, end. If not, return to step 3), open a new drawing and continue processing until the traversal is completed.
[0028] In this example, the database table file is an Excel spreadsheet, which is widely used and easy to maintain.
[0029] In this example, attribute information includes the construction unit, project name, drawing title, drawing size, approval, design, review, verification, date, scale, drawing number, and the signatures of the corresponding approval, design, review, and verification personnel, thus achieving comprehensive attribute information entry.
[0030] In this example, Python is used as the programming language for secondary development of CAD software, and arrays or list containers are used as storage collections.
[0031] above Figure 1 The method shown in FIG. 1 is a specific embodiment of the present invention, which has embodied the outstanding substantial features and significant progress of the present invention. Based on actual usage needs and under the guidance of the present invention, equivalent modifications in shape, structure, etc. can be made to the method, which are all within the scope of protection of this scheme.
Claims
1. A method for automatically filling in the attribute information of the frame title bar of a CAD drawing in batches, characterized in that The following steps are involved: 1) All the attribute information required to fill in the drawing frame and title bar of all drawings, including the drawing name and drawing number, are stored in the database table file. The signature blocks related to the names of the personnel are stored in the folders named according to the personnel names in DWG format through the mapping relationship in the database table; 2) Traverse the database table, read the drawing numbers of all drawings, and store them in a collection; 3) Traverse the drawing numbers in the collection, obtain the drawing file opening path by combining the drawing storage folder path with the drawing number, and open the corresponding drawing according to the drawing file path; 4) In the open drawing, traverse all Text type objects in the drawing. If the string content of the traversed Text object is consistent with the fill target, record its coordinates; 5) Determine the insertion position by increasing the horizontal coordinate value according to the fill target coordinate; 6) Extract each attribute information from the database table storing the association relationship according to the drawing number and store it in the set of mapping relationships; 7) Extract attribute information from the set according to the corresponding relationship, insert the corresponding attribute information at the insertion position calculated in step 5), the inserted attribute information includes the signature block obtained according to the mapping relationship, save the current drawing and close it; 8) Check whether the currently completed drawing is the last drawing in the collection. If so, end; if not, return to step 3); In step 1), the database table file uses an EXCEL table; the attribute information includes the construction unit, project name, drawing name, drawing size, approval, design, review, verification, date, scale, drawing number and the signatures of the approval, design, review and verification personnel corresponding to the drawing number.
Citation Information
Patent Citations
Quick inserting pattern frame system and method
CN101055601A
CAD (computer-aided design) drawing information batch processing method based on ObjectArx
CN102830979A