A system and method for rapidly changing the units of a drawing
By identifying drawing elements through the CAD underlying interface, constructing a conversion rule library and performing dynamic compensation, the problem of low efficiency in drawing unit conversion for design institutes and coal mining enterprises is solved, achieving fast and accurate drawing unit conversion and improving the collaborative efficiency of mining engineering drawings.
Patent Information
- Application Number
- CN202511079736.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-04
AI Technical Summary
In the field of mining engineering, design institutes and coal mining enterprises use different drawing units (millimeters and meters), which leads to low efficiency, inconsistent standards, extended collaboration cycles, and high error risks when manually converting drawings during handover. Existing CAD software lacks batch processing capabilities and synchronous update functions.
By identifying drawing elements through the CAD underlying interface, a standardized conversion rule library is built to achieve batch conversion of dimension annotations, text annotations, and element attribute parameters. Dynamic compensation is performed using a dimension chain coordinator to generate new drawing files that conform to the target unit.
It enables automated and rapid switching of drawing units, reduces human error, improves drawing collaboration efficiency, shortens unit conversion time, and ensures the accuracy and consistency of drawings.
Smart Images

Figure CN120579356B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a system and method for quickly changing the unit of drawing paper, belonging to the technical field of mining engineering design and computer-aided design. BACKGROUND
[0002] In the field of mining engineering, design institutes usually use millimeters (mm) as the unit of drawing paper for design and drawing, while coal mining enterprises are used to using meters (m) as the unit of drawing paper for the convenience of on-site construction management. The difference in unit system leads to the problems of low efficiency of manual conversion, non-uniform standards, prolonged collaboration period, and high risk of errors when the drawings are handed over between the two parties.
[0003] In the prior art, some CAD software provides a unit modification function for single size annotation, but lacks batch processing capability and cannot update the geometry parameters and text annotations of the drawing elements synchronously. For mining drawings containing professional symbols (such as anchor rod spacing and roadway section size), the traditional method cannot meet the demand for automatic conversion, and an efficient solution for quickly changing the unit is urgently needed. SUMMARY
[0004] The present application aims to overcome the deficiencies in the prior art and provide a system and method for quickly changing the unit of drawing paper, which realizes batch conversion of mining drawings from millimeters to meters through programmed processing, solves the problems of low efficiency and large errors in traditional manual conversion, improves the collaboration efficiency of design and production units, and ensures the accuracy and standardization of engineering drawings.
[0005] To achieve the above-mentioned purpose, the present application is implemented by using the following technical solutions:
[0006] In a first aspect, the present application provides a method for quickly changing the unit of drawing paper, comprising:
[0007] reading a drawing file through a CAD bottom interface, identifying the coordinate values and text contents of size annotations, text annotations, and element attribute parameters;
[0008] constructing a standardized conversion rule library, setting conversion rules and exception handling rules for size annotations, text annotations, and element attribute parameters;
[0009] batch converting the coordinate values and text contents of the identified size annotations, text annotations, and element attribute parameters according to the conversion rules and exception handling rules, and synchronously adjusting the element coordinates and scale factors;
[0010] performing proportionality consistency verification on the converted drawing paper, and generating a new drawing paper file conforming to the target unit;
[0011] performing size chain dynamic compensation on the drawing paper file through a size chain coordinator, and automatically updating the annotations to the entities, wherein the size chain dynamic compensation formula is:
[0012] In the formula, is the modified size value; is the initial conversion value of a single size mark; is the sum of all mark initial conversion values of the current size chain; is the sum of the original mark values of the current size chain.
[0013] Further, the identification of the size mark includes: obtaining the mark value and unit suffix of the linear mark, angle mark and radius mark through DXF / DWG file format analysis; the unit conversion of the text annotation includes: after automatically identifying the unit keyword, replacing the text content and adjusting the font display ratio according to the rules; the graphic element attribute parameter includes: line length, arc radius and filling area, and the graphic element attribute parameter conversion keeps the geometric relationship unchanged and only changes the numerical unit.
[0014] Further, the conversion rules and exception handling rules of the size mark, text annotation and graphic element attribute parameter include: numerical conversion rules, text replacement rules and exception handling rules; the numerical conversion rules include: 1000 times conversion of millimeter to meter, supporting custom decimal place number; the text replacement rules include: replacing "mm" with "m" and adjusting the unit description in the text annotation; the exception handling rules include: setting a unit conversion whitelist for special graphic elements, including legends and non-size text.
[0015] Further, according to the conversion rules and exception handling rules, the coordinate values and text contents of the identified size mark, text annotation and graphic element attribute parameter are batch converted, and the graphic element coordinates and scale factor are adjusted synchronously, including:
[0016] For the size mark, the conversion is performed after obtaining the measurement value, and the mark text and associated geometric coordinates are updated;
[0017] For the text annotation, the unit keyword is matched through a regular expression, the text content is replaced, and the font height is adjusted according to the proportion;
[0018] For the graphic element attribute parameter, the value is updated synchronously and the graphic proportion is kept unchanged.
[0019] Further, the converted drawing is subjected to proportion consistency verification, and a new drawing file conforming to the target unit is generated, including: checking the size chain closure of the converted drawing, comparing the deviation of the key node coordinates before and after conversion, and only generating a new drawing file in response to an error that does not exceed the allowed error, preserving the original layer structure and naming rules, and adding a version identifier of "unit conversion completed".
[0020] Further, it also includes:
[0021] The text self-adapting scaling of the drawing file is carried out through the word processor, and the display attribute of the text entity is directly controlled, and the formula is:
[0022] In the formula, is the processed text height; is the original text height; is the unit conversion ratio;
[0023] The geometry coordinate of the drawing file is quickly corrected through the geometry checking engine, and the coordinate data of the finally written file is generated, and the formula is:
[0024] In the formula, is the final effective coordinate value; is the original coordinate value; is the directly converted coordinate; is the tolerance threshold; is the curvature constraint compensation amount; is the local curvature.
[0025] In the second aspect, the application provides a system for quickly changing the unit of a drawing, comprising:
[0026] A drawing analysis module: reading a drawing file through a CAD bottom interface, and identifying coordinate values and text contents of dimension marks, text annotations and graphic element attribute parameters;
[0027] A unit mapping module: constructing a standardized conversion rule library, and setting conversion rules and exception processing rules of dimension marks, text annotations and graphic element attribute parameters;
[0028] A parameter conversion module: batch converting the identified coordinate values and text contents of dimension marks, text annotations and graphic element attribute parameters according to the conversion rules and exception processing rules, and synchronously adjusting graphic element coordinates and scale factors;
[0029] A checking output module: performing proportion consistency checking on the converted drawing, and generating a new drawing file conforming to a target unit, the checking output module performing size chain dynamic compensation on the drawing file through a size chain coordinator, and automatically updating to the marked entity, and the size chain dynamic compensation formula is:
[0030] In the formula, is the corrected size value; is the initial conversion value of a single dimension mark; is the sum of initial conversion values of all marks in the current size chain; is the sum of original mark values of the current size chain.
[0031] In a third aspect, the present application provides a device for quickly changing the unit of drawings, comprising a processor and a storage medium;
[0032] The storage medium is used for storing instructions;
[0033] The processor is used for operating according to the instructions to perform the steps of the method according to any one of the above.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the method according to any one of the above.
[0035] Compared with the prior art, the present application has the following beneficial effects:
[0036] I. The present solution is aimed at the conversion requirement of drawing units between mining professional design institutes and coal mine enterprises. By analyzing drawing elements, establishing unit mapping relationship, batch parameter conversion and dynamic checking mechanism, the automatic and rapid switching of drawing units is realized. The elements such as size marking, text annotation and graphic attribute parameters in the drawing can be automatically recognized. The unit conversion is completed according to the preset rules and the drawing scale consistency is maintained. Using this method, the time-consuming of traditional manual unit conversion can be shortened from several hours to minutes, the human error is greatly reduced, and the collaborative efficiency of mining engineering drawings is improved.
[0037] II. The size chain proportion distribution model is used to complete the closed-loop correction only once, which greatly improves the efficiency compared with the traditional manual checking, eliminates the risk of cumulative error, dynamically compensates for efficiency; the text scaling rule is realized intelligently through simple logical branching, avoiding complex parameter configuration, while ensuring the readability of key information, realizing rule-driven text processing; the threshold triggering mechanism concentrates the calculation load on the key abnormal points, most of the coordinate points do not need additional calculation, supports millisecond-level response, and realizes lightweight geometric correction. BRIEF DESCRIPTION OF DRAWINGS
[0038] The drawings accompanying the specification of the present application form a part thereof, serve to provide further understanding of the present application, and together with the description of the exemplary embodiments of the present application and the explanation thereof serve to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0039] Figure 1 A flowchart of a method for quickly changing the unit of drawings provided for the first embodiment of the present application. DETAILED DESCRIPTION
[0040] The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0041] The following detailed description is exemplary in nature and is intended to provide further description of the application. All technical terms employed herein are intended to have the same meaning as commonly understood by one of ordinary skill in the art to which the application pertains unless otherwise defined. The terminology used in the present application is for the purpose of describing only the exemplary embodiments of the present application and is not intended to limit the scope of the exemplary embodiments of the present application.
[0042] Embodiment One:
[0043] Please refer to Figure 1 The embodiment provides a method for quickly changing the unit of a drawing, including the following core technical solutions:
[0044] S1, drawing element analysis. Read the drawing file through the CAD bottom interface, identify the coordinate values and text content of elements such as dimension marking, text annotation, and graphic attribute parameters, including:
[0045] Read the DWG / DXF format drawing through the CAD secondary development interface (such as ObjectARX), traverse all graphic entities, identify dimension marking (linear, angle, radius, etc.), text annotation (including unit description), graphic attribute parameters (such as line length, arc radius), and establish an element parameter list containing coordinate values and text content;
[0046] It should be noted that the identification of dimension marking includes linear marking, angle marking, radius marking, etc. The marking value and unit suffix are obtained by parsing the DXF / DWG file format; the unit conversion of text annotation includes automatically identifying "mm", "meters" and other unit keywords, replacing the text content according to the rules and adjusting the font display ratio; the graphic attribute parameters include line length, arc radius, and filled area, etc. The geometric relationship is kept unchanged during conversion, and only the value unit is changed.
[0047] S2, unit mapping definition. Construct a standardized conversion rule library, set conversion rules and exception handling rules for dimension marking, text annotation, and graphic attribute parameters, including:
[0048] (1) Numerical conversion rule: 1000 times conversion from millimeter to meter, supporting custom decimal place number (such as defaulting to 3 decimal places);
[0049] (2) Text replacement rule: automatically replace "mm" with "m", and adjust the unit description in the text annotation (such as converting "500mm" to "0.5m");
[0050] (3) Exception handling rule: set a unit conversion whitelist for special graphics (such as legend explanation, non-dimension text).
[0051] S3, Parameter Batch Conversion. According to the conversion rule and exception handling rule, the coordinate values and text content of the identified dimension label, text annotation and figure attribute parameter are batch converted, and the figure coordinates and scale factor are adjusted synchronously, including:
[0052] For dimension label, after obtaining the measurement value, conversion is performed, and the label text and associated geometric coordinates are updated;
[0053] For text annotation, replace the text content by matching the unit keyword through regular expression and adjust the font height proportionally (e.g. original font height 3.5mm, converted to display 3.5m, font height is enlarged proportionally);
[0054] For figure attribute parameters such as polyline length and circular area, the value is updated synchronously and the figure scale is kept unchanged.
[0055] S4, Verification and Output. The converted drawing is verified for proportion consistency, and a new drawing file conforming to the target unit (meter / millimeter) is generated, including:
[0056] Automatically check the dimension chain closure of the converted drawing, and compare the deviation of the key node coordinates before and after conversion (allowable error ≤0.001m);
[0057] Generate a new drawing file, keep the original layer structure and naming rules, and add a version identifier "unit conversion completed".
[0058] This embodiment takes a coal mine underground yard layout drawing as an example, the original drawing is a millimeter unit DWG file provided by the design institute, containing 2376 dimension labels, 158 text annotations and 429 figure objects, which needs to be converted to meter unit for enterprise construction use, the system running process is as follows:
[0059] Rule configuration: set the conversion rule to "millimeter to meter" in the system interface, the text replacement rule is "mm replaced by m, value divided by 1000", and the exception handling is set to "legend text not converted".
[0060] Batch conversion: after clicking the "start conversion" button, the system processes in parallel:
[0061] Dimension label: the original label value "500" is converted to "0.500", and the label text "500mm" is changed to "0.500m";
[0062] Text annotation: such as "roadway net width 5000mm" converted to "roadway net width 5.000m", font height is enlarged proportionally;
[0063] Figure attribute parameter: such as a line segment with a length of 10000mm, the coordinate value is automatically divided by 1000, keeping the relative position of the end points unchanged.
[0064] Check output: generate new DWG file after unit conversion.
[0065] The present scheme has the following improvements:
[0066] Efficiency improvement: unit conversion time is shortened from 4 hours per sheet to 0.5 minutes per sheet, with a 480-fold increase in efficiency;
[0067] Error reduction: human conversion error rate is reduced from 15% to less than 0.3%, and key size conversion accuracy is 100%;
[0068] Standardization and unification: through the rule base, ensure that all drawing conversion standards are consistent, and eliminate human differences;
[0069] Collaborative acceleration: drawing handover cycle is shortened by 50%, supporting real-time feedback in design-production link;
[0070] Strong compatibility: support for mining professional special graphics units (such as roadway section, support structure) unit conversion.
[0071] In the description of the present application, the element type of drawing analysis, the configuration method of unit conversion rule, etc. cannot be understood as a limitation of the present application. The specific implementation language of the system module (such as C#), the drawing format compatibility (DWG / DXF / ZWCAD) and other contents do not constitute a limitation on the scope of protection.
[0072] In the unit conversion process, there are also problems such as the accumulation of multi-segment dimension marking, which destroys the design closure, the distortion of engineering semantics after unit conversion, and the deterioration of readability, as well as the geometric topology relationship caused by discrete coordinate conversion. The present scheme further proposes dynamic compensation of dimension chain, adaptive scaling of text and rapid correction of geometric coordinates to solve the above problems, which specifically includes:
[0073] I. Through the dimension chain coordinator, the dimension chain of the drawing file is dynamically compensated (linear weighted model), and is automatically updated to the marked entity, and the formula is:
[0074] In the formula, is the corrected dimension value; is the initial conversion value of a single dimension marking (unit: m); is the sum of the initial conversion values of all markings in the current dimension chain (unit: m); is the sum of the original marking values of the current dimension chain (unit: mm). For example: the original sum of the axis dimension chain is 60,000 mm→the converted theoretical value is 60 m, if the initial cumulative value is 60.015 m, then "24.000 m" is corrected to 24.000 ÷ 60.015 × 60 = 23.998 m.
[0075] II. Text self-adaptive scaling (piecewise linear function) is performed on the drawing file by using a word processor to directly control the display properties of text entities, and the formula is:
[0076] In the formula, is the processed text height; is the original text height; is the unit conversion ratio; for example, the critical dimension "3500mm" (dimension mark type text) is enlarged to 1.2 times the original height, and the legend "no scaling" (legend type text) is reduced to 0.8 times the original height.
[0077] III. Geometric coordinate correction (threshold trigger mechanism) is performed on the drawing file by using a geometric verification engine to generate the final coordinate data written to the file, and the formula is:
[0078] In the formula, is the final effective coordinate value; is the original coordinate value (unit: mm); conv is the directly converted coordinate (unit: m); is the tolerance threshold (default 0.0005m); is the curvature constraint compensation amount; is the local curvature (calculated from adjacent primitives, unitless). For example, the original coordinate of the arc control point (12, 500mm, 8, 430mm) is directly converted to (12.500m, 8.430m), and if the detected deviation is greater than 0.0005m, a ±0.001m compensation is added according to the curvature.
[0079] The size chain ratio distribution model of the present scheme only needs to be calculated once to complete the closed-loop correction, which greatly improves the efficiency compared with the traditional manual checking, and eliminates the risk of cumulative error, dynamically compensates for efficiency; the text scaling rule is realized by simple logic branching, which avoids complex parameter configuration and at the same time guarantees the readability of key information, realizes rule-driven text processing; the threshold trigger mechanism concentrates the calculation load on the key abnormal points, most of the coordinate points do not need additional calculation, supports millisecond-level response, and realizes lightweight geometric correction.
[0080] Example Two:
[0081] A system for quickly changing the unit of a drawing can implement the method for quickly changing the unit of a drawing described in Example One, comprising:
[0082] Drawing parsing module: for reading drawing files and identifying various graphic elements and parameters, the drawing parsing module is developed based on CAD underlying API, realizes the reading and element identification of drawing files, and outputs element parameter set containing coordinates, numerical values, and text, including: reading drawing files through CAD underlying interface, identifying coordinate values and text content of dimension mark, text annotation and graphic element attribute parameter.
[0083] Unit mapping module: for storing unit conversion rules and exception handling logic, the unit mapping module stores conversion rules in JSON format, supports user-defined rule import, provides rule testing and preview functions, including: constructing a standardized conversion rule library, setting conversion rules and exception handling rules for dimension mark, text annotation and graphic element attribute parameter.
[0084] Parameter conversion module: for performing numerical conversion, text replacement and graphic element proportion adjustment, the parameter conversion module includes numerical calculation engine, text processing engine and graphic element operation engine, realizing parallel conversion processing of three types of elements, including: according to the conversion rules and exception handling rules, the coordinate values and text content of the identified dimension mark, text annotation and graphic element attribute parameter are batch converted, and the graphic element coordinates and proportion factor are adjusted synchronously.
[0085] Verification output module: for verifying conversion accuracy and generating new drawing files, the verification output module integrates geometry verification algorithm and drawing export function, supports PDF / DWG dual format output and conversion log generation, including: performing proportion consistency verification on the converted drawing, and generating new drawing files conforming to the target unit.
[0086] It should be noted that the drawing parsing module is developed based on ObjectARX, and the geometric data and attribute information of CAD graphic elements are obtained through AcDbObject class interface; the unit mapping module supports custom conversion rules, allowing users to add special graphic element unit conversion exception configuration.
[0087] Embodiment three:
[0088] The embodiment of the application also provides a device for quickly changing drawing units, which can realize the method for quickly changing drawing units as described in embodiment one, and includes a processor and a storage medium.
[0089] The storage medium is used for storing instructions.
[0090] The processor is used for operating according to the instructions to execute the steps of the following method:
[0091] The drawing files are read through the CAD underlying interface, and the coordinate values and text content of the dimension mark, text annotation and graphic element attribute parameter are identified.
[0092] A standardized conversion rule library is constructed, and conversion rules and exception processing rules of size marking, text annotation and graphic attribute parameter are set;
[0093] According to the conversion rules and the exception processing rules, the coordinate values and the text contents of the recognized size marking, text annotation and graphic attribute parameter are batch-converted, and the graphic coordinate and the scale factor are synchronously adjusted;
[0094] The converted drawing is subjected to proportion consistency verification, and a new drawing file conforming to the target unit is generated.
[0095] Embodiment four:
[0096] The embodiment of the application further provides a computer readable storage medium, which can realize the method for quickly changing drawing units in the embodiment one, and has a computer program stored thereon, and the program is executed by a processor to realize the steps of the method.
[0097] The drawing file is read through a CAD bottom interface, and the coordinate values and the text contents of size marking, text annotation and graphic attribute parameter are recognized;
[0098] A standardized conversion rule library is constructed, and conversion rules and exception processing rules of size marking, text annotation and graphic attribute parameter are set;
[0099] According to the conversion rules and the exception processing rules, the coordinate values and the text contents of the recognized size marking, text annotation and graphic attribute parameter are batch-converted, and the graphic coordinate and the scale factor are synchronously adjusted;
[0100] The converted drawing is subjected to proportion consistency verification, and a new drawing file conforming to the target unit is generated.
[0101] It is to be understood by those skilled in the art that the application can be implemented by other embodiments without departing from the spirit or essential characteristics thereof. Therefore, the above disclosed embodiments are merely illustrative in all aspects and are not the only ones. All changes within the scope of the application or within the equivalent scope of the application are intended to be included in the application.
[0102] Those skilled in the art should understand that the embodiments of the application can be provided as a method, a system or a computer program product. Therefore, the application can adopt a completely hardware embodiment, a completely software embodiment or an embodiment combining software and hardware aspects. Moreover, the application can adopt a computer program product in the form of being implemented on one or more computer usable storage media containing computer usable program codes, including but not limited to disk memory, CD-ROM, optical memory, etc.
[0103] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.
[0104] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.
[0105] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.
[0106] Finally, it should be noted that the above-mentioned embodiments are merely intended to illustrate the technical solutions of the present application, rather than limit the same. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the specific embodiments of the present application can be modified or equivalent replacements without departing from the spirit and scope of the present application, and any modifications or equivalent replacements shall be included in the protection scope of the claims of the present application.
Claims
1. A method for quickly changing the units of a drawing, characterized by, The method comprises the steps of: reading a drawing file through a CAD underlying interface, identifying coordinate values and text content of dimension marks, text annotations and graphic attribute parameters; constructing a standardized conversion rule library, setting conversion rules and exception handling rules of dimension marks, text annotations and graphic attribute parameters; According to the conversion rule and the exception handling rule, the coordinate value and the text content of the recognized dimension mark, the text annotation and the graphic attribute parameter are batch converted, and the graphic coordinate and the scale factor are adjusted synchronously; The converted drawing is checked for proportion consistency, and a new drawing file conforming to the target unit is generated; The size chain dynamic compensation of the drawing file is carried out by the size chain coordinator, and is automatically updated to the marking entity, and the size chain dynamic compensation formula is: In the formula, L final is a modified size value; L conv is an initial conversion value of a single size marking; ∑L conv_i is a sum of initial conversion values of all markings in the current size chain; ∑L orig_i is a sum of original marking values in the current size chain; The text self-adapting zooming is carried out on the drawing file by using the word processor, and the display attribute of the text entity is directly controlled, and the formula is: In the formula, H new is the height of the processed text; H orig is the height of the original text; U ratio is the unit conversion ratio; The geometry checking engine is used to correct the geometry coordinates of the drawing file rapidly, and the final coordinate data written in the file is generated, and the formula is: In the formula, P corrected is the final effective coordinate value; P orig is the original coordinate value; P conv is the coordinate directly converted; ε is a tolerance threshold; δ is a curvature constraint compensation amount; is the local curvature.
2. The method of quickly changing the unit of the drawing sheet according to claim 1, wherein The recognition of the dimension mark comprises: obtaining the marking value and unit suffix of the linear marking, angle marking and radius marking through DXF / DWG file format analysis; The unit conversion of the text annotation comprises: after automatically identifying the unit keyword, replacing the text content according to the rule and adjusting the font display proportion; The graphic attribute parameter comprises: line length, arc radius and filling area, and the graphic attribute parameter conversion keeps the geometric relationship unchanged and only changes the value unit.
3. The method of quickly changing the unit of the drawing sheet according to claim 1, wherein, The conversion rule and the exception handling rule of the dimension mark, the text annotation and the graphic attribute parameter include: the value conversion rule, the text replacement rule and the exception handling rule; The value conversion rule includes: 1000 times conversion from millimeter to meter, supporting custom decimal place number; The text replacement rule includes: replacing "mm" with "m", and adjusting the unit description in the text annotation; The exception handling rule includes: setting a unit conversion whitelist for special graphics, including legend and non-size text.
4. The method of quickly changing the unit of the drawing sheet according to claim 1, wherein According to the conversion rule and the exception handling rule, the coordinate value and the text content of the recognized dimension mark, the text annotation and the graphic attribute parameter are batch converted, and the graphic coordinate and the scale factor are adjusted synchronously, comprising: For dimension marks, after obtaining the measurement value, perform conversion, and update the marking text and the associated geometric coordinates; For text annotations, match unit keywords through regular expressions, replace text content and adjust font height by proportion; For graphic attribute parameters, update the value synchronously and keep the graphic proportion unchanged.
5. The method of quickly changing the unit of the drawing sheet according to claim 1, wherein, The converted drawing is checked for proportion consistency, and a new drawing file conforming to the target unit is generated, comprising: checking the dimension chain closure of the converted drawing, comparing the deviation of the key node coordinates before and after conversion, and only generating a new drawing file when the error does not exceed the allowed error, keeping the original layer structure and naming rules, and adding a version identifier of "unit conversion completed".
6. A system for rapidly changing the units of a drawing, characterized by, The method comprises the steps of: Drawing analysis module: reading a drawing file through a CAD underlying interface, identifying coordinate values and text content of dimension marks, text annotations and graphic attribute parameters; Unit mapping module: constructing a standardized conversion rule library, setting conversion rules and exception handling rules of dimension marks, text annotations and graphic attribute parameters; Parameter conversion module: according to the conversion rule and the exception handling rule, the coordinate value and the text content of the recognized dimension mark, the text annotation and the graphic attribute parameter are batch converted, and the graphic coordinate and the scale factor are adjusted synchronously; The check output module: the converted drawing is proportioned and consistent, and the new drawing file conforming to the target unit is generated. The check output module carries out dynamic compensation of the size chain of the drawing file through the size chain coordinator, and automatically updates the labeled entity. The formula of the dynamic compensation of the size chain is: In the formula, L final is the modified size value; L conv is the initial conversion value of a single size label; ∑L conv_i is the sum of the initial conversion values of all labels in the current size chain; ∑L orig_i is the sum of the original label values in the current size chain. The text self-adapting zooming is performed on the drawing file by using a word processor, and the display attribute of the text entity is directly controlled, and the formula is: In the formula, H new is the height of the processed text; H orig is the height of the original text; U ratio is the unit conversion ratio; The geometric verification engine performs rapid geometric coordinate correction on the drawing file, generating the final coordinate data to be written to the file. The formula is as follows: In the formula, P corrected The final valid coordinate value; P orig These are the original coordinate values; P conv These are the coordinates after direct conversion; ε is a tolerance threshold; δ is a curvature constraint compensation amount; is the local curvature.
7. A device for quickly changing the units of a drawing, characterized in that, It comprises a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate on the instructions to perform the steps of the method of any of claims 1-5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program, when executed by the processor, implements the steps of the method of any of claims 1-5.
Citation Information
Patent Citations
Vertical graph identification method for converting architectural drawing into three-dimensional BIM model
CN109993827A
Intelligent labeling method and plug-in for CAD (Computer Aided Design) drawing
CN120235989A