A method for reusing large-scale images based on ObjectArx

CN117235837BActive Publication Date: 2026-08-14NORTHWEST ENGINEERING CORPORATION LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-01
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]这部分工作数量庞大,工作重复,过程琐碎,效率低下,浪费精力和时间,并且极其容易发生错误导致返工修改

Benefits of technology

[0047]This invention provides a method for reusing large-scale drawings based on ObjectArx, solving the problem of designers having to perform calculations based on Excel spreadsheets and manually modify them in AutoCAD in accordance with CAD drawings. This method utilizes AutoCAD technology to define CAD large-scale drawing template files to construct a large-scale drawing template library. Based on project design requirements, it quickly extracts large-scale drawing templates from the library, reads the target parameter information from the target Excel parameter template file to obtain the target parameter group, and parses the object type binding information according to string data rules to obtain the target bound parameter array and target bound formula array. It then iterates through the obtained target bound parameter array and target bound formula array to obtain the object type information of the nth object and calculates the modification value FVR. This modifies the target drawing annotations and text element objects, enabling rapid modification and reuse of drawings. This method is highly efficient, convenient, reliable, versatile, compatible, and widely applicable, fully replacing existing manual calculations and element searching processes, greatly improving design efficiency and reducing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235837B_ABST
    Figure CN117235837B_ABST
Patent Text Reader

Abstract

This invention provides a method for reusing large-scale drawings based on ObjectArx, solving the problem of designers having to perform calculations based on Excel spreadsheets and manually modify them in AutoCAD in accordance with CAD drawings. This method utilizes AutoCAD technology to define CAD large-scale drawing template files to construct a large-scale drawing template library. Based on project design requirements, it quickly extracts large-scale drawing templates from the library, reads the target parameter information from the target Excel parameter template file, and obtains the target bound parameter array and target bound formula array. It then iterates through the obtained target bound parameter array and target bound formula array to obtain the object type information of the nth object and calculates the modification value FVR. This modifies the target drawing annotations and text element objects, enabling rapid modification and reuse of drawings. This method is highly efficient, convenient, reliable, versatile, compatible, and widely applicable, fully replacing existing manual calculations and element searching processes, greatly improving design efficiency and reducing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-scale image reuse based on ObjectArx, and in particular to a method for large-scale image reuse based on ObjectArx. Background Technology

[0002] In the design industry, AutoCAD drawing is an indispensable part. Standard detailed drawings exist during the design process and can be reused in new projects simply by modifying the annotation information. Currently, this work relies on designers calculating and processing data using Excel spreadsheets, then manually modifying the drawings in AutoCAD based on the CAD specifications.

[0003] This part of the work is massive, repetitive, tedious, inefficient, and wastes energy and time. It is also extremely prone to errors leading to rework and modifications. As projects increase and drawings become more complex, this part of the work requires ever-growing amounts of manpower and time, resulting in a significant waste of the design institute's resources. Summary of the Invention

[0004] To address the aforementioned problems, this invention provides a method for reusing large-format images based on ObjectArx. It offers advantages such as ease of operation, flexible application, one-click generation, and comprehensive functionality.

[0005] This invention provides a method for reusing large-scale images based on ObjectArx, which includes the following steps:

[0006] S1: Define the Excel parameter file for the detailed drawing. Based on the ObjectARX detailed drawing template definition tool, bind the parameter names in the Excel parameter file to the elements in the dwg drawing through extended data. Define the detailed drawing template file and build a detailed drawing template library. The detailed drawing template library includes project type and professional type.

[0007] S2: Extract the detailed drawing template from the detailed drawing template library created in step S1 according to the project type and professional type as the target detailed drawing template file; modify the parameter values ​​of the Excel parameter template file according to the project requirements, obtain the target Excel parameter template file and the target DWG drawing file, modify the target parameter values ​​of the target detailed drawing template file, and obtain the target detailed drawing template file;

[0008] S3: Obtain the target detail drawing template file according to step S2. Use the ObjectARX-based detail drawing modification tool to read the target parameter information from the Excel parameter template file of the target Excel file to obtain the target parameter group. Iterate through all elements in the detail drawing DWG template file of the opened target DWG drawing file to obtain extended data values. Then, according to the string data rules, parse the information of object type binding to obtain the element ID in the detail drawing DWG template file; obtain the target binding parameter array; insert the parsed object binding information into the array to obtain the target binding formula array; iterate through the obtained target binding parameter array and target binding formula array to obtain the object type information of the nth object, and calculate the modification value FVR. Modify the annotation and text element objects of the target detail drawing template file to achieve drawing reuse; where n is greater than or equal to 1.

[0009] Preferably, step S1, which involves binding the parameter names in the defined detail drawing Excel parameter file with the elements in the dwg drawing file through extended data, defining the detail drawing template file, and constructing the detail drawing template library, includes the following steps:

[0010] S11: Build a detailed drawing template library based on the FTP protocol. Create a project type folder in the root directory, and a professional type folder under each project folder. Name the defined detailed drawing template files according to the detailed drawing name and place them in the corresponding project type and professional type folders. Categorize and manage the detailed drawing templates. Quickly browse folders by project type and professional type to find the detailed drawing template files needed in the project. The detailed drawing template files include detailed drawing dwg drawing files and Excel parameter template files.

[0011] S12: Using the ObjectARX-based large-scale drawing template creation tool, the parameter information in the Excel parameter template file, or the custom formula and the annotation elements or text elements in the dwg drawing file are associated with the CAD software's own extended data xdata to finally generate a large-scale drawing dwg template file;

[0012] S13 packages and compresses the large-scale drawing dwg template file and the Excel parameter template file and places them into the corresponding project type and professional directory to form a large-scale drawing template library.

[0013] Preferably, step S12, which involves generating the final detailed drawing (dwg) template file, further includes the following steps:

[0014] S121 creates an Excel parameter template file based on the detailed drawing information. The Excel parameter template file contains two columns: parameter name and parameter value. The first column is the parameter name, and the second column is the parameter value. The Excel parameter template file is read to obtain the parameter name array.

[0015] S122 retrieves an array of object types. The steps are as follows:

[0016] a. Define the object type data XML configuration file

[0017] Configure the object type information for the parameter values ​​in the second column of the Excel parameter template file. The object type includes the type name N, decimal place D, unit U, and whether unit conversion is required C. This is configured through a plain text XML configuration file. N represents the type name (a string that can be arbitrarily defined); D represents the number of decimal places to retain (an integer); U represents the unit (a string defined as meters, decimeters, or millimeters); and C indicates whether unit conversion is required (an integer where 1 indicates unit conversion is required, and other values ​​indicate no unit conversion is needed).

[0018] b. Get an array of object types

