CAD File Auxiliary Processing Method and System for the Air Conditioning Industry
Through automated processing methods and systems, the problem of low efficiency and accuracy of CAD file processing in the air conditioning industry is solved, and more efficient and accurate CAD file processing is achieved.
Patent Information
- Application Number
- CN202210711009.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-06-22
AI Technical Summary
There are problems with low efficiency and accuracy in the processing of CAD files in the air conditioning industry, which affects the design and development efficiency and drawing accuracy.
It provides a CAD file auxiliary processing method and system for the air conditioning industry. Through automated steps, it performs copying, pasting, scaling, labeling, renaming, material list extraction, drawing splitting and PDF conversion of CAD files, reducing manual operations and error rates.
It significantly reduces the workload of two-dimensional component drawings, reduces the probability of errors, simplifies the operation process, and improves processing efficiency and accuracy.
Smart Images

Figure CN115146327B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document auxiliary processing, and in particular to a CAD file auxiliary processing method and system for the air-conditioning industry. Background Art
[0002] In the air-conditioning industry, during the design process of a new air-conditioning product, product three-dimensional modeling and drawing, and two-dimensional component drawing processing work are required. Three-dimensional modeling mainly uses three-dimensional modeling software to perform three-dimensional modeling of air-conditioning products and two-dimensional component drawing work. The two-dimensional component drawings are mainly CAD files. The processing work of two-dimensional component drawings is mainly divided into the following steps: 1. Manually copy and paste all the original two-dimensional component drawing files into a CAD component general drawing file; 2. Manually search and match the corresponding standard drawing frames according to each component type; 3. Manually scale the two-dimensional component drawings according to the comparison between the component drawing area and the drawing frame size, and add the scaling ratio to the drawing frame detail column; 4. Manually fill in information such as the original names of the lower-level components in the component drawing bill of materials according to the two-dimensional component assembly relationship; 5. Perform drawing annotation according to different scaling scales of the two-dimensional component drawings; 6. Manually rename the component drawings in step 4 according to the officially applied component names; 7. Manually prepare a component material list by referring to the drawing frame detail column of the two-dimensional component drawings for processing and material procurement; 8. Manually split the component drawings in the two-dimensional component general drawing into single drawings for archiving; 9. To facilitate drawing access by personnel in different departments, it is necessary to manually convert the CAD file into a PDF text.
[0003] The above is the basic processing process of two-dimensional component drawings in the air-conditioning industry. Usually, a single air-conditioning product has hundreds of component drawings and dozens of drawing frame types. Manual mechanical repetitive work such as copying, pasting, searching, screening, matching, scaling, annotating, renaming, extracting material lists, splitting drawings, and PDF conversion is extremely time-consuming and has a very high error rate, seriously affecting the design and development efficiency of new air-conditioning products and the accuracy of design drawings. Summary of the Invention
[0004] The present invention aims to solve the problems of low efficiency and accuracy in the existing CAD file processing method in the air-conditioning industry, and proposes a CAD file auxiliary processing method and system for the air-conditioning industry.
[0005] The technical solutions adopted by the present invention to solve the above technical problems are as follows:
[0006] On the one hand, a CAD file auxiliary processing method and system for the air-conditioning industry are provided, including the following steps:
[0007] Step 1: Automatically move, scale, and copy the original diagram files corresponding to multiple components, calculate the world coordinate points of each original diagram in the general drawing file according to the preset arrangement method, and paste each original diagram to the corresponding position in the general drawing file according to the world coordinate points; and match and add corresponding standard drawing frames to each original diagram, and write the original file names of the corresponding original diagrams in the bill of materials of each standard drawing frame.
[0008] Step 2: Obtain the component assembly information list of the original diagram according to the storage information and storage relationship of the original diagram file, and write the content of the component assembly information list into the bill of materials of the corresponding standard drawing frame.
[0009] Step 3: Determine the types and prices of the components corresponding to each original diagram, determine the formal component names corresponding to each component according to the types and prices of the components, and replace the original file names in the bill of materials of each standard drawing frame with the formal component names.
[0010] Step 4: Extract information from the bill of materials of each standard drawing frame according to the extraction identification information to obtain the bill of materials corresponding to all components.
[0011] Step 5: Split each drawing in the general drawing file into single drawing files, modify the file names of each drawing according to the corresponding formal component names and save them to the specified directory, where the drawings include the original diagrams and their corresponding standard drawing frames.
[0012] Step 6: Check the general drawing file and the single drawing files. The check content includes at least: whether the formal component names are repeated or missing, whether there is missing content in the bill of materials of each standard drawing frame, whether there is overlap in each standard drawing frame, whether there are un-replaced original file names, whether the file names of the drawings are consistent with the corresponding formal component names, and whether the drawing scale marked on the drawing is consistent with the drawing scale.
[0013] Step 7: Convert each single drawing file to PDF format.
[0014] Further, the specific content of Step 1 includes:
[0015] Step 101: Obtain the directory of the original diagram folder to be copied, traverse and extract the names, absolute file paths, and file modification times of all DXF files in the original diagram folder and its sub-folders, and write the extracted content into the CAD template copy auxiliary table.
[0016] Step 102: Obtain the file copy storage directory, and store the absolute path information corresponding to the file copy storage directory in the specified area of the CAD template copy auxiliary table.
[0017] Step 103: Copy the auxiliary table according to the CAD template to perform boundary recognition of the original drawing of the mind map, scaling of the original drawing of the mind map, copying, pasting, screening and matching of the standard drawing frame, and filling of the original file name, and loop the operation until all the original drawing files of the mind map are copied.
[0018] Further, the specific steps of Step 103 include:
[0019] Step 1031: Obtain the template recognition list table defined by the user. The template recognition list table contains the internal file information of the standard drawing frame corresponding to each original drawing of the mind map. The internal file information of the standard drawing frame includes at least: the name of the standard drawing frame, the drawing frame size, the detail column size, the recognition identifier, the pasting area size of the original drawing of the mind map, the offset of the X-axis and Y-axis of the standard drawing frame, and the alignment method of the X-axis and Y-axis of the standard drawing frame;
[0020] Step 1032: Obtain the file information of the original drawing of the mind map. The file information of the original drawing of the mind map includes at least: the original file name of the original drawing of the mind map, the outer boundary size of the image, and the world coordinate point at the lower left corner of the boundary;
[0021] Step 1033: Obtain the external file information of the standard drawing frame defined by the user. The external file information of the standard drawing frame includes at least the file name string of the standard drawing frame and the absolute storage path;
[0022] Step 1034: Check the recognition identifier information. If no error prompt is issued after the check, go to Step 1035; otherwise, exit the file copying operation. The specific check of the recognition identifier information includes: whether the original file name of the original drawing of the mind map can match the recognition identifier and whether the standard drawing frame corresponding to the recognition identifier is missing;
[0023] Step 1035: Obtain the internal file information of the standard drawing frame corresponding to the original drawing of the mind map, specifically including: matching the recognition identifier according to the original file name string of the original drawing of the mind map, and determining the internal file information of the standard drawing frame corresponding to the recognition identifier;
[0024] Step 1036: Determine the actual scaling ratio required for the original drawing of the mind map according to the outer boundary size and pasting position of the original drawing of the mind map;
[0025] Step 1037: Scale the original drawing of the mind map according to the actual scaling ratio required for the original drawing of the mind map, calculate the translation distance according to the world coordinate point at the lower left corner of the boundary of the original drawing of the mind map, and move the original drawing of the mind map to the world coordinate point (0, 0);
[0026] Step 1038: Copy the original drawing of the mind map with its world coordinate point (0, 0) as the base point;
[0027] Step 1039: Calculate the world coordinate points of the original diagram in the general drawing file according to the preset arrangement method. The default world coordinate points for pasting the first original diagram into the general drawing file are (0, 0).
[0028] Step 10310: Paste the original diagram into the corresponding position in the general drawing file according to the world coordinate points of the original diagram in the general drawing file.
[0029] Step 10311: Calculate the world coordinate points of the standard drawing frame corresponding to the original diagram in the general drawing file according to the offsets of the X-axis and Y-axis of the standard drawing frame and the alignment methods of the X-axis and Y-axis of the standard drawing frame.
[0030] Step 10312: Search and copy the corresponding standard drawing frame in the external information of the user-defined standard drawing frame file according to the name of the standard drawing frame obtained in Step 1035.
[0031] Step 10313: Paste the standard drawing frame into the corresponding position in the general drawing file according to the calculated world coordinate points of the standard drawing frame in the general drawing file.
[0032] Step 10314: Write the original file name of the original diagram into the bill of materials of the corresponding standard drawing frame.
[0033] Step 10315: Determine whether the copying of all original diagrams is completed. If so, proceed to Step 10316; otherwise, repeat Steps 1035 to 10314.
[0034] Step 10316: Exit the file copying operation.
[0035] Further, the specific steps of Step 2 include:
[0036] Step 201: Obtain the source directory for text filling, and obtain the storage information and storage relationship of the original diagram files.
[0037] Step 202: Determine whether there is an error in the storage relationship of the original diagram files. If so, end the operation; otherwise, proceed to Step 203.
[0038] Step 203: Create multiple component assembly information lists based on the original diagram.
[0039] Step 204: Traverse and match the auxiliary tables and the corresponding drawings in the general drawing file under the directory of the file to be filled according to the component assembly information list and the CAD template, and perform the operation of filling the content of the bill of materials of the standard drawing frame of the corresponding drawings, specifically including:
[0040] Step 2041: Obtain the content of the user-defined template recognition list table and write it into an array.
[0041] Step 2042: Obtain the content of the multiple parts assembly information list newly created in Step 203 and write it into a dynamic array;
[0042] Step 2043: Obtain the title block information and name information of all the drawings in the general drawing file. The title block information includes at least: the world coordinate information of the lower left corner of the title block and the boundary dimensions;
[0043] Step 2044: Match the content of the parts assembly information list with the name information of the drawings to determine the parts assembly information to be filled in the current standard title block detail list;
[0044] Step 2045: Calculate the world coordinate points where the parts assembly information is written into the general drawing file based on the detail list dimensions and the boundary dimensions of the title block;
[0045] Step 2046: Perform the writing work of the parts assembly information based on the world coordinate points where the parts assembly information is written into the general drawing file and the font size selected by the user;
[0046] Step 2047: Determine whether all the parts assembly information writing work has been completed. If so, exit the text writing work; otherwise, repeat Steps 2044 to 2046.
[0047] Further, Step 3 specifically includes:
[0048] Step 301: Obtain the directory of the original drawing folder to be copied, obtain the file name string of the original drawing according to the directory of the original drawing folder, and write it into the CAD text replacement auxiliary table;
[0049] Step 302: Input price calculation parameters in the parts price list table and determine the prices of the parts corresponding to each original drawing according to the price calculation parameters. The price calculation parameters include at least: the corresponding part dimensions, material unit price, and processing fees;
[0050] Step 303: Determine the formal part names corresponding to each part according to the type and price of the parts;
[0051] Step 304: Paste the corresponding formal part names in the replacement area of the CAD text replacement auxiliary table;
[0052] Step 305: Check the name information of the file name string of the original drawing and the formal part names. If it is correct, enter Step 307; otherwise, enter Step 306;
[0053] Step 306: Modify the name information and then enter Step 305;
[0054] Step 307: Obtain the general drawing file directory, and write the names and storage path information of all components under the general drawing file directory into the CAD text replacement auxiliary table;
[0055] Step 308: Replace the original file names of all components with the corresponding formal component names according to the content of the CAD text replacement auxiliary table;
[0056] Step 309: Determine whether the name replacement work of all components is completed. If so, exit the name replacement work; otherwise, repeat Step 308.
[0057] Further, the specific steps of Step 4 include:
[0058] Step 401: Add extraction identification information to the bill of materials of the standard drawing frame;
[0059] Step 402: Select the list extraction source directory, and write the storage information of the general drawing files in the list extraction source directory into the CAD list extraction auxiliary table. The list extraction source directory is the storage directory of the general drawing files after adding extraction identification information;
[0060] Step 403: Extract the bill of materials corresponding to all components according to the list extraction source directory.
[0061] Further, the specific steps of Step 403 include:
[0062] Step 4031: Obtain the user-defined template recognition list table, and write the internal information of the corresponding standard drawing frame file into an array;
[0063] Step 4032: Obtain the content of the CAD list extraction auxiliary table;
[0064] Step 4033: Obtain the standard drawing frame information and name information of all drawings in the general drawing file. The standard drawing frame information includes at least: the world coordinates of the lower left corner of the standard drawing frame and the boundary dimensions;
[0065] Step 4034: Obtain the extraction identification information corresponding to all standard drawing frames in the general drawing file, and determine whether the extraction identification information is incorrect. If so, enter Step 4035; otherwise, enter Step 4036;
[0066] Step 4035: After modifying the extraction identification information, re-enter Step 4034;
[0067] Step 4036: Perform information loop traversal extraction on the bill of materials of each standard drawing frame according to the extraction identification information to obtain the bill of materials corresponding to all components;
[0068] Step 4037: Determine whether the information extraction work for all the itemized columns is completed. If so, exit the information extraction work; otherwise, repeat Step 4036.
[0069] Further, the specific steps of Step 5 are as follows:
[0070] Step 501: Select the source directory for drawing splitting. Obtain the name and storage path information of the general drawing file to be split according to the source directory for drawing splitting, and write them into the CAD drawing splitting auxiliary table.
[0071] Step 502: Select the storage directory for the split drawings, and write the path information in the storage directory for the split drawings into the CAD drawing splitting auxiliary table.
[0072] Step 503: Perform drawing splitting operations according to the CAD drawing splitting auxiliary table. Specifically, it includes:
[0073] Step 5031: Obtain the internal file information of the standard drawing frame in the user-defined template recognition list table, and write it into an array.
[0074] Step 5032: Obtain the name and storage path information of the general drawing file to be split in the CAD drawing splitting auxiliary table, and write it into an array.
[0075] Step 5033: Obtain all the drawing information to be split according to the name of the general drawing file to be split. The drawing information includes at least: drawing name, world coordinates of the lower left corner of the drawing frame, and boundary dimensions of the drawing frame.
[0076] Step 5034: Determine whether the drawing information to be split is incorrect. If so, go to Step 5035; otherwise, go to Step 5036.
[0077] Step 5035: Modify the drawing name and then re-enter Step 5034.
[0078] Step 5036: Calculate the boundary coordinates of the drawing to be split according to the drawing information.
[0079] Step 5037: Create a corresponding DWG format file according to the drawing name.
[0080] Step 5038: Copy and paste the drawing to be split into the corresponding DWG format file according to the boundary coordinates of the drawing to be split, and save the DWG format file to the storage directory for the split drawings.
[0081] Step 5039: Determine whether all the drawing splitting work is completed. If so, exit the drawing splitting work; otherwise, repeat Steps 5036 to 5038.
[0082] Further, the specific steps of Step 7 are as follows:
[0083] Step 701: Select the source directory of the file to be converted, and write the path information of the source directory to be converted into the CAD-PDF conversion auxiliary form. The source directory to be converted is the storage directory of the general drawing file or the storage directory of the single drawing file;
[0084] Step 702: Convert the DWG format drawing into PDF format according to the source directory to be converted, specifically including:
[0085] Step 7021: Obtain the internal information of the standard drawing frame in the user-defined template recognition list form and write it into an array;
[0086] Step 7022: Obtain the CAD-PDF conversion auxiliary form and write the path information of the source directory to be converted into an array;
[0087] Step 7023: Obtain the standard drawing frame information and name information corresponding to all the drawings in the general drawing file. The standard drawing frame information includes: the boundary size of the standard drawing frame and the world coordinates of the lower left corner of the standard drawing frame;
[0088] Step 7024: Determine whether the drawing information to be converted is incorrect. If so, go to Step 7035; otherwise, go to Step 7036;
[0089] Step 7025: Modify the name of the drawing to be converted and then re-enter Step 7024;
[0090] Step 7026: Select the area of the drawing to be converted according to the world coordinates of the lower left corner of the standard drawing frame, and save the selected content as a PDF format document. The name of the PDF format document is the corresponding drawing name, and the storage location is the source directory of the file to be converted;
[0091] Step 7027: Determine whether all the drawings have been converted. If so, exit the drawing conversion work; otherwise, repeat Steps 7026 to 7027.
[0092] On the other hand, a CAD file auxiliary processing system for the air-conditioning industry is provided, including:
[0093] A CAD template file copying module, which is used to automatically move, scale and copy the original drawing files corresponding to multiple parts, calculate the world coordinate points of each original drawing in the general drawing file according to the preset arrangement method, and paste each original drawing to the corresponding position in the general drawing file according to the world coordinate points; and match and add corresponding standard drawing frames to each original drawing, and write the original file name of the corresponding original drawing in the detail column of each standard drawing frame;
[0094] The CAD initial list generation and text filling module is used to obtain the parts assembly information list of the original drawing according to the storage information and storage relationship of the original drawing file of the diagram, and write the content of the parts assembly information list into the bill of materials of the corresponding standard drawing frame.
[0095] The CAD parts price estimation and text replacement module is used to determine the types and prices of the parts corresponding to each original drawing of the diagram, determine the formal part names corresponding to each part according to the types and prices of the parts, and replace the original file names in the bill of materials of each standard drawing frame with the formal part names.
[0096] The CAD bill of materials extraction module is used to extract information from the bill of materials of each standard drawing frame according to the extraction identification information to obtain the bill of materials corresponding to all parts.
[0097] The CAD drawing splitting module is used to split each drawing in the general drawing file into single drawing files, modify the file names of each drawing according to the corresponding formal part names and save them to the specified directory, and the drawings include the original drawing of the diagram and its corresponding standard drawing frame.
[0098] The CAD file content inspection module is used to inspect the general drawing file and single drawing files, and the inspection content includes at least: whether the formal part names are repeated or missing, whether there is any missing content in the bill of materials of each standard drawing frame, whether there is any overlap in each standard drawing frame, whether there are any original file names that have not been replaced, whether the file names of the drawings are consistent with the corresponding formal part names, and whether the drawing scale marked on the drawing is consistent with the drawing scale.
[0099] The CAD-PDF conversion module is used to convert each single drawing file into PDF format.
[0100] The beneficial effects of the present invention are: The CAD file auxiliary processing method and system for the air-conditioning industry according to the present invention work in coordination with each other by using CADVBA, EXCELVBA programs and EXCEL tables to perform automatic batch copying, pasting, sorting, searching, filtering, matching, scaling, marking, renaming, list extraction, drawing splitting, PDF conversion and drawing content error checking of CAD files, greatly reducing the workload of two-dimensional part drawings, reducing the probability of errors, simplifying the operation method and improving the operation efficiency. Brief Description of the Drawings
[0101] Figure 1 It is a schematic structural diagram of the CAD file auxiliary processing system for the air-conditioning industry according to the embodiment of the present invention;
[0102] Figure 2 It is a schematic flow diagram of the CAD file auxiliary processing method for the air-conditioning industry according to the embodiment of the present invention;
[0103] Figure 3 Schematic flowchart of the implementation method of the CAD template file copying module according to an embodiment of the present invention;
[0104] Figure 4 Schematic flowchart of the file copying operation according to an embodiment of the present invention;
[0105] Figure 5 Schematic diagram of the original drawing recognition rule of the mind map according to an embodiment of the present invention;
[0106] Figure 6 Schematic flowchart of the implementation method of the CAD initial list generation and text filling module according to an embodiment of the present invention;
[0107] Figure 7 Schematic flowchart of the text filling operation according to an embodiment of the present invention;
[0108] Figure 8 Schematic flowchart of the implementation method of the CAD component price estimation and text replacement module according to an embodiment of the present invention;
[0109] Figure 9 Schematic flowchart of the implementation method of the CAD material list extraction module according to an embodiment of the present invention;
[0110] Figure 10 Schematic flowchart of the list extraction operation according to an embodiment of the present invention;
[0111] Figure 11 Schematic flowchart of the implementation method of the CAD drawing splitting module according to an embodiment of the present invention;
[0112] Figure 12 Schematic flowchart of the drawing splitting operation according to an embodiment of the present invention;
[0113] Figure 13 Schematic flowchart of the implementation method of the CAD-PDF conversion module according to an embodiment of the present invention;
[0114] Figure 14 Schematic flowchart of the PDF conversion operation according to an embodiment of the present invention;
[0115] Figure 15 Schematic flowchart of the implementation method of the CAD file content checking module according to an embodiment of the present invention;
[0116] Figure 16 Schematic flowchart of the file checking operation according to an embodiment of the present invention;
[0117] Figure 17 Schematic diagram of the CAD drawing composition according to an embodiment of the present invention;
[0118] Figure 18 Schematic diagram of the frame information recognition principle according to the embodiment of the present invention;
[0119] Figure 19 Schematic diagram of the human-computer interaction interface according to the embodiment of the present invention. Detailed implementation manners
[0120] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0121] The CAD file auxiliary processing system for the air-conditioning industry provided by the present invention, as Figure 1 shown, includes: a CAD template file copying module, a CAD initial list generating and text filling module, a CAD component price estimating and text replacing module, a CAD material list extracting module, a CAD drawing splitting module, a CAD file content checking module, and a CAD-PDF conversion module. Based on the above system, the CAD file auxiliary processing method for the air-conditioning industry provided by the present invention, as Figure 2 shown, includes the following steps:
[0122] Step 1: After the CAD template file copying module automatically moves, scales, and copies the original drawing files corresponding to multiple components, calculates the world coordinate points of each original drawing in the general drawing file according to the preset arrangement method, and pastes each original drawing to the corresponding position in the general drawing file according to the world coordinate points; and matches and adds corresponding standard drawing frames to each original drawing, and writes the original file names of the corresponding original drawings in the bill of materials of each standard drawing frame;
[0123] Specifically, this step is mainly used to match the original 2D component drawings in the user-specified windows system file directory with the corresponding drawing frames, automatically scale them, and then paste them into the CAD general drawing file in the user-specified storage directory, and arrange them according to the preset arrangement method by the user. When selecting the scaling type, the user can choose to keep the drawing frame unchanged and scale the original drawing, or choose to keep the original drawing unchanged and scale the drawing frame; the preset arrangement method can be selected to arrange according to the installation relationship, or to arrange in rows and columns. When arranging according to the installation relationship, the module will arrange the upper-level components to the leftmost, and then arrange the lower-level components of the component in turn (the number of columns is uncertain). When choosing to arrange in rows and columns, the module will arrange the component drawings according to the specified number of columns; the user can also choose the row height and column width to control the row spacing and column spacing of the arrangement of each drawing; to avoid problems such as slow processing or even freezing of the windows system due to too many component drawings in a single general drawing, the user is allowed to choose the capacity of a single general drawing, and the drawing capacity is the upper limit of the number of drawings stored in the general drawing, and this value is greater than or equal to 1. As Figure 3 shown, the detailed steps of its implementation method are as follows:
[0124] Step 101: Obtain the directory of the original folder of the mind map to be copied. The EXCEL VBA program traverses and extracts the names, absolute file paths, and file modification times of all DXF files in the obtained original folder of the mind map and its sub-folders, and writes the extracted content into the CAD template copy auxiliary table. The reason for choosing the DXF file format here is that DXF format files are also CAD files, which is convenient for differentiating from the processed DWG format files in the later stage;
[0125] Step 102: Obtain the directory for file copying and storage. The EXCEL VBA program stores the absolute path information corresponding to the file copying and storage directory in the specified area of the CAD template copy auxiliary table;
[0126] Step 103: The EXCEL VBA program performs boundary recognition of the original mind map, scaling of the original mind map, copying, pasting, standard drawing frame screening and matching, and filling of the original file name according to the CAD template copy auxiliary table, and loops until all original mind map files are copied. As Figure 4 shown, its implementation method includes the following steps:
[0127] Step 1031: Obtain the user-defined template recognition list table, which contains the internal file information of the standard drawing frames corresponding to each original mind map. The internal file information of the standard drawing frames includes at least: the name of the standard drawing frame, the drawing frame size, the bill of materials size, the recognition identifier, the pasting area size of the original mind map, the X-axis and Y-axis offsets of the standard drawing frame, and the alignment methods of the X-axis and Y-axis of the standard drawing frame;
[0128] Specifically, the CAD VBA program opens the template recognition list table and writes the user-defined drawing frame template name, recognition identifier and other information in the table into an array for temporary storage. The content of the template recognition list includes the drawing frame template name, recognition identifier, length of the mind map pasting area, unit mm, width of the mind map pasting area, unit mm, offset of the mind map drawing frame in the X-axis direction, unit mm, offset of the mind map drawing frame in the Y-axis direction, alignment method in the X-axis direction (proportion of the distance from the left side, input value: 0-1), alignment method in the Y-axis direction (proportion of the distance from the left side, input value: 0-1), length of the standard drawing frame, width of the standard drawing frame, boundary dimensions of each part of the drawing frame bill of materials, etc. All the content in the template recognition list table can be defined by the user himself;
[0129] Step 1032: The CADVAB program loops through to obtain the original mind map file information, which includes at least: the original file name of the original mind map, the outer boundary size of the image (including the boundary length and boundary width), and the world coordinate point at the lower left corner of the boundary;
[0130] Step 1033: Obtain the external information of the user-defined standard drawing frame file through the CADVAB program. The external information of the standard drawing frame file includes at least the file name string of the standard drawing frame and the storage absolute path.
[0131] Step 1034: Check the identification information. After the check is completed, if no error prompt is issued, go to Step 1035; otherwise, exit the file copying operation. The specific content of checking the identification information includes: whether the original file name of the original drawing of the mind map can match the identification and whether the standard drawing frame corresponding to the identification is missing.
[0132] Specifically, when the original file name of the original drawing of the mind map does not match the identification, prompt the user with an error message indicating that the naming of the original drawing of the mind map cannot be recognized. When the original file name of the original drawing of the mind map can be paired with the identification but the user-defined standard drawing frame corresponding to the identification is missing, prompt the user with the information that the user-defined standard drawing frame is missing. Write all the original file names of the original drawings of the mind map, the error messages that cannot be recognized, and the information that the user-defined standard drawing frame is missing into an EXCEL table, output it, and then exit the file copying operation. If no error message is prompted when the traversal check is completed, then proceed to the next operation.
[0133] Among them, the identification is used for the CADVBA program to compare the name string of the original drawing of the mind map with the identification when traversing to the specified original drawing of the mind map. When the name string of the original drawing of the mind map contains the specified identification, the CADVBA program will obtain the standard drawing frame information corresponding to the identification. For example Figure 5As shown in the figure, for example, there are two original drawing files of mind maps. One drawing file is named "ABCdef.dxf", and the other is named "DEFghi.dxf". The user defines three recognition identifiers in the specified area of the template recognition list table, namely "abc" corresponding to the drawing frame file name "A.dwg", "efg" corresponding to the drawing frame file name "E.dwg", and "ce" corresponding to the drawing frame file name "C.dwg". The user defines three standard drawing frame files A.dwg, E.dwg, and C.dwg in the "CAD template source directory" folder. During recognition, the CADVBA program will pair the original mind map drawing "ABCdef.dxf" with the recognition identifier "abc", the corresponding drawing frame file name "A.dwg", and the A.dwg in the "template source directory" folder, and pair the original mind map drawing "DEFghi.dxf" with the recognition identifier "efg", the corresponding drawing frame file name "E.dwg", and the E.dwg in the "template source directory" folder. Therefore, when defining custom recognition identifiers, it is required that the recognition identifiers defined by the user cannot be repeated. When there is an inclusion relationship, the long recognition identifier should be arranged before the short recognition identifier. For example, if recognition identifier 1 is "ABCDE" and recognition identifier 2 is "ABC", then recognition identifier 1 should be arranged before recognition identifier 2 in the template recognition list. When performing 3D modeling, it is required that when the user names the components, the component name should contain the custom recognition identifier information, and the original file name of the mind map will automatically carry the recognition identifier information.
[0134] Step 1035: Obtain the internal information of the standard drawing frame file corresponding to the original mind map drawing, specifically including: The CADVBA program matches the recognition identifier according to the original file name string of the original mind map drawing, and determines the internal information of the standard drawing frame file corresponding to this recognition identifier (including the corresponding standard drawing frame name, the length of the mind map pasting area, unit: mm, the width of the mind map pasting area, unit: mm, the X-axis direction offset of the mind map drawing frame, unit: mm, the Y-axis direction offset of the mind map drawing frame, the alignment method in the X-axis direction (the proportion of the distance from the left side, input value: 0 - 1), the alignment method in the Y-axis direction (the proportion of the distance from the left side, input value: 0 - 1), the length of the standard drawing frame, the width of the standard drawing frame), etc.
[0135] Step 1036: Determine the actual scaling ratio required for the original mind map drawing according to the outer boundary size and pasting position of the original mind map drawing.
[0136] Step 1037: Scale the original mind map drawing according to the actual scaling ratio required for the original mind map drawing, calculate the translation distance according to the world coordinate point at the lower left corner of the original mind map drawing boundary, and move the original mind map drawing to the world coordinate point (0, 0).
[0137] Step 1038: Copy the original mind map drawing with its world coordinate point (0, 0) as the base point.
[0138] Step 1039: Calculate the world coordinate points of the original diagram in the overall drawing file according to the preset arrangement method. The default world coordinate points for pasting the first original diagram into the overall drawing file are (0, 0).
[0139] Step 10310: Paste the original diagram into the corresponding position in the overall drawing file according to the world coordinate points of the original diagram in the overall drawing file.
[0140] Step 10311: Calculate the world coordinate points of the standard drawing frame corresponding to the original diagram in the overall drawing file according to the offsets of the X-axis and Y-axis of the standard drawing frame and the alignment methods of the X-axis and Y-axis of the standard drawing frame.
[0141] When the user selects to arrange in rows and columns, when calculating the world coordinates (x, y) of the pasting point, the following rules are satisfied: when n <= n1 and n < n2, x = x0 + a * n, y = y0; when n <= n1 and n = n2, x = x0, y = y0 + b * m; when n <= n1 and n > n2, x = x0 + a * (n - n1 * m), y = y0 + b * m; when n > n1 and n = n1 * f + 1, x = x0, y = y0. Where (x, y) are the world coordinates of the current pasting point when the user selects to arrange in rows and columns, n is the current cumulative number of original diagrams, n1 is the number of drawing sheets in a single overall drawing file, n2 is the number of columns selected by the user, x0 = 0, y0 = 0, a is the column width selected by the user, b is the row height selected by the user, m is the integer obtained by dividing the current cumulative number of original diagrams n by the number of columns n2, and f is the integer obtained by dividing the current cumulative number of original diagrams n by the number of drawing sheets n1 in a single overall drawing file.
[0142] When the user selects to arrange according to the assembly relationship, when calculating the world coordinates (x, y) of the pasting point, the following rules are satisfied: when n <= n1 and n <= h, x = x1 + a, y = y1; when n <= n1 and n = h + 1, x = x1 - h * a, y = y1 + b; when n <= n1 and n > h + 1, x = x1 + a, y = y1; when n > n1 and n = n1 * f + 1, x = x0, y = y0. Where (x, y) are the world coordinates of the current pasting point when the user selects to arrange in rows and columns, n is the current cumulative number of original diagrams, n1 is the number of drawing sheets in a single overall drawing file, h is the number of lower-level drawing sheets corresponding to the assembly relationship of the current component drawing. x1 and y1 are the world coordinates of the previous drawing sheet, for the first drawing sheet, x1 = 0, y1 = 0, a is the column width selected by the user, b is the row height selected by the user, and f is the integer obtained by dividing the current cumulative number of original diagrams n by the number of drawing sheets n1 in a single overall drawing file.
[0143] Step 10312: Search for and copy the corresponding standard drawing frame in the external information of the user-defined standard drawing frame file according to the name of the standard drawing frame obtained in Step 1035.
[0144] Step 10313: Paste the standard drawing frame to the corresponding position in the general drawing file according to the world coordinate points of the standard drawing frame calculated in the general drawing file;
[0145] Step 10314: Write the original file name of the original drawing of the diagram into the bill of materials of the corresponding standard drawing frame;
[0146] Step 10315: Determine whether the copying of all original drawings of the diagram is completed. If so, proceed to Step 10316; otherwise, repeat Steps 1035 to 10314;
[0147] Step 10316: Exit the file copying operation.
[0148] Step 2: The CAD initial list generation and text filling module obtains the parts assembly information list of the original drawing of the diagram according to the storage information and storage relationship of the original drawing file of the diagram, and writes the content of the parts assembly information list into the bill of materials of the corresponding standard drawing frame;
[0149] This step is used to traverse and extract the string of the file name of each original drawing of the diagram according to its storage relationship through the EXCEL VBA program for the two-dimensional parts original drawing of the diagram selected by the user in the windows system file directory, and generate an EXCEL table of the parts assembly information list. The user can choose whether to modify the content of the EXCEL table. After the parts assembly information list is modified, the CAD VBA program will open all the drawings in the list directory specified by the user, automatically match the corresponding drawings according to the list content, and fill in the original naming, quantity, etc. of the parts in the specified area of the bill of materials of the drawing. Before text filling, the user can set the font size of text filling in different areas to adapt to the size of the bill of materials table. As Figure 6 shown, the detailed steps of its implementation method are as follows:
[0150] Step 201: Obtain the text filling source directory, and obtain the storage information and storage relationship of the original drawing file of the diagram;
[0151] Among them, the text filling source directory refers to the source of the list information that the user needs to fill in the parts list. The parts assembly information list is mainly built based on the storage relationship of the original drawing of the diagram in the Windows system. The principle and rules are as follows: The original drawing of the part drawing needs to be stored in a folder with the same name as the original drawing of the diagram without the suffix. The original drawing of the lower-level parts is stored in this folder. The original drawing of the lower-level part needs to be stored in a folder with the same name as the original drawing of the diagram without the suffix, and so on. For example, there are eight original drawing files of the diagram, which are A.dxf, B.dxf, C.dxf, D.dxf, E.dxf, F.dxf, G.dxf, and H.dxf. Among them, A.dxf, B.dxf, C.dxf, and D.dxf are part drawings, and E.dxf, F.dxf, G.dxf, and H.dxf are part drawings. The lower-level part of A.dxf is C.dxf, and the lower-level part is E.dxf. The lower-level part of B.dxf is D.dxf, and the lower-level part is F.dxf. The lower-level part of part C.dxf is G.dxf, and the lower-level part of part D.dxf is H.dxf. When the user performs the 3D part diagram operation, folders named A, B, C, and D need to be created. Among them, the original drawing A.dxf, E.dxf, and folder C are stored in the directory of folder A. The original drawing B.dxf, F.dxf, and folder D are stored in the directory of folder B. C.dxf and G.dxf are stored in the directory of folder C. D.dxf and H.dxf are stored in the directory of folder D. Because the Windows system does not allow the user to store files of the same type with the same name in the same folder, it can indirectly prevent the user from performing duplicate drawing storage operations. When selecting the text filling source directory in step S201, the EXECLVBA program will automatically obtain the storage relationship of the original drawing of the diagram in the directory specified by the user;
[0152] Step 202: Determine whether the storage relationship of the original drawing file of the diagram is incorrect. If so, end the operation; otherwise, go to step 203;
[0153] Specifically, the EXCELVBA program will judge the correctness of the storage relationship during the process of generating the parts assembly information list. When the part drawing with the same name as the folder is missing in the part folder, there are folders or part drawings with the same name, or different original drawings of the diagram are stored under the same folder name, the EXCELVBA program will prompt that the storage relationship of the original drawing of the diagram is incorrect and output the error information in the form of an EXCEL table to end the operation. If there is no problem, the next operation will be carried out;
[0154] Step 203: Create multiple parts assembly information lists based on the original diagram. The user can choose whether to modify the information in the table, such as the quantity of parts assembly. If not modified, the default is 1. Whether to add some general material information, etc. After modification, close and save the parts assembly information list.
[0155] Step 204: Traverse and match the corresponding drawings in the general drawing file in the auxiliary table and the file directory to be filled according to the parts assembly information list and the CAD template, and perform the operation of filling the details column content of the standard drawing frame of the corresponding drawings. As Figure 7 shown, its implementation method includes the following steps:
[0156] Step 2041: Obtain the content of the template recognition list table defined by the user, including information such as the boundary dimensions of the standard drawing frame and the boundary dimensions of each details column, and write them into an array;
[0157] Step 2042: Obtain the content of the multiple parts assembly information lists created in Step 203, and write them into a dynamic array;
[0158] Step 2043: Obtain the drawing frame information and name information of all the drawings in the general drawing file. The drawing frame information includes at least: the world coordinate information and boundary dimensions of the lower left corner of the drawing frame;
[0159] Step 2044: Match the content of the parts assembly information list with the name information of the drawing to determine the parts assembly information to be filled in the details column of the current standard drawing frame;
[0160] Step 2045: Calculate the world coordinate points where the parts assembly information is written into the general drawing file according to the details column dimensions and the boundary dimensions of the drawing frame;
[0161] Step 2046: Write the parts assembly information according to the world coordinate points where the parts assembly information is written into the general drawing file and the font size selected by the user;
[0162] Step 2047: Determine whether all the parts assembly information has been written. If so, exit the text writing work. Otherwise, repeat Steps 2044 to 2046.
[0163] Step 3: The CAD parts price estimation and text replacement module determines the types and prices of the parts corresponding to each original diagram. Determine the formal part names corresponding to each part according to the types and prices of the parts, and replace the original file names in the details columns of each standard drawing frame with the formal part names;
[0164] This step is mainly divided into two parts. One is the estimation of component prices, and the other is the replacement of the original names of component drawings. The estimation of component prices is carried out by obtaining a list composed of the string of the original drawing file in the specified directory and estimating the prices according to the price calculation rules defined by the user. Usually, the price calculation rules include component dimensions, unit price of component materials, component density, component processing fees, etc. These rules can be defined by the user themselves. After calculating the estimated prices of the components, formal name applications are made according to the component prices and types. The reason for the need to replace the original names of component drawings is that first, during the 3D modeling stage, in order to facilitate the distinction of different components and name the drawings with the fastest efficiency, designers often name the components in a simple way. Second, when applying for formal components, their names usually consist of letters and numbers or pure numbers, and these names are relatively long, and it is impossible to simply tell the component type from their names. Finally, the dimensions of the components are unknown and the prices cannot be calculated before naming during the modeling stage, while the estimated prices of the components need to be calculated in advance when applying for formal component names. Therefore, it is impossible to name them with the formal application names during modeling. So, during the drawing processing, the original names need to be replaced with the formal names. As Figure 8 shown, it includes the following steps:
[0165] Step 301: Obtain the directory of the original drawing folder of the drawing to be copied, obtain the file name string of the original drawing of the drawing according to the directory of the original drawing folder of the drawing, and write it into the CAD text replacement auxiliary table;
[0166] Step 302: Input price calculation parameters in the component price list table, and calculate the prices of the components corresponding to each original drawing of the drawing according to the price calculation parameters and the pre-defined calculation formula. The price calculation parameters at least include: the dimensions of the corresponding components, the unit price of materials, and the processing fees;
[0167] Step 303: Determine the formal component names corresponding to each component according to the type and price of the component;
[0168] Step 304: Paste the corresponding formal component names in the replacement area of the CAD text replacement auxiliary table;
[0169] Step 305: Check the name information of the file name string of the original drawing of the drawing and the formal component names. If there is no error, go to Step 307; otherwise, go to Step 306;
[0170] Among them, the inspection items include whether there are duplicates or omissions in the original names, whether there are duplicates or omissions in the formal names, whether the corresponding categories of the original names to be replaced and the formal names to be replaced are the same, and whether the estimated prices corresponding to the original names to be replaced and the prices corresponding to the formal names to be replaced are the same. Through the above information inspection, it can effectively avoid users' incorrect input. If the table replacement information is incorrect, the user will be prompted to modify the CAD text replacement auxiliary table and the modified information will be output. If the table replacement information is correct, the next step will be carried out.
[0171] Step 306: After modifying the name information, enter Step 305;
[0172] Step 307: Obtain the general drawing file directory, and write all the part names and storage path information under the general drawing file directory into the CAD text replacement auxiliary table;
[0173] Step 308: Replace the original file names of all parts with the corresponding formal part names according to the content of the CAD text replacement auxiliary table;
[0174] Step 309: Determine whether all part name replacements have been completed. If so, exit the part name replacement work; otherwise, repeat Step 308.
[0175] Step 4: The CAD material list extraction module extracts information from the bill of materials of each standard drawing frame according to the extraction identification information to obtain the material lists corresponding to all parts;
[0176] This step is used to identify all the drawing frames of the part drawings in the user-selected windows system file directory through the CADVBA program, and extract and integrate the bill of materials information into an EXCEL table to form a part material list. As Figure 9 shown, the detailed steps of its implementation method are as follows:
[0177] Step 401: Add extraction identification information to the bill of materials of the standard drawing frame; among them, the extraction identification information can be customized by the user, and it is required not to be the same as the formal naming of the parts, and the default is "#". The reason for adding "#" is that the content in the bill of materials of different parts is different, and the extraction identification information is added to mark the boundaries of the bill of materials of different drawings.
[0178] Step 402: Select the list extraction source directory, and write the storage information of the general drawing files in the list extraction source directory into the CAD list extraction auxiliary table. The list extraction source directory is the storage directory of the general drawing files after adding the extraction identification information;
[0179] Step 403: Extract the material lists corresponding to all parts according to the list extraction source directory. As Figure 10 shown, it mainly includes the following steps:
[0180] Step 4031: Obtain the template recognition list table customized by the user, and write the internal information of the file corresponding to the standard drawing frame into an array.
[0181] Step 4032: Obtain the content of the CAD list extraction auxiliary table.
[0182] Step 4033: Obtain the standard drawing frame information and name information of all the drawings in the general drawing file. The standard drawing frame information includes at least: the world coordinates of the lower left corner of the standard drawing frame and the boundary dimensions.
[0183] Step 4034: Obtain the extraction identification information corresponding to all the standard drawing frames in the general drawing file, and determine whether the extraction identification information is incorrect. If so, go to Step 4035; otherwise, go to Step 4036.
[0184] Among them, the judgment of the extraction identification information mainly includes judging whether the extraction identification information is missing, repeated, etc. If the extraction identifier information is incorrect, the user will be prompted to modify the extraction identification information. If it is correct, the next step will be performed.
[0185] Step 4035: After modifying the extraction identification information, re-enter Step 4034.
[0186] Step 4036: According to the extraction identification information, perform a loop traversal extraction of the information in the bill of materials of each standard drawing frame to obtain the bill of materials corresponding to all the parts.
[0187] Step 4037: Determine whether all the information extraction work of the bill of materials has been completed. If so, exit the information extraction work; otherwise, repeat Step 4036.
[0188] Step 5: The CAD drawing splitting module splits each drawing in the general drawing file into single drawing files, modifies the file names of each drawing according to the corresponding official part names, and saves them to the specified directory. The drawings include the original drawing and its corresponding standard drawing frame.
[0189] This step is used to split multiple part drawings stored in the general drawing in the user-specified Windows system file directory into single drawing forms corresponding to their drawing names. As Figure 11 shown, the detailed steps of its implementation method are as follows:
[0190] Step 501: Select the drawing splitting source directory, obtain the name and storage path information of the general drawing file to be split according to the drawing splitting source directory, and write them into the CAD drawing splitting auxiliary table.
[0191] Step 502: Select the directory where the split drawings are stored, and write the path information in the directory where the split drawings are stored into the CAD drawing splitting auxiliary table.
[0192] Step 503: Perform drawing splitting operations by splitting the auxiliary table according to the CAD drawing, as Figure 12 shown, specifically including:
[0193] Step 5031: Obtain the internal file information of the standard drawing frame in the template recognition list table customized by the user, and write it into an array;
[0194] Step 5032: Obtain the name and storage path information of the general drawing file to be split in the CAD drawing splitting auxiliary table, and write it into an array;
[0195] Step 5033: Obtain all the drawing information to be split according to the name of the general drawing file to be split. The drawing information includes at least: drawing name, world coordinates of the lower left corner of the drawing frame, and boundary dimensions of the drawing frame;
[0196] Step 5034: Determine whether the drawing information to be split is incorrect. If so, go to Step 5035; otherwise, go to Step 5036;
[0197] Specifically, the CADVBA program checks whether the drawing information to be split is incorrect. The checking content includes whether the drawing name is repeated or missing. Since the single drawings after splitting need to be stored named after their corresponding drawings, the occurrence of repeated or missing drawing names will cause errors during storage. The occurrence of repeated or missing drawing names will prompt the user to modify the drawing names to be split. If there is no error message prompt, proceed to the next step;
[0198] Step 5035: After modifying the drawing name, re-enter Step 5034;
[0199] Step 5036: Calculate the boundary coordinates of the drawing to be split according to the drawing information;
[0200] Step 5037: Create a corresponding DWG format file according to the drawing name;
[0201] Step 5038: Copy and paste the drawing to be split into the corresponding DWG format file according to the boundary coordinates of the drawing to be split, and save the DWG format file to the split drawing storage directory;
[0202] Step 5039: Determine whether all drawing splitting work has been completed. If so, exit the drawing splitting work; otherwise, repeat Steps 5036 to 5038.
[0203] Step 6. The CAD file content inspection module inspects the general drawing file and single drawing files. The inspection content shall at least include: whether there are duplicate or missing official part names, whether there is missing content in the bill of materials of each standard drawing frame, whether there is overlap among the standard drawing frames, whether there are un-replaced original file names, whether the file name of the drawing is consistent with the corresponding official part name, and whether the drawing scale marked on the drawing is consistent with the drawing scale;
[0204] This step is used to inspect the drawing content information in the file directory of the specified Windows system by the user. The inspection content includes whether there are duplicate or missing drawing names, whether there is missing content in the drawing bill of materials, whether there are duplicate or missing list extraction identifiers, whether there is overlap in the drawing frame area of the drawing, whether there is un-replaced original name identification information in the drawing. For single drawing content, it also conducts inspections on the consistency between the single drawing file name and its corresponding drawing name, and the consistency between the actual marked scale of the drawing and the drawing scale, etc. As Figure 13 shown, the detailed steps of its implementation method are as follows:
[0205] Step S601. Select the file inspection source directory. The file inspection source directory refers to the directory where the files to be inspected by the user are stored. It can be the storage directory of any DWG format drawing processed in Steps S2 to S6. After selection, the EXCEL VBA program writes the file name and path information in the file inspection source directory into the specified area of the CAD file inspection auxiliary table;
[0206] Step S602 performs file inspection operations. According to the file inspection source directory selected in Step S601, file content inspection operations are carried out. As Figure 14 shown, the detailed steps of its implementation method are as follows:
[0207] Step S6021. Obtain the corresponding standard drawing frame content in the user-defined template recognition list table through the CADVBA program, including information such as the boundary dimensions of the standard drawing frame and the boundary dimensions of each bill of materials, and write the information into an array;
[0208] Step S6022. Obtain the content of the template recognition list table. Through CADVBA, obtain all the file storage information in Step S601 and write the information into an array;
[0209] Step S6023. Traverse through the CADVBA program to obtain all the drawing names, the world coordinate information of the lower left corner of all the drawing frames, the boundary dimension information of all the drawing frames, the bill of materials content information, the drawing scale information marked on the drawing, and the extraction identifier content information, etc. in the files in Step S6022;
[0210] Step S6024: Based on the information obtained in step S6023, the CADVBA program conducts information comparison and outputs the comparison information to an EXCEL spreadsheet, ending the inspection operation.
[0211] Step 7: The CAD-PDF conversion module converts each single drawing file into the PDF format. As Figure 15 shown, it includes the following steps:
[0212] Step 701: Select the source directory of the file to be converted, and write the path information of the source directory to be converted into the CAD-PDF conversion auxiliary spreadsheet. The source directory to be converted is the storage directory of the general drawing file or the single drawing file;
[0213] Step 702: Convert the DWG format drawing into the PDF format according to the source directory to be converted. As Figure 16 shown, it specifically includes:
[0214] Step 7021: Obtain the internal file information of the standard drawing frame in the user-defined template recognition list spreadsheet and write it into an array;
[0215] Step 7022: Obtain the CAD-PDF conversion auxiliary spreadsheet and write the path information of the source directory to be converted in it into an array;
[0216] Step 7023: Obtain the standard drawing frame information and name information corresponding to all the drawings in the general drawing file. The standard drawing frame information includes: the boundary dimensions of the standard drawing frame and the world coordinates of the lower left corner of the standard drawing frame;
[0217] Step 7024: Determine whether the drawing information to be converted is incorrect. If so, go to step 7035; otherwise, go to step 7036;
[0218] Among them, the verification content includes whether the drawing names are repeated or missing. Because during the PDF format conversion process, the single drawings after PDF conversion need to be stored with their corresponding drawing names. When there are repeated or missing drawing names, it will cause an error during storage. When there are repeated or missing drawing names, the user will be prompted to modify the drawing names to be converted. If there is no error message prompt, proceed to the next step.
[0219] Step 7025: After modifying the drawing name to be converted, re-enter step 7024;
[0220] Step 7026: Select the area of the drawing to be converted according to the world coordinates of the lower left corner of the standard drawing frame and save the selected content as a PDF format document. The name of the PDF format document is the corresponding drawing name, and the storage location is the source directory of the file to be converted;
[0221] Step 7027: Determine whether all drawing conversions are completed. If so, exit the drawing conversion work; otherwise, repeat steps 7026 to 7027.
[0222] The component drawings frequently used in the air-conditioning industry mainly consist of two parts. As Figure 17 shown, they include the component 2D drawings and the drawing frames. The 2D drawings are stored within the boundaries of the drawing frames. The bill of materials in the drawing frames is used for filling in the drawing name, drawing quantity, assembly relationship, etc. The outer boundary of the standard drawing frame is a rectangular primitive. The perimeter and area of the rectangular primitive can be obtained through the EXCEL VBA program. The user fills in parameters such as the standard drawing frame name, the length of the drawing paste area (in mm), the width of the drawing paste area (in mm), the X-axis direction offset of the drawing frame (in mm), the Y-axis direction offset of the drawing frame, the alignment method in the X-axis direction (the proportion of the distance from the left side, input value: 0 - 1), the alignment method in the Y-axis direction (the proportion of the distance from the left side, input value: 0 - 1), the length of the standard drawing frame (the length of the rectangular primitive), the width of the standard drawing frame (the width of the rectangular primitive), and the offset distances of each boundary of the bill of materials relative to the lower left corner of the standard drawing frame in the X and Y axis directions in the specified area of the template recognition list table, and then the definition work of different types of standard drawing frames can be completed.
[0223] In this embodiment, the principle and steps for identifying the drawing frame and extracting the text information within the drawing frame are as Figure 18 shown. The detailed method steps are as follows:
[0224] Step S801: Obtain the content of the template recognition list table. Through the CADVBA program, obtain the information required for drawing frame recognition in the "template recognition list.xls" table, including parameters such as the length of the standard drawing frame (the length of the rectangular primitive), the width of the standard drawing frame (the width of the rectangular primitive), and the offset distances of each boundary of the bill of materials relative to the lower left corner of the standard drawing frame in the X and Y axis directions.
[0225] Step S802: Obtain the rectangular primitive information of the drawing. Through the CADVBA program, obtain the drawing primitive information, including the perimeter of the rectangular primitive, the area of the rectangular primitive, and the world coordinate points of the rectangular primitive.
[0226] Step S803, determine whether the rectangular primitive is a drawing frame. The CADVBA program compares and analyzes the user-defined drawing frame information in step S801 and all the rectangular primitive information obtained in step S802, and the rectangular primitives that meet the drawing frame recognition rules can be regarded as drawing frames. The drawing frame recognition rules are as follows: when m / c=(a*b) / (2*(a+b)), the rectangular primitive is a drawing frame, where m is the area of the rectangular primitive, c is the perimeter of the rectangular primitive, a is the length of the user-defined drawing frame, and b is the width of the user-defined drawing frame. For example, the user defines two standard drawing frames in the "Template Recognition List.xls" table. Frame 1 is a1 long and b1 wide, and Frame 2 is a2 long and b2 wide. There are two rectangular primitives in the CAD drawing file. Rectangular primitive 1 has an area of m1=a1*b1 and a perimeter of 2*(a1+b1). Rectangular primitive 2 has an area of m2=a2*b3 and a perimeter of 2*(a2+b3), where b2<>b3. In this case, rectangular primitive 1 can be determined as a drawing frame, but rectangular primitive 2 cannot be determined as a drawing frame.
[0227] Step S804, extracting text information in the frame. Through step S803, the world coordinate point of the lower left corner of the frame that meets the rules can be obtained. According to the parameters such as the offset distance of each boundary of the frame detail column relative to the lower left corner of the standard frame in the x-axis and y-axis directions obtained in step S801, the world coordinate points of each boundary of the frame detail column can be calculated. All text information obtained by the CADVBA program, when the text coordinates are within the range of the world coordinate points of each boundary of the frame detail column, the text is the text information in the corresponding area of the corresponding frame.
[0228] The advantages of using the above-mentioned CAD file auxiliary processing method and system in the air-conditioning industry are:
[0229] 1. Automatically copy and paste original maps in batches, automatically match corresponding frames in batches, automatically scale original maps in batches according to frame size, automatically fill in scaling ratios, name drawings originally, and automatically check whether copied items are duplicated;
[0230] 2. It can automatically check whether there are any problems with the storage relationship of the original image of the user's mind map, automatically generate an initial filling list based on the storage relationship, and automatically match the corresponding drawings according to the initial filling list to fill in the content of the drawing frame detail column;
[0231] 3. The price can be automatically calculated according to the user's part size and material input. When replacing the original name of the part drawing, it can automatically check whether the original name is repeated or missing, whether the official name is repeated or missing, whether the official name type is correct, and whether the estimated price is consistent with the application price, which can effectively avoid replacement errors caused by user input errors;
[0232] 4. It can automatically search the information in the drawing bill of materials in batches, and after summarization, form a parts material list. The content of the material list is exactly the same as that of the drawing bill of materials of each part, avoiding errors caused by manual preparation and filling of the list according to the drawing bill of materials by users;
[0233] 5. It can automatically split all the drawings in a file into single drawings in batches. The drawings stored in the file do not need to be arranged at equal intervals. There can be multiple types and sizes of drawing frames, all of which can be recognized and split;
[0234] 6. It can automatically convert CAD files into PDF format in batches. The drawings to be converted can be in the form of multiple drawings or single drawings;
[0235] 7. It can check the information of multiple contents of the drawing, avoiding a large number of manual checking processes. The checking efficiency is extremely high, and this function can be used for checking before using any other functions;
[0236] 8. As Figure 19 shown, each module for executing each step has a visual window for human-computer interaction, and the operation of each process is simple and clear;
[0237] 9. During the operation process, each module has error detection and correction functions, which can avoid a large number of input errors caused by manual filling. At the same time, each module is automatically processed using VBA programs, with extremely high efficiency and extremely low error rate;
[0238] 10. Users can customize according to their own needs for the part types they use, such as defining the drawing frame type, drawing frame size, recognition mark, drawing pasting area, drawing alignment method, etc. in the template recognition list table.
Claims
1. A CAD file auxiliary processing method for the air conditioning industry, characterized in that, It includes the following steps: Step 1: After automatically moving, scaling, and copying the original drawing files corresponding to multiple components, calculate the world coordinate points of each original drawing in the general drawing file according to the preset arrangement method, and paste each original drawing to the corresponding position in the general drawing file according to the world coordinate points; and match and add corresponding standard drawing frames to each original drawing, and write the original file name of the corresponding original drawing in the bill of materials of each standard drawing frame; Specifically, Step 1 includes: Step 101: Obtain the directory of the folder of the original drawing to be copied, traverse and extract the names, absolute file paths, and file modification times of all DXF files in the folder of the original drawing and its subfolders, and write the extracted content into the CAD template copy auxiliary table; Step 102: Obtain the directory for storing the copied files, and store the absolute path information corresponding to the directory for storing the copied files in the specified area of the CAD template copy auxiliary table; Step 103: Perform original drawing boundary recognition, original drawing scaling, copying, pasting, standard drawing frame screening and matching, and original file name filling according to the CAD template copy auxiliary table, and perform loop operations until all original drawing files are copied; Step 2: Obtain the component assembly information list of the original drawing according to the storage information and storage relationship of the original drawing file, and write the content of the component assembly information list into the bill of materials of the corresponding standard drawing frame; Step 3: Determine the types and prices of the components corresponding to each original drawing, determine the formal component names corresponding to each component according to the types and prices of the components, and replace the original file names in the bill of materials of each standard drawing frame with the formal component names; Step 4: Extract information from the bill of materials of each standard drawing frame according to the extraction identification information to obtain the material list corresponding to all components; Step 5: Split each drawing in the general drawing file into single drawing files, modify the file names of each drawing according to the corresponding formal component names and save them to the specified directory, where the drawings include the original drawings and their corresponding standard drawing frames; Step 6: Check the general drawing file and the single drawing files. The check content includes at least: whether the formal component names are repeated or missing, whether there is missing content in the bill of materials of each standard drawing frame, whether there is overlap of each standard drawing frame, whether there are un-replaced original file names, whether the file names of the drawings are consistent with the corresponding formal component names, and whether the drawing scale marked on the drawing is consistent with the drawing scale; Step 7: Convert each single drawing file to PDF format.
2. The CAD file auxiliary processing method for the air-conditioning industry according to claim 1, characterized in that Specifically, Step 103 includes: Step 1031: Obtain the user-defined template recognition list table, which contains the internal file information of the standard drawing frames corresponding to each original drawing. The internal file information of the standard drawing frame includes at least: the name of the standard drawing frame, the drawing frame size, the bill of materials size, the recognition identifier, the pasting area size of the original drawing, the X-axis and Y-axis offsets of the standard drawing frame, and the alignment methods of the X-axis and Y-axis of the standard drawing frame; Step 1032: Obtain the original diagram file information, where the original diagram file information includes at least: the original file name of the original diagram, the outer boundary size of the image, and the world coordinate point at the lower left corner of the boundary; Step 1033: Obtain the external information of the user-defined standard drawing frame file, where the external information of the standard drawing frame file includes at least the file name string of the standard drawing frame and the absolute storage path; Step 1034: Check the identification information. After the check is completed, if no error prompt is issued, proceed to Step 1035; otherwise, exit the file copying operation. The specific check of the identification information includes: whether the original file name of the original diagram can match the identification and whether the standard drawing frame corresponding to the identification is missing; Step 1035: Obtain the internal information of the standard drawing frame file corresponding to the original diagram, specifically including: match the identification according to the original file name string of the original diagram, and determine the internal information of the standard drawing frame file corresponding to the identification; Step 1036: Determine the actual scaling ratio required for the original diagram according to the outer boundary size of the original diagram and the pasting position; Step 1037: Scale the original diagram according to the actual scaling ratio required for the original diagram, calculate the translation distance according to the world coordinate point at the lower left corner of the original diagram boundary, and move the original diagram to the world coordinate point (0, 0); Step 1038: Copy the original diagram with its world coordinate point (0, 0) as the base point; Step 1039: Calculate the world coordinate point of the original diagram in the general drawing file according to the preset arrangement method. The default world coordinate point for pasting the first original diagram into the general drawing file is (0, 0); Step 10310: Paste the original diagram to the corresponding position in the general drawing file according to the world coordinate point of the original diagram in the general drawing file; Step 10311: Calculate the world coordinate point of the standard drawing frame corresponding to the original diagram in the general drawing file according to the offset of the X-axis and Y-axis of the standard drawing frame and the alignment method of the X-axis and Y-axis of the standard drawing frame; Step 10312: Search for and copy the corresponding standard drawing frame in the external information of the user-defined standard drawing frame file according to the name of the standard drawing frame obtained in Step 1035; Step 10313: Paste the standard drawing frame to the corresponding position in the general drawing file according to the calculated world coordinate point of the standard drawing frame in the general drawing file; Step 10314: Write the original file name of the original diagram into the bill of materials of the corresponding standard drawing frame; Step 10315: Determine whether all the original diagrams have been copied. If so, proceed to Step 10316; otherwise, repeat Steps 1035 to 10314; Step 10316: Exit the file copying operation.
3. The CAD file auxiliary processing method for the air-conditioning industry according to claim 2, characterized in that The specific content of Step 2 includes: Step 201: Obtain the source directory for text filling, and obtain the storage information and storage relationship of the original diagram file; Step 202: Determine whether the storage relationship of the original diagram file is incorrect. If so, end the operation; otherwise, proceed to Step 203; Step 203: Create multiple parts assembly information lists according to the original diagram; Step 204. Traverse and match the corresponding drawings in the general drawing file under the auxiliary table and the file directory to be filled according to the parts assembly information list and the CAD template, and perform the filling operation of the details column content of the standard drawing frame of the corresponding drawings, specifically including: Step 2041. Obtain the content of the template recognition list table defined by the user and write it into an array; Step 2042. Obtain the content of the multiple parts assembly information lists newly created in Step 203 and write it into a dynamic array; Step 2043. Obtain the drawing frame information and name information of all the drawings in the general drawing file, and the drawing frame information at least includes: the world coordinate information of the lower left corner of the drawing frame and the boundary size; Step 2044. Match according to the content of the parts assembly information list and the name information of the drawing to determine the parts assembly information to be filled in the current standard drawing frame details column; Step 2045. Calculate the world coordinate points where the parts assembly information is written into the general drawing file according to the details column size and the boundary size of the drawing frame; Step 2046. Perform the writing work of the parts assembly information according to the world coordinate points where the parts assembly information is written into the general drawing file and the font size selected by the user; Step 2047. Determine whether all the writing work of the parts assembly information is completed. If so, exit the text writing work; otherwise, repeat Steps 2044 to 2046.
4. The CAD file auxiliary processing method for the air-conditioning industry according to claim 1, characterized in that, The specific content of Step 3 includes: Step 301. Obtain the directory of the original drawing folder to be copied, obtain the file name string of the original drawing according to the directory of the original drawing folder, and write it into the CAD text replacement auxiliary table; Step 302. Input price calculation parameters in the parts price list table, and determine the prices of the corresponding parts of each original drawing according to the price calculation parameters. The price calculation parameters at least include: the corresponding part size, material unit price, and processing fee; Step 303. Determine the formal part names corresponding to each part according to the type and price of the part; Step 304. Paste the corresponding formal part name in the replacement area of the CAD text replacement auxiliary table; Step 305. Check the name information of the file name string of the original drawing and the formal part name. If it is correct, go to Step 307; otherwise, go to Step 306; Step 306. Modify the name information and then go to Step 305; Step 307. Obtain the general drawing file directory, and write all the part names and storage path information under the general drawing file directory into the CAD text replacement auxiliary table; Step 308. Replace the original file names of all parts with the corresponding formal part names according to the content of the CAD text replacement auxiliary table; Step 309. Determine whether all the part name replacement work is completed. If so, exit the part name replacement work; otherwise, repeat Step 308.
5. The CAD file auxiliary processing method for the air-conditioning industry according to claim 1, wherein The specific content of Step 4 includes: Step 401. Add extraction identification information to the details column of the standard drawing frame; Step 402: Select the source directory for list extraction, and write the storage information of the general layout drawings in the source directory for list extraction into the CAD list extraction auxiliary table. The source directory for list extraction is the storage directory of the general layout drawings after adding extraction identification information. Step 403: Extract the bill of materials corresponding to all components for list extraction according to the source directory for list extraction.
6. The CAD file auxiliary processing method for the air-conditioning industry according to claim 5, wherein The specific steps of Step 403 include: Step 4031: Obtain the template recognition list table defined by the user, and write the internal information of the file corresponding to the standard drawing frame into an array. Step 4032: Obtain the content of the CAD list extraction auxiliary table. Step 4033: Obtain the standard drawing frame information and name information of all drawings in the general layout drawing file. The standard drawing frame information includes at least the world coordinates of the lower left corner of the standard drawing frame and the boundary dimensions. Step 4034: Obtain the extraction identification information corresponding to all standard drawing frames in the general layout drawing file, and determine whether the extraction identification information is incorrect. If so, go to Step 4035; otherwise, go to Step 4036. Step 4035: After modifying the extraction identification information, re-enter Step 4034. Step 4036: Perform information loop traversal extraction on the itemized columns of each standard drawing frame according to the extraction identification information to obtain the bill of materials corresponding to all components. Step 4037: Determine whether all itemized column information extraction work has been completed. If so, exit the information extraction work; otherwise, repeat Step 4036.
7. The CAD file auxiliary processing method for the air-conditioning industry according to claim 1, wherein The specific steps of Step 5 include: Step 501: Select the source directory for drawing splitting, obtain the name and storage path information of the general layout drawing file to be split according to the source directory for drawing splitting, and write them into the CAD drawing splitting auxiliary table. Step 502: Select the storage directory for the split drawings, and write the path information in the storage directory for the split drawings into the CAD drawing splitting auxiliary table. Step 503: Perform drawing splitting operations according to the CAD drawing splitting auxiliary table. Specifically, it includes: Step 5031: Obtain the internal information of the standard drawing frame in the template recognition list table defined by the user, and write it into an array. Step 5032: Obtain the name and storage path information of the general layout drawing file to be split in the CAD drawing splitting auxiliary table, and write them into an array. Step 5033: Obtain all drawing information to be split according to the name of the general layout drawing file to be split. The drawing information includes at least the drawing name, the world coordinates of the lower left corner of the drawing frame, and the boundary dimensions of the drawing frame. Step 5034: Determine whether the drawing information to be split is incorrect. If so, go to Step 5035; otherwise, go to Step 5036. Step 5035: After modifying the drawing name, re-enter Step 5034. Step 5036: Calculate the boundary coordinates of the drawing to be split according to the drawing information. Step 5037: Create a corresponding DWG format file according to the drawing name. Step 5038: Copy and paste the drawing to be split into the corresponding DWG format file according to the boundary coordinates of the drawing to be split, and save the DWG format file to the storage directory for the split drawings. Step 5039: Determine whether all drawing splitting work has been completed. If so, exit the drawing splitting work; otherwise, repeat Steps 5036 to 5038.
8. The CAD file auxiliary processing method for the air-conditioning industry according to claim 1, characterized in that The specific content of Step 7 is as follows: Step 701: Select the source directory of the file to be converted, and write the path information of the source directory of the file to be converted into the CAD-PDF conversion auxiliary table. The source directory of the file to be converted is the storage directory of the general drawing file or the storage directory of the single drawing file. Step 702: Convert the DWG format drawings into PDF format according to the source directory of the file to be converted. Specifically, it includes: Step 7021: Obtain the internal file information of the standard drawing frame in the user-defined template recognition list table and write it into an array. Step 7022: Obtain the CAD-PDF conversion auxiliary table and write the path information of the source directory of the file to be converted in it into an array. Step 7023: Obtain the standard drawing frame information and name information corresponding to all the drawings in the general drawing file. The standard drawing frame information includes: the boundary size of the standard drawing frame and the world coordinates of the lower left corner of the standard drawing frame. Step 7024: Determine whether the information of the drawing to be converted is incorrect. If so, enter Step 7035; otherwise, enter Step 7036. Step 7025: Modify the name of the drawing to be converted and then re-enter Step 7024. Step 7026: Select the area of the drawing to be converted according to the world coordinates of the lower left corner of the standard drawing frame and save the selected content as a PDF format document. The name of the PDF format document is the corresponding drawing name, and the storage location is the source directory of the file to be converted. Step 7027: Determine whether all drawing conversion work has been completed. If so, exit the drawing conversion work; otherwise, repeat Steps 7026 to 7027.
9. A CAD file auxiliary processing system for the air conditioning industry, characterized in that, It includes: The CAD template file copying module is used to automatically move, scale, and copy the original drawing files corresponding to multiple components, calculate the world coordinate points of each original drawing in the general drawing file according to the preset arrangement method, and paste each original drawing to the corresponding position in the general drawing file according to the world coordinate points; and match and add the corresponding standard drawing frames to each original drawing, and write the original file name of the corresponding original drawing in the detail column of each standard drawing frame. The CAD template file copying module is specifically used for: Obtain the directory of the folder of the original drawing to be copied, traverse and extract the names, absolute file paths, and file modification times of all DXF files in the folder of the original drawing and its sub-folders, and write the extracted content into the CAD template copying auxiliary table. Obtain the storage directory for file copying, and store the absolute path information corresponding to the storage directory for file copying in the specified area of the CAD template copying auxiliary table. Perform original drawing boundary recognition, original drawing scaling, copying, pasting, standard drawing frame screening and matching, and original file name filling according to the CAD template copying auxiliary table, and perform loop operations until all original drawing files are copied. CAD Initial List Generation and Text Filling Module, which is used to obtain the parts assembly information list of the original drawing according to the storage information and storage relationship of the original drawing file of the drawing, and write the content of the parts assembly information list into the bill of materials of the corresponding standard drawing frame; CAD Parts Price Estimation and Text Replacement Module, which is used to determine the types and prices of the parts corresponding to each original drawing of the drawing, determine the formal part names corresponding to each part according to the types and prices of the parts, and replace the original file names in the bill of materials of each standard drawing frame with the formal part names; CAD Bill of Materials Extraction Module, which is used to extract information from the bill of materials of each standard drawing frame according to the extraction identification information to obtain the bill of materials corresponding to all parts; CAD Drawing Splitting Module, which is used to split each drawing in the general drawing file into single drawing files, modify the file names of each drawing according to the corresponding formal part names and save them to the specified directory, and the drawings include the original drawing of the drawing and its corresponding standard drawing frame; CAD File Content Inspection Module, which is used to inspect the general drawing file and single drawing files, and the inspection content at least includes: whether the formal part names appear repeatedly or are missing, whether there is missing content in the bill of materials of each standard drawing frame, whether there is overlap in each standard drawing frame, whether there are un-replaced original file names, whether the file names of the drawings are consistent with the corresponding formal part names, and whether the drawing scale marked on the drawing is consistent with the drawing scale; CAD-PDF Conversion Module, which is used to convert each single drawing file into PDF format.
Citation Information
Patent Citations
Mechanical drawing labeling method and device and electronic equipment
CN112926221A
Automated metrology recipe generation
US20070156275A1