[0019] Based on the defined object type data XML configuration file, obtain the object type array, which is: [{N1,D1,U1,C1},{N2,D2,U2,C2}.....{N n D n U n C n}]; where N1 in the object type array represents the first type name string, D1 is the parameter value corresponding to the first type name with decimal rounding, U1 represents the unit of the parameter value corresponding to the first type name, C1 represents whether the parameter value corresponding to the first type name needs to be calculated by unit conversion, and so on, Nn represents the nth type name string, Dn is the parameter value corresponding to the nth type name with decimal rounding, Un represents the unit of the parameter value corresponding to the nth type name, and Cn represents whether the parameter value corresponding to the nth type name needs to be calculated by unit conversion;

[0020] To add extended data to elements in the S123 large detail drawing dwg template file, follow these steps:

[0021] a. Select the parameter name from the parameter array obtained in step S121;

[0022] b. Select the text or annotation element in the large-scale drawing DWG template file to obtain the element array EntArr.

[0023] c. After selecting an object type name for each element in the element array, obtain the object type information from the object type array obtained in step S122 based on the object type name;

[0024] d. Add custom extended data to each element in the element array EntArr. The name of the custom extended data is "Parameter Extended Data".

[0025] PumpingAppData's extended data contains parameter names and object types.

[0026] S124 Select the annotation or text element in the large-scale drawing dwg template file to add formula extended data;

[0027] a. Select parameter names from the parameter name array obtained in step S121, enter mathematical operators or numbers, define parameter names and the relationship between parameter names and constants to form a custom formula, and define the formula description.

[0028] b. Select the text or annotation element in the large-scale drawing DWG template file to obtain the element array EntArr.

[0029] c. After selecting an object type name for each element in the element array EntArr, retrieve the object type information from the object type array obtained in step S122 based on the object type name;

[0030] d. Add custom extended data to each element in the element array EntArr. The custom extended data name is the extended data of the formula extended data PumpingFormualAppData, and the extended data content is the formula description && formula details && object type.

[0031] S125 Repeat steps S123-S124 until all the annotation elements and parameters or formulas that need to be modified in the dwg drawing file are associated, then save the drawing and generate a dwg drawing template file;

[0032] S126 compresses DWG drawing templates and Excel parameter templates to generate target detail drawing template files.

[0033] Preferably, obtaining the target Excel parameter template file in step S2 further includes the following steps:

[0034] S21 Obtain the large-scale drawing template file. The steps are as follows:

[0035] a. Open the folder corresponding to the project type in the large-scale drawing template library according to the current project type name;

[0036] b. Open the professional folder according to the professional type name of the required detailed drawing;

[0037] c. Search for the target detail drawing template file based on the name of the detail drawing. After decompressing the target detail drawing template file, you will obtain the target dwg drawing and the target Excel parameter template file.

[0038] S22 Modify the parameter values ​​in the target Excel parameter template file according to the actual needs of the project; find the target parameter name in the first column and the nth row of the target Excel parameter template file, and modify the mth parameter value in the second column corresponding to the nth row to the target parameter value corresponding to the target parameter name; if the current project does not need the mth parameter value, find the parameter name in the first column and the nth row corresponding to the mth parameter value in the target Excel parameter template file and delete it.

[0039] Preferably, modifying the target parameter value of the target detail drawing template file in step S2 to obtain the target detail drawing template file also includes expanding and improving the detail drawing template files in the detail drawing template library. If the required parameter information is not present in the current template file, the current detail drawing template file can be modified using the method in step S1, and the detail drawing template library can be updated after improving the parameter information.

[0040] If the required detailed drawing does not exist in the detailed drawing template library, create a suitable detailed drawing template through step S1 and add it to the detailed drawing template library to expand the library.

[0041] Preferably, in step S3, the target parameter information of the Excel in the target Excel parameter template file is read to obtain the target parameter group. The target parameter group is in the form of [{parameter name 1, parameter value 1}, {parameter name 2, parameter value 2}, ..., {parameter name 1}. m , parameter value m}], where m is the name and value of the m-th parameter in the target parameter information of Excel, and m>1.

[0042] Preferably, step S3, which involves traversing and opening all elements in the DWG drawing file to obtain extended data values, means traversing and opening all text or annotation elements in the target DWG drawing file to obtain all extended information. The obtained extended information includes an element named "Parameter Extended Data PumpingAppData" to obtain the target extended data value.

[0043] Preferably, in step S3, the object binding information is parsed to obtain the text or annotation element ObjId in the large-scale drawing dwg file; the target binding parameter array is obtained by obtaining the extended data value and then using string data rules to obtain parameter name && object type; the parameter name and object type of the object type binding are parsed to obtain the text or annotation element ObjId in the large-scale drawing dwg file; and the binding parameter array is obtained, wherein the target binding parameter array is [{parameter name1, object type, ObjId1}, ... {parameter name1, object type1 ... object type1, ObjId1}, ... {parameter name1, object type1, object type1, ObjId1}, ... {parameter name1, object type1, object type1, ObjId1}, ... {parameter name1, object type1, object type1, ObjId1}, ... {parameter name1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type1, object type n Object type, ObjId n The object type, represented as {N,D,U,C}, includes the type name, decimal place, unit, and whether unit conversion is required. ObjId represents the object ID, and n is the nth parameter name in the object binding information, the object type, and the text or annotation element ObjId in the large-scale drawing dwg file. n n is greater than or equal to 1, and n is any object in the bound formula array.

[0044] Preferably, in step S3, the parsed object binding information is inserted into an array to obtain the target bound formula array; this means traversing all elements in the opened DWG drawing file, obtaining all elements in the extended information that contain the name "Formula Extended Data PumpingFormualAppData", obtaining the extended data value, and then parsing it according to the string rules of formula description && formula details && object type to obtain the object type binding information. The object type binding information is formula description FD, formula details F, and object type T. The text or annotation element ObjId in the detailed drawing DWG file is obtained; the parsed object binding information is inserted into an array to obtain the target bound formula array. The target bound formula array format is [{FD1,F1,T1,ObjId1},…… ...T1},……{FD1,F1,T1},……{FD1,T1,T1},……{FD1,T1,T1},……{FD1,T n F n ,T n ,ObjId n The object type includes the type name, decimal place, unit, and whether unit conversion is required.

[0045] Preferably, in step S3, the target binding parameter array and target binding formula array obtained through iteration are used to obtain the object type information of the nth object and calculate the modification value FVR. Modifying the target drawing annotation and text element object refers to obtaining the nth binding parameter {parameter name n, object type, ObjId} from the obtained binding parameter array. n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the bound parameter name n of the bound parameter, search for the bound parameter name n in the target parameter list, and if the bound parameter name n does not exist in the target parameter list, delete the object with ID ObjId from the dwg drawing. n The element; if the target parameter name m obtained by the query is the same as the bound parameter name n, where m is greater than or equal to 1, and m is any object in the bound formula array, then the target parameter information is obtained, which is {parameter name m, parameter value m}, and the parameter value in the parameter information is obtained. m As the modified value PV;

[0046] Iterate through the target binding formula array to obtain the nth object {FD}. n F n ,T n ,ObjId n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the target parameter name n of the object, obtain the formula details Fn of the nth object type, parse the formula according to the addition, subtraction, multiplication, and division operators in the formula string, obtain the relationship between the target parameters and constants in the formula details Fn, look up the target parameter value from the target parameter list in the target parameter array, substitute the obtained target parameter value into the formula for calculation, and obtain the formula calculation result FV; obtain the object type information of the nth object, perform decimal rounding and unit conversion calculations on the modified value FV, obtain the modified value FVR after the calculation is completed, and obtain the object ID information ObjId of the nth object. n Modify the ID in the target dwg drawing to ObjId n After obtaining the element's type in the target DWG drawing, if the type is text, modify the text value to PVR; if the type is annotation, modify the annotation value to PVR. Here, FDn represents the formula description of the nth object, Fn represents the formula details of the nth object, Tn represents the object type of the nth object, and ObjId... n It is represented as the ID of the nth object.

[0047] This invention provides a method for reusing large-scale drawings based on ObjectArx, solving the problem of designers having to perform calculations based on Excel spreadsheets and manually modify them in AutoCAD in accordance with CAD drawings. This method utilizes AutoCAD technology to define CAD large-scale drawing template files to construct a large-scale drawing template library. Based on project design requirements, it quickly extracts large-scale drawing templates from the library, reads the target parameter information from the target Excel parameter template file to obtain the target parameter group, and parses the object type binding information according to string data rules to obtain the target bound parameter array and target bound formula array. It then iterates through the obtained target bound parameter array and target bound formula array to obtain the object type information of the nth object and calculates the modification value FVR. This modifies the target drawing annotations and text element objects, enabling rapid modification and reuse of drawings. This method is highly efficient, convenient, reliable, versatile, compatible, and widely applicable, fully replacing existing manual calculations and element searching processes, greatly improving design efficiency and reducing costs. Attached Figure Description

[0048] Figure 1 A flowchart of a large-scale image reuse method based on ObjectArx;

[0049] Figure 2 A flowchart illustrating an embodiment of a large-scale image reuse method based on ObjectArx;

[0050] Figure 3 This is a method for reusing large-scale images based on ObjectArx, and a process for creating a large-scale image template library.

[0051] Figure 4 This is a method for reusing large-scale drawings based on ObjectArx, and a process for creating large-scale drawing template files.

[0052] Figure 5 This is a large-scale image reuse method based on ObjectArx, and a large-scale image template extraction process.

[0053] Figure 6 This is a process for modifying large-scale drawing templates using a method for reusing large-scale drawings based on ObjectArx.

[0054] Figure 7 This is an example of a large-scale drawing template library directory, which is a method for reusing large-scale drawings based on ObjectArx. Detailed Implementation

[0055] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0056] This invention provides a method for reusing large-format images based on ObjectArx. The method, as described in this embodiment... Figure 1 As shown, the method includes the following steps:

[0057] This invention provides a method for reusing large-scale images based on ObjectArx, which includes the following steps:

[0058] S1: Define the Excel parameter file for the detailed drawing. Based on the ObjectARX detailed drawing template definition tool, bind the parameter names in the Excel parameter file to the elements in the dwg drawing through extended data. Define the detailed drawing template file and build a detailed drawing template library. The detailed drawing template library includes project type and professional type.

[0059] S2: Extract the detailed drawing template from the detailed drawing template library created in step S1 according to the project type and professional type as the target detailed drawing template file; modify the parameter values ​​of the Excel parameter template file according to the project requirements, obtain the target Excel parameter template file and the target DWG drawing file, modify the target parameter values ​​of the target detailed drawing template file, and obtain the target detailed drawing template file;

[0060] S3: Obtain the target detail drawing template file according to step S2. Use the ObjectARX-based detail drawing modification tool to read the target parameter information from the Excel parameter template file of the target Excel file to obtain the target parameter group. Iterate through all elements in the detail drawing DWG template file of the opened target DWG drawing file to obtain extended data values. Then, according to the string data rules, parse the information of object type binding to obtain the element ID in the detail drawing DWG template file; obtain the target binding parameter array; insert the parsed object binding information into the array to obtain the target binding formula array; iterate through the obtained target binding parameter array and target binding formula array to obtain the object type information of the nth object, and calculate the modification value FVR. Modify the annotation and text element objects of the target detail drawing template file to achieve drawing reuse; where n is greater than or equal to 1.

[0061] In one embodiment, step S1, which involves binding the parameter names in the defined detail drawing Excel parameter file with elements in a dwg drawing file via extended data, defining a detail drawing template file, and constructing a detail drawing template library, includes the following steps:

[0062] S11: Build a detailed drawing template library based on the FTP protocol. Create a project type folder in the root directory, and a professional type folder under each project folder. Name the defined detailed drawing template files according to the detailed drawing name and place them in the corresponding project type and professional type folders. Categorize and manage the detailed drawing templates. Quickly browse folders by project type and professional type to find the detailed drawing template files needed in the project. The detailed drawing template files include detailed drawing dwg drawing files and Excel parameter template files.

[0063] S12: Using the ObjectARX-based large-scale drawing template creation tool, the parameter information in the Excel parameter template file, or the custom formula and the annotation elements or text elements in the dwg drawing file are associated with the CAD software's own extended data xdata to finally generate a large-scale drawing dwg template file;

[0064] S13 packages and compresses the large-scale drawing dwg template file and the Excel parameter template file and places them into the corresponding project type and professional directory to form a large-scale drawing template library.

[0065] In one embodiment, step S12, which involves generating the final detailed drawing (dwg) template file, further includes the following steps:

[0066] S121 creates an Excel parameter template file based on the detailed drawing information. The Excel parameter template file contains two columns: parameter name and parameter value. The first column is the parameter name, and the second column is the parameter value. The Excel parameter template file is read to obtain the parameter name array.

[0067] S122 retrieves an array of object types. The steps are as follows:

[0068] a. Define the object type data XML configuration file

[0069] Configure the object type information for the parameter values ​​in the second column of the Excel parameter template file. The object type includes the type name N, decimal place D, unit U, and whether unit conversion is required C. This is configured through a plain text XML configuration file. N represents the type name (a string that can be arbitrarily defined); D represents the number of decimal places to retain (an integer); U represents the unit (a string defined as meters, decimeters, or millimeters); and C indicates whether unit conversion is required (an integer where 1 indicates unit conversion is required, and other values ​​indicate no unit conversion is needed).

[0070] b. Get an array of object types

[0071] Based on the defined object type data XML configuration file, obtain the object type array, which is: [{N1,D1,U1,C1},{N2,D2,U2,C2}.....{N n D n U n C n}]; where N1 in the object type array represents the first type name string, D1 is the parameter value corresponding to the first type name with decimal rounding, U1 represents the unit of the parameter value corresponding to the first type name, C1 represents whether the parameter value corresponding to the first type name needs to be calculated by unit conversion, and so on, Nn represents the nth type name string, Dn is the parameter value corresponding to the nth type name with decimal rounding, Un represents the unit of the parameter value corresponding to the nth type name, and Cn represents whether the parameter value corresponding to the nth type name needs to be calculated by unit conversion;

[0072] To add extended data to elements in the S123 large detail drawing dwg template file, follow these steps:

[0073] a. In step S121, select the parameter name from the parameter array.

[0074] b. Select the text or annotation element in the large-scale drawing DWG template file to obtain the element array EntArr.

[0075] c. After selecting an object type name for each element in the element array, retrieve the object type information from the object type array obtained in step S122 based on the object type name.

[0076] d. Add custom extended data to each element in the element array EntArr. The name of the custom extended data is the extended data of the parameter extended data PumpingAppData, and the content of the extended data is the parameter name && object type.

[0077] S124 Select the annotation or text element in the large-scale drawing dwg template file to add formula extended data;

[0078] a. Select parameter names from the parameter name array obtained in step S121, enter mathematical operators or numbers, define parameter names and the relationship between parameter names and constants to form a custom formula, and define the formula description.

[0079] b. Select the text or annotation element in the large-scale drawing DWG template file to obtain the element array EntArr.

[0080] c. After selecting an object type name for each element in the element array EntArr, retrieve the object type information from the object type array obtained in step S122 based on the object type name.

[0081] d. Add custom extended data to each element in the element array EntArr. The custom extended data name is the extended data of the formula extended data PumpingFormualAppData, and the extended data content is the formula description && formula details && object type.

[0082] S125 Repeat steps S123-S124 until all the annotation elements and parameters or formulas that need to be modified in the dwg drawing file are associated, then save the drawing and generate a dwg drawing template file;

[0083] S126 compresses DWG drawing templates and Excel parameter templates to generate target detail drawing template files.

[0084] In one embodiment, obtaining the target Excel parameter template file in step S2 further includes the following steps:

[0085] S21 Obtain the large-scale drawing template file. The steps are as follows:

[0086] a. Open the folder corresponding to the project type in the large-scale drawing template library according to the current project type name;

[0087] b. Open the professional folder according to the professional type name of the required detailed drawing;

[0088] c. Search for the target detail drawing template file based on the name of the detail drawing. After decompressing the target detail drawing template file, you will obtain the target dwg drawing and the target Excel parameter template file.

[0089] S22 Modify the parameter values ​​in the target Excel parameter template file according to the actual needs of the project; find the target parameter name in the first column and the nth row of the target Excel parameter template file, and modify the mth parameter value in the second column corresponding to the nth row to the target parameter value corresponding to the target parameter name; if the current project does not need the mth parameter value, find the parameter name in the first column and the nth row corresponding to the mth parameter value in the target Excel parameter template file and delete it.

[0090] In one embodiment, modifying the target parameter value of the target detail drawing template file in step S2 to obtain the target detail drawing template file also includes expanding and improving the detail drawing template files in the detail drawing template library. If the required parameter information is not present in the current template file, the current detail drawing template file can be modified using the method in step S1, and the detail drawing template library can be updated after the parameter information is improved.

[0091] If the required detailed drawing does not exist in the detailed drawing template library, create a suitable detailed drawing template through step S1 and add it to the detailed drawing template library to expand the library.

[0092] In one embodiment, step S3 reads the target parameter information from the target Excel parameter template file to obtain a target parameter group. The target parameter group is in the form of [{parameter name 1, parameter value 1}, {parameter name 2, parameter value 2}, ..., {parameter name 1}. m , parameter value m}], where m is the name and value of the m-th parameter in the target parameter information of Excel, and m>1.

[0093] Preferably, step S3, which involves traversing and opening all elements in the DWG drawing file to obtain extended data values, means traversing and opening all text or annotation elements in the target DWG drawing file to obtain all extended information. The obtained extended information includes an element named "Parameter Extended Data PumpingAppData" to obtain the target extended data value.

[0094] In one embodiment, step S3 involves parsing and obtaining the object binding information to obtain the text or annotation element ObjId from the large-scale drawing DWG file; obtaining the target binding parameter array, which is obtained by obtaining the extended data value and then using string data rules to specify the parameter name and object type; parsing and obtaining the parameter name and object type of the object type binding to obtain the text or annotation element ObjId from the large-scale drawing DWG file; and obtaining the binding parameter array, wherein the target binding parameter array is [{parameter name 1, object type, ObjId 1}, ... { ... n Object type, ObjId nThe object type, represented as {N,D,U,C}, includes the type name, decimal place, unit, and whether unit conversion is required. ObjId represents the object ID, and n is the nth parameter name in the object binding information, the object type, and the text or annotation element ObjId in the large-scale drawing dwg file. n n is greater than or equal to 1, and n is any object in the bound formula array.

[0095] In one embodiment, step S3 involves inserting the parsed object binding information into an array to obtain the target bound formula array. This means iterating through all elements in the opened DWG drawing file, obtaining all extended information containing elements named "Formula Extended Data PumpingFormualAppData," obtaining the extended data value, and parsing it according to the string rules of "Formula Description && Formula Details && Object Type" to obtain the object type binding information. The object type binding information is Formula Description FD, Formula Details F, and Object Type T. This also involves obtaining the text or annotation element ObjId from the detailed drawing DWG file. The parsed object binding information is then inserted into an array to obtain the target bound formula array, which has the format [{FD1,F1,T1,ObjId1},…… ...T1},……{FD1,T1,T1},……{FD1,T1,T1},……{FD1,T1,T1},……{FD1,T1,T1},……{FD1,T1},……{FD1 n F n ,T n ,ObjId n The object type includes the type name, decimal place, unit, and whether unit conversion is required.

[0096] In one embodiment, in step S3, the target binding parameter array and target binding formula array obtained through iteration are used to obtain the object type information of the nth object and calculate the modification value FVR. Modifying the target drawing annotation and text element object refers to obtaining the nth binding parameter {parameter name n, object type, ObjId} from the obtained binding parameter array. n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the bound parameter name n of the bound parameter, search for the bound parameter name n in the target parameter list, and if the bound parameter name n does not exist in the target parameter list, delete the object with ID ObjId from the dwg drawing. n The element; if the target parameter name m obtained by the query is the same as the bound parameter name n, where m is greater than or equal to 1, and m is any object in the bound formula array, then the target parameter information is obtained, which is {parameter name m, parameter value m}, and the parameter value in the parameter information is obtained. m As the modified value PV;

[0097] Iterate through the target binding formula array to obtain the nth object {FD}. n Fn ,T n ,ObjId n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the target parameter name n of the object, obtain the formula details Fn of the nth object type, parse the formula according to the addition, subtraction, multiplication, and division operators in the formula string, obtain the relationship between the target parameters and constants in the formula details Fn, look up the target parameter value from the target parameter list in the target parameter array, substitute the obtained target parameter value into the formula for calculation, and obtain the formula calculation result FV; obtain the object type information of the nth object, perform decimal rounding and unit conversion calculations on the modified value FV, obtain the modified value FVR after the calculation is completed, and obtain the object ID information ObjId of the nth object. n Modify the ID in the target dwg drawing to ObjId n After obtaining the element's type in the target DWG drawing, if the type is text, modify the text value to PVR; if the type is annotation, modify the annotation value to PVR. Here, FDn represents the formula description of the nth object, Fn represents the formula details of the nth object, Tn represents the object type of the nth object, and ObjId... n It is represented as the ID of the nth object.

[0098] This invention provides a method for reusing large-scale drawings based on ObjectArx, solving the problem of designers having to perform calculations based on Excel spreadsheets and manually modify them in AutoCAD in accordance with CAD drawings. This method utilizes AutoCAD technology to define CAD large-scale drawing template files to construct a large-scale drawing template library. Based on project design requirements, it quickly extracts large-scale drawing templates from the library, reads the target parameter information from the target Excel parameter template file to obtain the target parameter group, and parses the object type binding information according to string data rules to obtain the target bound parameter array and target bound formula array. It then iterates through the obtained target bound parameter array and target bound formula array to obtain the object type information of the nth object and calculates the modification value FVR. This modifies the target drawing annotations and text element objects, enabling rapid modification and reuse of drawings. This method is highly efficient, convenient, reliable, versatile, compatible, and widely applicable, fully replacing existing manual calculations and element searching processes, greatly improving design efficiency and reducing costs.

[0099] This invention provides a method for reusing large-scale images based on ObjectArx, such as... Figure 2 As shown, the specific steps are as follows:

[0100] S1: Building a large-scale drawing template library

[0101] Define the Excel parameter file for detailed drawings. The detailed drawing template definition tool, developed based on ObjectARX, binds the parameter names in the defined Excel parameter file to the annotations or text elements in the DWG drawing through extended data, defines the detailed drawing template file, and builds the detailed drawing template library.

[0102] S2: Modify parameter values ​​to expand and improve the large-scale drawing template library.

[0103] Extract detailed drawing templates from the detailed drawing template library created in step S1 according to the project type and professional type; modify the parameter values ​​in the Excel parameter template file in the template file according to the project requirements to obtain the target Excel parameter template file; expand and improve the detailed drawing template library according to the parameter matching.

[0104] S3: Complete the repair and reuse of detailed drawings.

[0105] Using the target detail drawing template file obtained through step S2, a quick detail drawing modification tool developed based on ObjectARX is used to read the parameter information in the Excel parameter template file. Based on the parameter information or formula information associated with the annotations or text elements in the DWG drawing, the annotation and text element objects are modified to achieve quick reuse of the drawing.

[0106] Step S1 also includes the following steps, such as Figure 3 As shown, the specific steps are as follows:

[0107] S11: Create a project type folder

[0108] A large-scale drawing template library is built based on the FTP protocol. Project type folders are created in the root directory, such as hydropower, pumped storage, wind power, and photovoltaic. Within each project folder, professional type folders are created, such as factory, geology, electrical, and environmental. Figure 7 As shown; after naming the defined and created detail drawing template files according to the detail drawing name, place them in the corresponding project and professional folders to classify and manage the detail drawing templates. Quickly browse the folders by project type name and professional type name to find the detail drawing template files needed in the project;

[0109] S12: Create a folder for a specific professional type

[0110] The detailed drawing template file includes a detailed drawing DWG drawing file and an Excel parameter template file. It uses a detailed drawing template creation tool developed based on ObjectARX technology to associate the parameters or custom formulas in the Excel parameter template file with the annotations or text elements in the DWG drawing file using CAD's own extended data xdata, and finally generate the detailed drawing DWG template file.

[0111] S13: Define where the detailed drawing files are placed in the corresponding project type and professional directory.

[0112] Package and compress the detailed drawing DWG template file and the Excel parameter template file, and place them in the corresponding project type and professional directory to form a detailed drawing template library.

[0113] like Figure 4 As shown, step S12 further includes:

[0114] S121 Get the parameter name array

[0115] a. Define the Excel parameter template file

[0116] Based on the detailed drawing information, create a parameter template file; as shown in Table 1, the parameter template file is an Excel file containing two columns: parameter name and parameter value; the first column is the parameter name, such as the normal water level of the upper reservoir (m), the dead water level of the upper reservoir (m), the normal water level of the lower reservoir (m), etc. The specific parameter name is determined according to the detailed drawing information; the second column is the parameter value; if the parameter value is a length, the default unit is meters (m).

[0117] Table 1 Example of parameter template

[0118]

[0119]

[0120] b. Read the Excel parameter template file to obtain an array of parameter names;

[0121] c. The parameter name array is {parameter name1, parameter name2, parameter name3, ..., parameter name}. n As shown in Table 1, the parameter template reading results are: {Upper reservoir normal water level (m), Upper reservoir dead water level (m), Lower reservoir normal water level... Bridge crane weight (t)}

[0122] S122 Get an array of object types

[0123] a. Define the object type data XML configuration file

[0124] Configure the object type information for the parameter values ​​in the second column of the Excel parameter template file (Configure Object Type Information). The object type includes the type name N, decimal place D, unit U, and whether unit conversion is required C. This is configured through an XML configuration file; the configuration information is shown below.

[0125]

[0126] Where N represents the "type name"; it is a string type and can be defined arbitrarily, such as elevation, station number, etc.

[0127] D indicates the number of decimal places to retain for the parameter value. It is an integer type. For example, a value of 2 means that 2 significant digits are retained, and a value of 0 means that no significant digits are retained.

[0128] U represents the unit, which is a string type and is defined as meters, millimeters, decimeters, etc.

[0129] C indicates whether unit conversion is required; it is an integer type, where 1 indicates that unit conversion is required, and other values ​​indicate that unit conversion is not required.

[0130] b. Read the object type data XML configuration file to obtain an array of object types. The array format is: [{N1,D1,U1,C1},{N2,D2,U2,C2}.....{N n D n U n C n As shown above, the object type configuration information is parsed as [{Elevation,2,m,1},{Text,0,0,0},{Station,2,m,1}].

[0131] S123 Select the annotation or text element in the Dwg drawing file and add extended data parameters.

[0132] a. Select the parameter name from the parameter array obtained in step S121.

[0133] b. Select the annotation or text element in the Dwg drawing file to obtain the element array EntArr

[0134] c. After selecting an object type name for each element in the element array, retrieve the object type information from the object type array obtained in step S122 based on the object type name.

[0135] d. Add custom extended data to each element in the element array EntArr. The custom extended data is named "PumpingAppData" (parameter extended data) and the extended data content is "parameter name && object type", such as "normal water level of upper reservoir (m) && elevation && 2 && m && 1".

[0136] S124 Select the annotation or text element in the large-scale drawing dwg template file, add formula extended data, select the parameter name from the parameter name array obtained in step S121, enter mathematical operators or numbers, define the parameter name and the relationship between the parameter name and constant to form a custom formula, and define the formula description.

[0137] a. Definition Formula

[0138] In the parameter name array obtained in step S121, select the parameter name, enter mathematical operators or numbers such as "+, -, *, / ", define the relationship between parameter names and constants to form a custom formula, and define the formula description; for example, the formula for defining the relationship between parameter names is "Upper Reservoir Normal Storage Level (m) - Upper Reservoir Dead Water Level (m)", and the formula description is "Water Level Difference"; or the formula for defining the relationship between parameter names and constants is "Upper Reservoir Normal Storage Level (m) - 200".

[0139] b. Select the text or annotation element in the large-scale drawing DWG template file to obtain the element array EntArr.

[0140] c. After selecting an object type name for each element in the element array EntArr, retrieve the object type information from the object type array obtained in step S122 based on the object type name.

[0141] d. Add custom extended data to each element in the element array EntArr. The custom extended data is named "PumpingFormualAppData" and its content is "Formula Description && Formula Details && Object Type", such as "Water Level Difference && Upper Reservoir Normal Storage Level (m) - Upper Reservoir Dead Water Level (m) && && 2 && m && 1".

[0142] S125 Repeat steps S123-S124 to create a DWG drawing file.

[0143] Once all the necessary annotation elements and parameters or formulas in the DWG drawing file have been associated, save the drawing and generate a DWG drawing template file.

[0144] S126 generates a large-scale drawing template file.

[0145] Compress the DWG drawing template and Excel parameter template to generate a detailed drawing template file.

[0146] Step S2 also includes the following steps, such as Figure 5 As shown:

[0147] S21 Obtain the detailed drawing template file

[0148] a. Open the folder corresponding to the project type in the large detail drawing template library according to the current project type name.

[0149] b. Open the professional folder according to the professional type name of the required detailed drawing.

[0150] c. Search for the detailed drawing template file by name, and after decompressing the detailed drawing template file, obtain the dwg drawing and Excel parameter template file;

[0151] S22 Modify Parameter Template File

[0152] Modify the parameter values ​​in the parameter template file according to the actual needs of the project; taking the parameter "installed capacity" as an example, if the value of the parameter "installed capacity" in the current project is 1200, then find the row with the value "installed capacity" in the first column in the Excel parameter file, and then modify the value in the second column of that row to 1200;

[0153] If the current project does not need this parameter, then find the row in the first column of the Excel parameter file where the value is "installed capacity" and delete that row.

[0154] S23 expands and improves the large-scale drawing template library.

[0155] a. If the required parameter information is not present in the current template file, you can modify the current large-scale drawing template file using the method in step S1, complete the parameter information, and then update the large-scale drawing template library.

[0156] b. If the required detailed drawing does not exist in the detailed drawing template library, create a suitable detailed drawing template through step S1 and add it to the detailed drawing template library to expand the library.

[0157] Step S3 also includes the following steps, such as Figure 6 As shown:

[0158] S31 Open the drawing and obtain the parameter array.

[0159] a. Open the large-scale drawing template Dwg drawing file obtained from step S2 in CAD;

[0160] b. Read the Excel parameter template file to obtain the parameter array;

[0161] c. The parameter array is [{parameter name 1, parameter value 1}, {parameter name 2, parameter value 2}...{parameter name...} m , parameter value m As shown in Table 1, the parameter template reading results are: [{Upper Reservoir Normal Water Level (m), 1277}, {Upper Reservoir Dead Water Level (m), 1241}, {Lower Reservoir Normal Water Level, 776}……{Bridge Crane Weight (t), 265}]

[0162] S32 reads the parameter extended data array and modifies the text or annotation elements in the large-scale drawing (dwg) file.

[0163] a. Traverse all elements in the opened DWG drawing file, obtain all elements whose extended information contains the name "PumpingAppData" (parameter extended data). After obtaining the extended data value, parse it according to the string data rule "parameter name && object type" to obtain the parameter name and object type bound to the object, and obtain the text or annotation element ObjId in the detail drawing DWG file; obtain the bound parameter array, the array format is [{parameter name 1, object type, ObjId 1}, ... {parameter name 1}, ..., ... n Object type, ObjId n The object type includes the type name, decimal place, unit, and whether unit conversion is required, represented as {N,D,U,C}, and ObjId represents the object ID;

[0164] b. Iterate through the obtained array of bound parameters and retrieve the nth bound parameter {parameter name}. n Object type, ObjId n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the parameter name "parameter name n" of the object, search for the parameter with the parameter name "parameter name n" in the parameter list obtained in step S31, if the parameter with the parameter name "parameter name n" does not exist in the parameter list, then delete the parameter with ID ObjId in the dwg drawing. n The element; if the m-th parameter name in the parameter list obtained by the query is the same as "parameter name n", where m is greater than or equal to 1 and less than or equal to the length of the parameter array, then obtain the current parameter information {parameter name m, parameter value m}, and obtain the parameter value m in the parameter information as the modification value PV;

[0165] c. Obtain the object type information of the nth object, perform decimal and unit conversion calculations on the modification value PV, and obtain the modification value PVR after the calculation. Then, obtain the object ID information ObjId of the nth object. n Modify the ID in the DWG drawing to ObjId n After obtaining the element's type in CAD, if the type is text, modify the text value to PVR; if the type is annotation, modify the annotation value to PVR. For example, if the current type information is {N="Elevation", D="2", U="meter", C="1"}, it means that the current element type is elevation, and unit conversion is required. Convert the unit to millimeters to meters, and keep two significant figures in the final result. For example, if the parameter "Upper Reservoir Normal Water Level (m)" has a value of 1277, the calculation process is 1277 / 100, and the value after keeping two figures is 12.77.

[0166] S33 reads the extended data array of the formula and modifies the text or annotation elements in the detailed drawing dwg file.

[0167] a. Traverse all elements in the opened DWG drawing file, obtaining all elements in the extended information containing the name "PumpingFormualAppData" (formula extended data). After obtaining the extended data value, parse it according to the string rule "formula description && formula details && object type" to obtain the object binding information: formula description FD, formula details F, object type T, and obtain the text or annotation element ObjId in the detail drawing DWG file; insert the parsed object binding information into an array to obtain the bound formula array, with the array format [{FD1,F1,T1,ObjId1},……{FD n F n ,T n ,ObjId n The object type includes the type name, decimal place value, unit, and whether unit conversion is required.

[0168] b. Iterate through the array of bound formulas to obtain the nth object {FD}. n F n ,T n ,ObjId n}, where n is greater than or equal to 1, and n is any object in the bound formula array; obtain the parameter name "parameter name n" of the object, and get the formula details F of the nth object. n The formula is parsed based on the addition, subtraction, multiplication, and division operators in the formula string to obtain the relationships between parameters and constants in the formula details Fn. Then, the parameter values ​​are retrieved from the parameter list obtained in step S31 based on the parsed parameter information. After substituting the obtained parameter values ​​into the formula for calculation, the formula calculation result FV is obtained. For example, the formula "Upper Reservoir Normal Water Level (m) - Upper Reservoir Dead Water Level (m)" is parsed to obtain the parameter "Upper Reservoir Normal Water Level (m)" minus the parameter "Upper Reservoir Dead Water Level (m)". The parameter list obtained in step S31 is retrieved to obtain the parameter value of "Upper Reservoir Normal Water Level (m)" as 1277 and the parameter value of "Upper Reservoir Dead Water Level (m)" as 1241. The final FV = 1277 - 1241 = 36.

[0169] c. Obtain the object type information of the nth object, perform decimal and unit conversion calculations on the modified value FV, and obtain the modified value FVR. Then, obtain the object ID information ObjId of the nth object. n Modify the ID in the DWG drawing to ObjId n After obtaining the element's type in the target DWG drawing, if the type is text, modify the text value to PVR; if the type is annotation, modify the annotation value to PVR.

[0170] This invention provides a method for reusing large-scale drawings based on ObjectArx, solving the problem of designers having to perform calculations based on Excel spreadsheets and manually modify them in AutoCAD in accordance with CAD drawings. This method utilizes AutoCAD technology to define CAD large-scale drawing template files to construct a large-scale drawing template library. Based on project design requirements, it quickly extracts large-scale drawing templates from the library, reads the target parameter information from the target Excel parameter template file to obtain the target parameter group, and parses the object type binding information according to string data rules to obtain the target bound parameter array and target bound formula array. It then iterates through the obtained target bound parameter array and target bound formula array to obtain the object type information of the nth object and calculates the modification value FVR. This modifies the target drawing annotations and text element objects, enabling rapid modification and reuse of drawings. This method is highly efficient, convenient, reliable, versatile, compatible, and widely applicable, fully replacing existing manual calculations and element searching processes, greatly improving design efficiency and reducing costs.

Claims

1. A method for reusing large-scale images based on ObjectArx, characterized in that, The method includes the following steps: S1: Define the Excel parameter file for the detailed drawing. Based on the ObjectARX detailed drawing template definition tool, bind the parameter names in the Excel parameter file to the elements in the dwg drawing through extended data. Define the detailed drawing template file and build a detailed drawing template library. The detailed drawing template library includes project type and professional type. S2: Extract the detailed drawing template from the detailed drawing template library created in step S1 according to the project type and professional type as the target detailed drawing template file; modify the parameter values ​​of the Excel parameter template file according to the project requirements, obtain the target Excel parameter template file and the target DWG drawing file, modify the target parameter values ​​of the target detailed drawing template file, and obtain the target detailed drawing template file; S3: Obtain the target detail drawing template file according to step S2, use the ObjectARX-based detail drawing modification tool to read the target parameter information in the target Excel parameter template file to obtain the target parameter group, and traverse all elements in the detail drawing dwg template file of the opened target dwg drawing file to obtain the extended data value; Then, based on the string data rules, the information on object type binding is parsed to obtain the element ID in the large-format dwg template file; Obtain the target binding parameter array; insert the parsed object binding information into the array to obtain the target binding formula array; traverse the obtained target binding parameter array and target binding formula array, obtain the object type information of the nth object, calculate the modification value FVR, modify the annotation and text element objects of the target detail drawing template file, and realize drawing reuse; where n is greater than or equal to 1.

2. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, Step S1, which involves binding the parameter names in the defined detail drawing Excel parameter file with the elements in the dwg drawing file via extended data, defining the detail drawing template file, and building the detail drawing template library, includes the following steps: S11: Build a detailed drawing template library based on the FTP protocol. Create a project type folder in the root directory, and a professional type folder under each project folder. Name the defined detailed drawing template files according to the detailed drawing name and place them in the corresponding project type and professional type folders. Categorize and manage the detailed drawing templates. Quickly browse folders by project type and professional type to find the detailed drawing template files needed in the project. The detailed drawing template files include detailed drawing dwg drawing files and Excel parameter template files. S12: Using the ObjectARX-based large-scale drawing template creation tool, the parameter information in the Excel parameter template file, or the custom formula and the annotation elements or text elements in the dwg drawing file are associated with the CAD software's own extended data xdata to finally generate a large-scale drawing dwg template file; S13 packages and compresses the large-scale drawing dwg template file and the Excel parameter template file and places them into the corresponding project type and professional directory to form a large-scale drawing template library.

3. The method for reusing large-scale images based on ObjectArx according to claim 2, characterized in that, The final step of generating the detailed drawing dwg template file in step S12 also includes the following steps: S121 creates an Excel parameter template file based on the detailed drawing information. The Excel parameter template file contains two columns: parameter name and parameter value. The first column is the parameter name, and the second column is the parameter value. The Excel parameter template file is read to obtain the parameter name array. S122 retrieves an array of object types. The steps are as follows: a. Define the object type data XML configuration file Configure the object type information for the parameter values ​​in the second column of the Excel parameter template file. The object type includes the type name N, decimal place D, unit U, and whether unit conversion is required C. This is configured through a plain text XML configuration file. N represents the type name (a string that can be arbitrarily defined); D represents the number of decimal places to retain (an integer); U represents the unit (a string defined as meters, decimeters, or millimeters); and C indicates whether unit conversion is required (an integer where 1 indicates unit conversion is required, and other values ​​indicate no unit conversion is needed). b. Get an array of object types Based on the defined object type data XML configuration file, obtain the object type array, which is: [{N1,D1,U1,C1},{N2,D2,U2,C2}….{N n D n U n C n }]; where N1 in the object type array represents the first type name string, D1 is the parameter value corresponding to the first type name with decimal rounding, U1 represents the unit of the parameter value corresponding to the first type name, C1 represents whether the parameter value corresponding to the first type name needs to be calculated by unit conversion, and so on, Nn represents the nth type name string, Dn is the parameter value corresponding to the nth type name with decimal rounding, Un represents the unit of the parameter value corresponding to the nth type name, and Cn represents whether the parameter value corresponding to the nth type name needs to be calculated by unit conversion; To add extended data to elements in the S123 large detail drawing dwg template file, follow these steps: a. Select the parameter name from the parameter array obtained in step S121; b. Select the text or annotation element in the large-scale drawing dwg template file to obtain the element array EntArr; c. After selecting an object type name for each element in the element array, obtain the object type information from the object type array obtained in step S122 based on the object type name; d. Add custom extended data to each element in the element array EntArr. The name of the custom extended data is the extended data of the parameter extended data PumpingAppData, and the content of the extended data is the parameter name && object type. S124 Select the annotation or text element in the large-scale drawing dwg template file to add formula extended data; a. Select parameter names from the parameter name array obtained in step S121, enter mathematical operators or numbers, define parameter names and the relationship between parameter names and constants to form a custom formula, and define the formula description. b. Select the text or annotation element in the large-scale drawing dwg template file to obtain the element array EntArr; c. After selecting an object type name for each element in the element array EntArr, retrieve the object type information from the object type array obtained in step S122 based on the object type name; d. Add custom extended data to each element in the element array EntArr. The custom extended data name is the extended data of the formula extended data PumpingFormualAppData, and the extended data content is the formula description && formula details && object type. S125 Repeat steps S123-S124 until all the annotation elements and parameters or formulas that need to be modified in the dwg drawing file are associated, then save the drawing and generate a dwg drawing template file; S126 compresses DWG drawing templates and Excel parameter templates to generate target detail drawing template files.

4. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, Step S2, obtaining the target Excel parameter template file, also includes the following steps: S21 Obtain the large-scale drawing template file. The steps are as follows: a. Open the folder corresponding to the project type in the large-scale drawing template library according to the current project type name; b. Open the professional folder according to the professional type name of the required detailed drawing; c. Search for the target detail drawing template file based on the name of the detail drawing. After decompressing the target detail drawing template file, you will obtain the target dwg drawing and the target Excel parameter template file. S22 Modify the parameter values ​​in the target Excel parameter template file according to the actual needs of the project; find the target parameter name in the first column and the nth row of the target Excel parameter template file, and modify the mth parameter value in the second column corresponding to the nth row to the target parameter value corresponding to the target parameter name; if the current project does not need the mth parameter value, find the parameter name in the first column and the nth row corresponding to the mth parameter value in the target Excel parameter template file and delete it.

5. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, Step S2 involves modifying the target parameter values ​​in the target detail drawing template file to obtain the target detail drawing template file. It also includes expanding and improving the detail drawing template files in the detail drawing template library. If the required parameter information is not present in the current template file, the current detail drawing template file can be modified using the method in step S1. After improving the parameter information, the detail drawing template library can be updated. If the required detailed drawing does not exist in the detailed drawing template library, create a suitable detailed drawing template through step S1 and add it to the detailed drawing template library to expand the library.

6. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, In step S3, the target parameter information of the Excel in the target Excel parameter template file is read to obtain the target parameter group. The target parameter group is in the form of [{parameter name 1, parameter value 1}, {parameter name 2, parameter value 2}, ..., {parameter name m, parameter value m}], where m is the m-th parameter name and parameter value in the target parameter information of the Excel, and m > 1.

7. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, In step S3, traversing and opening all elements in the DWG drawing file to obtain extended data values ​​means traversing and opening all text or annotation elements in the target DWG drawing file to obtain all extended information. The obtained extended information includes the element named "Parameter Extended Data PumpingAppData" to obtain the target extended data value.

8. The method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, In step S3, parsing obtains the object binding information, including the text or annotation element ObjId from the detailed drawing DWG file; obtaining the target binding parameter array, which refers to obtaining the parameter name and object type according to string data rules after obtaining the extended data value; parsing obtains the parameter name and object type of the object type binding, and the text or annotation element ObjId from the detailed drawing DWG file; obtaining the binding parameter array, wherein the target binding parameter array is [{parameter name 1, object type, ObjId 1}, ..., {parameter name n, object type, ObjId n}, where the object type includes the type name, decimal place, unit, and whether unit conversion is required, represented as {N, D, U, C}, ObjId represents the object ID, and n is the nth parameter name, object type, and text or annotation element ObjId in the detailed drawing DWG file in the object binding information. n n is greater than or equal to 1, and n is any object in the bound formula array.

9. A method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, In step S3, the parsed object binding information is inserted into an array to obtain the target bound formula array. This involves traversing all elements in the opened DWG drawing file, obtaining all elements in the extended information that contain the name "PumpingFormualAppData". After obtaining the extended data value, it is parsed according to the string rules of formula description, formula details, and object type to obtain the object type binding information. The object type binding information is formula description (FD), formula details (F), and object type (T). The text or annotation element ObjId in the detail drawing DWG file is obtained. The parsed object binding information is then inserted into an array to obtain the target bound formula array. The target bound formula array format is [{FD1,F1,T1,ObjId1},……{FDn Fn,Tn,Obj Idn}]. The object type includes the type name, decimal place, unit, and whether unit conversion is required.

10. A method for reusing large-scale images based on ObjectArx according to claim 1, characterized in that, In step S3, the target binding parameter array and target binding formula array are traversed to obtain the object type information of the nth object and calculate the modification value FVR. Modifying the target drawing annotation and text element object refers to obtaining the nth binding parameter {parameter name n, object type, ObjIdn} from the traversed binding parameter array, where n is greater than or equal to 1 and n is any object in the binding formula array; the binding parameter name n of the binding parameter is obtained, and the binding parameter name n is searched in the target parameter list. If the binding parameter name n does not exist in the target parameter list, the element with ID ObjIdn in the dwg drawing is deleted. If the target parameter name m obtained from the query is the same as the bound parameter name n, where m is greater than or equal to 1 and m is any object in the bound formula array, then the target parameter information is obtained. The target parameter information is {parameter name m, parameter value m}, and the parameter value m in the parameter information is used as the modified value PV. Traverse the obtained target bound formula array to obtain the nth object {FDn Fn,Tn,ObjIdn}, where n is greater than or equal to 1 and n is any object in the bound formula array; obtain the target parameter name n of the object, obtain the formula details Fn of the nth object type, parse the formula according to the addition, subtraction, multiplication and division operators in the formula string, obtain the relationship between target parameters and constants in the formula details Fn, look up the target parameter value from the target parameter list in the target parameter array, and use the obtained target parameter value to substitute into the formula for calculation to obtain the formula calculation result FV; Obtain the object type information of the nth object, perform decimal and unit conversion calculations on the modification value FV, and obtain the modification value FVR. Then, obtain the object ID information ObjId of the nth object. n Modify the ID in the target dwg drawing to ObjId n After obtaining the element's type in the target DWG drawing, if the type is text, modify the text value to PVR; if the type is annotation, modify the annotation value to PVR. Here, FDn represents the formula description of the nth object, Fn represents the formula details of the nth object, Tn represents the object type of the nth object, and ObjId... n It is represented as the ID of the nth object.

Citation Information

Patent Citations

  • Method for extracting Excel table content to CAD table

    CN109933765A

  • CAD drawing analysis and display method and equipment CAD drawing electronic informatization method

    CN115495416A