CAD stratigraphic histogram drawing method
By combining row-column transposition, AutoLISP code generation and layer management methods in Excel and AutoCAD, the problem of time-consuming and labor-intensive and high error rate of manual drawing of CAD formation bar chart is solved, and efficient and accurate drawing is achieved.
Patent Information
- Application Number
- CN202510259914.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-15
AI Technical Summary
Manually drawing CAD formation histograms is time-consuming and labor-intensive and has a high error rate.
By performing row-column transposition operations and font orientation adjustment in Excel, the processed data is imported into AutoCAD, and the unit width is extracted using AutoLISP, combined with COUNTIF function and conditional format to verify uniqueness, generate an AutoLISP code sequence to replace the unit width as the thickness value, perform rotation, scale and layered locking to convert the unit width as the row height.
The drawing efficiency has been significantly improved. The original work that took 3-5 days can now be completed within 2 hours, with the efficiency being improved by more than 40 times, and the human operation error rate has been reduced to less than 0.3%, meeting the consistency of drawings generated by different scales.
Smart Images

Figure CN119830378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geological exploration technology, and in particular to a CAD stratigraphic columnar diagram drawing method. Background Art
[0002] In the field of geological exploration technology, it is often necessary to draw geological column charts based on the stratigraphic data collected on-site. The work content is to draw the stratigraphic data in the Excel table into a CAD stratigraphic column chart, which mainly includes drawing the depth in the CAD table (that is, the row height of the row where the thickness is located) according to the thickness in the stratigraphic data in the Excel table.
[0003] In the related art, the row height is manually drawn row by row in CAD according to the thickness corresponding to each row, so as to draw a CAD stratigraphic column chart.
[0004] However, manual drawing of CAD stratigraphic columns is time-consuming, labor-intensive and has a high error rate.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The present application provides a CAD stratigraphic column drawing method, which at least to some extent solves the problem that manual drawing of CAD stratigraphic column drawings is time-consuming, labor-intensive and has a high error rate.
[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0008] According to one aspect of the present application, a CAD stratigraphic column drawing method is provided, comprising: performing a row-column transposition operation on stratigraphic data in Excel, and adjusting the font direction to match the drawing of the row height, wherein the stratigraphic data includes the thickness value of the rock layer; setting the unit precision to two decimal places in AutoCAD, and importing the processed Excel table as an AutoCAD graphic element to obtain a CAD table; extracting the cell width in the CAD table through AutoLISP, and importing it into Excel to verify the uniqueness of each cell width using the COUNTIF function combined with conditional formatting; if the uniqueness verification fails, modifying the non-unique cell width in AutoCAD and Excel until the uniqueness verification passes; if the uniqueness verification passes, constructing a formula in Excel to generate an AutoLISP code sequence; importing the AutoLISP code sequence into the AutoCAD command line for execution, and replacing the cell width with the corresponding thickness value; rotating and scaling the modified CAD table, and then locking it in layers, and visually adjusting it through layer management to convert the cell width into cell row height.
[0009] The workload of adjusting the traditional table line by line is compressed to seconds. After testing and comparison, the drawings that originally took 3-5 days to complete can now be completed within 2 hours, and the efficiency is improved by more than 40 times. In addition, the human operation error rate is reduced from the industry average of 12% to less than 0.3%, especially for the two decimal places of rock thickness value. The control is achieved at the millimeter level.
[0010] Furthermore, the consistency of the generation of drawings of different scales (1:200 to 1:1000) is ensured to meet the requirements of GB / T 958-2015 geological map preparation specification.
[0011] In some embodiments, the operation of transposing rows and columns of stratigraphic data in Excel and adjusting the font direction to match the drawing of row height includes: using CTRL+ALT+V to transpose and paste; eliminating cell formulas to retain the plain text format; setting the text direction to match the drawing of row height.
[0012] In some embodiments, the cell width in the CAD table is extracted by AutoLISP, and imported into Excel to verify the uniqueness of each cell width by using the COUNTIF function combined with conditional formatting, including: extracting the specified point pair including the cell width by the (NTH n(ENTGET(entlast))) function; using the CDR function to obtain the value on the right side of the point pair to obtain the cell width; establishing a duplicate value detection formula in Excel based on the COUNTIF function; applying conditional formatting in Excel to highlight the cells where the duplicate cell widths are located; returning to CAD to correct the duplicate cell widths until the verification is passed, and the verification is passed when there are no duplicate cell widths.
[0013] The COUNTIF function and conditional formatting are used together to greatly reduce the omission rate of duplicate values. A CAD-Excel two-way verification channel is established to shorten the time for locating abnormal data, and online modification is supported while keeping the CAD table structure unchanged, avoiding the format misalignment problem caused by re-importing in the traditional way. The automation of the verification process reduces the workload of manual review, especially when processing multiple rows of data.
[0014] In some embodiments, the amplifying the thickness value of the rock formation by mathematical operation includes: when it is detected that the thickness value of the rock formation is less than the AutoCAD minimum unit threshold, triggering an amplification program to amplify the thickness value of the rock formation by a preset multiple.
[0015] By intelligently detecting the thickness of the rock layer and the minimum unit threshold of CAD, the preset multiple method is automatically selected to solve the display abnormality problem caused by too small values in traditional methods. It supports the setting of custom preset multiples and can adapt to different industry standards (such as the 1:500 standard for oil exploration and the 1:200 standard for mineral exploration).
[0016] In some embodiments, constructing a string concatenation formula in Excel to automatically generate a SETQ (SetQuote) statement sequence and an ENTMOD (Entity Modify) instruction includes: establishing a mapping relationship between the point pair sequence number corresponding to the cell width and the table row number; constructing a string concatenation formula in Excel to automatically generate a replacement statement in the format of (SETQ OLD(NTH n(ENTGET(entlast)))NEW(xy)), and generating a matching execution instruction (ENTMOD(SUBST NEW OLD(ENTGET(entlast))), where (xy) is the point pair corresponding to the point pair sequence number; constructing the AutoLISP code sequence according to the SETQ statement sequence and the ENTMOD instruction includes: concatenating the SETQ statement sequence and the ENTMOD instruction through an operator & to generate a complete code segment.
[0017] Traditionally, it takes a lot of time to manually write multiple lines of LISP code. This solution can automatically generate it in a short time, greatly improving efficiency. By formulating code templates, the syntax error rate is reduced.
[0018] In some embodiments, the layered locking includes a dual-layer processing mechanism; the dual-layer processing mechanism includes: copying the rotated and scaled CAD table into two layers, the two layers including an original layer and a working layer; overlaying and aligning the two layers; locking the original layer; adjusting the text format in the table and / or setting the layer color and / or table height in the working layer, and decomposing the adjusted table.
[0019] The locking mechanism of the original layer reduces the risk of accidental operation.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flow chart of a method for drawing a CAD stratigraphic column chart in one embodiment of the present application is shown;
[0023] Figure 2A schematic diagram showing the row and column transposition of formation data in one embodiment of the present application;
[0024] Figure 3 A schematic diagram showing precision setting and CAD primitive import in one embodiment of the present application;
[0025] Figure 4 A schematic diagram showing point pair information in one embodiment of the present application;
[0026] Figure 5 A schematic diagram showing a method of verifying uniqueness using the COUNTIF function in one embodiment of the present application is shown;
[0027] Figure 6 A schematic diagram showing the generation of an AutoLISP code sequence according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0029] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and thus their repeated description will be omitted.
[0030] like Figure 1 As shown, a CAD stratigraphic columnar diagram drawing method in one embodiment of the present application may include S11 to S17.
[0031] S11, performing a row-column transposition operation on the stratigraphic data in Excel, and adjusting the font direction to match the drawing of the row height, the stratigraphic data including the thickness value of the rock layer.
[0032] The embodiments of the present application do not restrict what other data the stratigraphic data may include besides the thickness of the rock layers.
[0033] Stratigraphic data is data detected after geological exploration and used to describe stratigraphic information. For example, stratigraphic data includes the thickness value of rock formations, the depth of rock formations, etc.
[0034] In one embodiment, CTRL+ALT+V is used to perform transposed pasting; cell formulas are eliminated to retain the plain text format; and the text direction is set to match the drawing of the row height.
[0035] like Figure 2 As shown, Figure 2 The yellow area 21 in the middle is the stratigraphic data in Excel. After transposing the stratigraphic data, the green area 22 is obtained.
[0036] Still Figure 2 For example, the operation in EXCEL is as follows: hold down the shift key to select the yellow area 21 and copy the area table. Then select other blank spaces in the table ( Figure 2 Select cell G1 here), click CTRL+ALT+V to select "Paste Special", generate the format of green area 22, and swap the "row height" and "column width" of the table.
[0037] The adjustment of the font direction is performed on the basis of the transposed stratum data, for example, the text direction is adjusted for the stratum data corresponding to the green area 22. For example, the adjustment direction is to rotate the text 90 degrees counterclockwise.
[0038] The purpose of adjusting the text direction is to match the drawing of the line height. According to the adaptive drawing rules, the rotation direction and angle of the text can be adjusted.
[0039] S12, setting the unit precision to two decimal places in AutoCAD, and importing the processed Excel table as an AutoCAD primitive to obtain a CAD table.
[0040] In AutoCAD, set the unit precision to two decimal places and import the processed Excel table as an AutoCAD primitive. Figure 3 As shown, first set the unit precision in the graphic unit in AutoCAD as indicated in area 31, perform the selective paste operation as indicated in area 32 in the blank space of the page opened in AutoCAD, and then import the Excel table in the form of AutoCAD graphics as indicated in area 33.
[0041] S13, extracting the cell width in the CAD table through AutoLISP, and importing it into Excel to use the COUNTIF function combined with conditional formatting to verify the uniqueness of each cell width.
[0042] In one embodiment, before extracting the cell width in the CAD table through AutoLISP, the method further includes: setting the text height, horizontal cell margin, vertical cell margin and cell height in the CAD table.
[0043] For example, set the text height, horizontal cell margin, and vertical cell margin to 0.0001, and set the values of these three parameters to be smaller, so as to avoid the phenomenon of garbled characters when the font is too large and collides with the table margin when adjusting the cell. For example, modify the cell height to 500, and make the cell as large as possible, so as to leave enough space for the font in the cell to move.
[0044] In one embodiment, extracting the cell width in the CAD table through AutoLISP may include: extracting the specified point pair including the cell width through the (NTH n(ENTGET(entlast))) function; obtaining the right value of the point pair using the CDR function to obtain the cell width; establishing a duplicate value detection formula in Excel based on the COUNTIF function; applying conditional formatting in Excel to highlight the cells where the duplicate cell widths are located; returning to CAD to correct the duplicate cell widths until verification is passed, and the verification is passed when there are no duplicate cell widths.
[0045] In the AutoCAD command line, use the command (ENTGET(entlast)) to view the entire entity information, determine the serial numbers of multiple point pairs representing the unit width, and construct the AutoLISP extraction code (NTH n(ENTGET(entlast))) for extracting the unit width based on the needs of the multiple point pairs to extract the unit width in the CAD table.
[0046] like Figure 4 As shown, the point pairs in the area 41 corresponding to the blue lines in the primitive represent the height of the cells (a row of cells has the same height), and the point pairs in the area 42 corresponding to the red lines represent the width of the cells (a column of cells has the same width).
[0047] For cell A3, the specific information can be shown as the content in area 43. It can be seen that the cell width of cell A3 is 26.2833 and the cell height is 18.
[0048] It should be noted that, due to the operation in S11, after adjusting the width of the cell in AutoCAD, the row height can be adjusted by transposing each cell.
[0049] Based on the information of the entire primitive, we can determine which pairs of points represent the width of the cell. Figure 4 Among the point pairs shown, the point pairs in the area 42 corresponding to the red line represent the width of the cell. Starting from the first point pair, the sequence numbers of the multiple point pairs of the cell width are 39-47.
[0050] By observing that the cell width is the first value on the right in the point pair, the constructed AutoLISP extraction code can be as follows.
[0051] (NTH 39(ENTGET(entlast)))~(NTH 47(ENTGET(entlast)));
[0052] (CDR(NTH 39(ENTGET(entlast))));
[0053] (CDR(NTH 40(ENTGET(entlast))));
[0054] (CDR(NTH 41(ENTGET(entlast))));
[0055] (CDR(NTH 42(ENTGET(entlast))));
[0056] (CDR(NTH 43(ENTGET(entlast))));
[0057] (CDR(NTH 44(ENTGET(entlast))));
[0058] (CDR(NTH 45(ENTGET(entlast))));
[0059] (CDR(NTH 46(ENTGET(entlast))));
[0060] (CDR(NTH 47(ENTGET(entlast))));
[0061] TEXTSCR.
[0062] Among them, entlast is an AutoCAD LISP function, which is used to return the name (or entity ID) of the last graphic object created or selected in the database.
[0063] ENTGET is a LISP function used to get all the attributes or data of a specified graphic object (by its name or ID). These data are returned in the form of a list, and each element of the list contains different information about the object, such as type, position, color, etc.
[0064] NTH is a LISP function that is used to get the element at a specific position from a list.
[0065] 39-47 are the positional index parameters of the NTH function.
[0066] The CDR function is used to return the rest of a list (except the first element).
[0067] (NTH 39(ENTGET(entlast))) means: get the 39th attribute of the graphic object selected on the drawing.
[0068] (CDR(NTH 39(ENTGET(entlast)))) means: get the cell width in the 39th attribute.
[0069] Enter (NTH 39(ENTGET(entlast))) to (NTH 47(ENTGET(entlast))) in the AutoCAD command line to extract 39-47 point pairs.
[0070] Then, through (CDR(NTH 39(ENTGET(entlast))))~(CDR(NTH 47(ENTGET(entlast)))), the extraction of the unit width in the CAD table is completed.
[0071] It should be noted that in Figure 4 In the example shown, the point pair numbers corresponding to the cell width are 39-47, while for other tables, they need to be determined based on the actual CAD element information.
[0072] like Figure 5 As shown, enter the return value of CAD into column A of the Excel table. The formula of column B of the Excel table is as follows: =COUNTIF(A1:A9, A1:A9) (It should be noted that Figure 5 The cell widths in the table shown are in column A (A1:A9), so the value written in the COUNTIF function is (A1:A9). Filter the number of times the width value appears in each column of the table. The numbers in column B represent the number of times the values in column A appear.
[0073] like Figure 5 As shown in area 51 in the Excel table, in the following operations: select column B (the column where the cell width occurs times) / Start / Style / Conditional Formatting / Highlight Cell Rules / Greater Than / 1 to complete the setting of highlighting the repeated cell widths.
[0074] Among them, the cell widths corresponding to the highlighted cells are not unique.
[0075] The COUNTIF function and conditional formatting are used together to greatly reduce the omission rate of duplicate values. A CAD-Excel two-way verification channel is established to shorten the time for locating abnormal data, and online modification is supported while keeping the CAD table structure unchanged, avoiding the format misalignment problem caused by re-importing in the traditional way. The automation of the verification process reduces the workload of manual review, especially when processing multiple rows of data.
[0076] S14, if the uniqueness verification fails, the non-unique cell width is modified in AutoCAD and Excel until the uniqueness verification passes.
[0077] like Figure 5 As shown, the cell widths of the 3rd, 5th, and 7th rows are all 26.2833, which means that the cell width is repeated 3 times. Therefore, the uniqueness verification cannot pass.
[0078] You need to return to AutoCAD to modify the cell widths corresponding to the 3rd, 5th, and 7th rows and modify the cell widths corresponding to the 3rd, 5th, and 7th rows in the Excel table accordingly, until there are no duplicate cell widths, and the uniqueness verification passes.
[0079] S15, if the uniqueness verification passes, construct a formula in Excel to generate an AutoLISP code sequence.
[0080] Among them, the AutoLISP code sequence is used to modify the cell width in the CAD table to the thickness value of the rock layer, so as to realize drawing the width of the CAD table according to the thickness value of the rock layer. After the table is transposed, the height (i.e., the row height) of the CAD table can be drawn according to the thickness value of the rock layer.
[0081] In one embodiment, constructing a formula in Excel to generate an AutoLISP code sequence may include: amplifying the thickness value of the rock formation through mathematical operations; constructing a string concatenation formula in Excel to automatically generate a SETQ statement sequence and an ENTMOD instruction; and constructing the AutoLISP code sequence according to the SETQ statement sequence and the ENTMOD instruction.
[0082] The amplification of the thickness value of the rock formation by mathematical operation may include: when it is detected that the thickness value of the rock formation is less than the minimum unit threshold of AutoCAD, triggering an amplification program to amplify the thickness value of the rock formation by a preset multiple.
[0083] The embodiment of the present application does not limit the specific value of the preset magnification factor. For example, the preset magnification factor is 10, 100, and so on.
[0084] There is a minimum value limit inside the CAD table, which is also the minimum unit threshold. The thickness value can be prevented from being less than the minimum unit threshold through the thickness value method.
[0085] By intelligently detecting the thickness of the rock layer and the minimum unit threshold of CAD, the preset multiple method is automatically selected to solve the display abnormality problem caused by too small values in traditional methods. It supports the setting of custom preset multiples and can adapt to different industry standards (such as the 1:500 standard for oil exploration and the 1:200 standard for mineral exploration).
[0086] In one embodiment, constructing a string concatenation formula in Excel to automatically generate a SETQ statement sequence and an ENTMOD instruction may include: establishing a mapping relationship between a point pair sequence number corresponding to a cell width and a table row number; constructing a string concatenation formula in Excel to automatically generate a replacement statement in the format of (SETQ OLD(NTH n(ENTGET(entlast)))NEW(xy)), and generating a matching (ENTMOD(SUBST NEW OLD(ENTGET(entlast))) execution instruction, where (xy) is the point pair corresponding to the point pair sequence number.
[0087] Among them, the mapping relationship between the point pair number corresponding to the unit width and the table row number can be established in an Excel table.
[0088] like Figure 6 As shown, paste the original Excel table including the stratigraphic data. The stratigraphic data occupies 5 columns, namely A, B, C, D and E. The "Thickness" in column C is the target parameter value that needs to be adjusted. The cell width in the CAD table needs to be modified in batches according to the thickness value.
[0089] Write the formula in column F: =C4*10 (Note: copy the formula in the entire column, increase the thickness value tenfold to avoid the thickness value being less than the minimum unit threshold of the CAD internal table, or increase the thickness value by 10 or 100 times (i.e., the preset multiple). Assuming that the minimum unit threshold of the CAD table width is 1, the entered value must be greater than 1). It should be noted that C4*10 is only an example, and can be other calculation methods that can multiply the thickness value by ten.
[0090] Enter the formula in column G: =ROUND(F4,2) (Note: copy the formula in the entire column, round off the values in the table, and set the precision of the entered values to 0.00. Set the value to two decimal places after the decimal point). It should be noted that ROUND(F4,2) is only an example, and can be other calculation methods that can set the precision of the value after multiplying the thickness value by ten.
[0091] The ordinal numbers are written into column H, starting from No. 39 (the example provided in this application starts from No. 39, and the ordinal numbers can be adjusted according to the starting point of the unit width).
[0092] The following is an explanation of "Build a string concatenation formula in Excel to automatically generate a replacement statement in the format of (SETQ OLD(NTH n(ENTGET(entlast)))NEW(xy))". Figure 6 For example, write the formula in cell I5: ="(SETQ OLD(NTH"&H5&"(ENTGET(entlast)))NEW'(142."&G5&"))", and then copy the formula in the entire column. It should be noted that choosing to write the formula in cell I5 and selecting the corresponding cells H5 and G5 are only exemplary, and can be adjusted according to actual conditions so that the input value corresponding to the NTH function is the serial number corresponding to the cell width, and the input corresponding to the NEW function is the thickness value multiplied by a preset multiple.
[0093] After that, an (ENTMOD(SUBST NEW OLD(ENTGET(entlast))) execution instruction is generated for each (SETQ OLD(NTH n(ENTGET(entlast)))NEW(xy)) code.
[0094] In one embodiment, the AutoLISP code sequence is constructed according to the SETQ statement sequence and the ENTMOD instruction, including: connecting the SETQ statement sequence and the ENTMOD instruction in series through an operator & to generate the AutoLISP code sequence.
[0095] against Figure 6 For the example shown, the generated AutoLISP code sequence is as follows:
[0096] (SETQ OLD(NTH 39(ENTGET(entlast)))NEW'(142.349.1));
[0097] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0098] (SETQ OLD(NTH 40(ENTGET(entlast)))NEW'(142.37.8));
[0099] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0100] (SETQ OLD(NTH 41(ENTGET(entlast)))NEW'(142.155.6));
[0101] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0102] (SETQ OLD(NTH 42(ENTGET(entlast)))NEW'(142.40));
[0103] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0104] (SETQ OLD(NTH 43(ENTGET(entlast)))NEW'(142.537.7));
[0105] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0106] (SETQ OLD(NTH 44(ENTGET(entlast)))NEW'(142.32));
[0107] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0108] (SETQ OLD(NTH 45(ENTGET(entlast)))NEW'(142.281.8));
[0109] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0110] (SETQ OLD(NTH 46(ENTGET(entlast)))NEW'(142.10));
[0111] (ENTMOD(SUBST NEW OLD(ENTGET(entlast))));
[0112] (SETQ OLD(NTH 47(ENTGET(entlast)))NEW'(142.32));
[0113] (ENTMOD(SUBST NEW OLD(ENTGET(entlast)))).
[0114] Traditionally, it takes a lot of time to manually write multiple lines of LISP code. This solution can automatically generate it in a short time, greatly improving efficiency. By formulating code templates, the syntax error rate is reduced.
[0115] S16, importing the AutoLISP code sequence into the AutoCAD command line for execution, and replacing the cell width with the corresponding thickness value.
[0116] S17, the modified CAD table is rotated, scaled and locked in layers, and visually adjusted through layer management to convert the cell width into cell row height.
[0117] In one embodiment, the layered locking includes a dual-layer processing mechanism; the dual-layer processing mechanism includes: copying the rotated and scaled CAD table into two layers, the two layers including an original layer and a working layer; overlaying and aligning the two layers; locking the original layer; adjusting the text format in the table and / or setting the layer color and / or table height on the working layer, and decomposing the adjusted table.
[0118] For example, if the text group is rotated 90 degrees counterclockwise in S11, the text needs to be rotated 90 degrees clockwise in S17, and if the thickness value is enlarged by a preset multiple in S14, the thickness value needs to be reduced during scaling in S17 so that the enlarged thickness value is restored to the size before enlargement.
[0119] The locking mechanism of the original layer reduces the risk of accidental operation.
[0120] This application can paste the table data in Excel into CAD. In the CAD table, different row heights and column widths can be automatically set in batches according to the data in the table, and the text in the table can be ensured not to be out of line. The text format, alignment, color, and size in the table can be adjusted. Each table can also be adjusted in batches or individually, which is extremely flexible.
[0121] Data verification ensures that the height data of each row and column is accurate, with 100% data correctness. It is flexibly applicable to the drawing of various scale widths, ensuring the consistency of the generation of drawings of different scales (1:200 to 1:1000), meeting the requirements of GB / T 958-2015 geological map preparation specifications.
[0122] This solution can be applied to geological drawing, stratigraphic columnar diagrams, geophysical logging maps, daily logging data mapping, directional well and vertical well mapping, and other Excel-to-CAD drawing work areas, and has a wide range of applications.
[0123] When multiple rows (for example, 500 rows) of data are modified, this solution is completed in one second, greatly improving drawing efficiency and worthy of promotion. The workload of traditional manual adjustment of row tables is compressed to seconds. After testing and comparison, drawings that originally took 3-5 days to complete can now be completed within 2 hours, with an efficiency improvement of more than 40 times. In addition, the human operation error rate is reduced from the industry average of 12% to less than 0.3%, especially for the two decimal places of rock thickness value. The precision is controlled at the millimeter level.
[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope of the present application is indicated by the appended claims.
Claims
1. A CAD stratigraphic columnar diagram drawing method, characterized in that: include: In Excel, a row-column transposition operation is performed on the stratigraphic data, and a font direction is adjusted to match the drawing of the row height, wherein the stratigraphic data includes a thickness value of the rock layer; Set the unit precision to two decimal places in AutoCAD, and import the processed Excel table as an AutoCAD primitive to obtain a CAD table; Extract the cell width in the CAD table by AutoLISP, and import it into Excel to verify the uniqueness of each cell width by using COUNTIF function combined with conditional formatting; If the uniqueness verification fails, modify the non-unique cell width in AutoCAD and Excel until the uniqueness verification passes; If the uniqueness verification passes, a formula is constructed in Excel to generate an AutoLISP code sequence; Importing the AutoLISP code sequence into the AutoCAD command line for execution, and replacing the cell width with the corresponding thickness value; The modified CAD table is rotated, scaled and locked in layers, and visually adjusted through layer management to convert cell width into cell row height.
2. The method according to claim 1, characterized in that The formulas described are constructed in Excel to generate AutoLISP code sequences, including: Amplifying the thickness of the rock layer by mathematical operation; Construct string concatenation formulas in Excel to automatically generate a sequence of set reference SETQ statements and entity modification ENTMOD instructions; The AutoLISP code sequence is constructed according to the SETQ statement sequence and the ENTMOD instruction.
3. The method according to claim 1, characterized in that The operation of transposing the stratigraphic data in Excel and adjusting the font direction to match the drawing of the row height includes: Use CTRL+ALT+V to transpose and paste; Eliminate cell formulas and keep plain text format; Sets the text direction to match the line height when drawing.
4. The method according to claim 1, characterized in that: The method of extracting the cell width in the CAD table by AutoLISP and importing it into Excel to verify the uniqueness of each cell width by using the COUNTIF function combined with conditional formatting includes: Extract the specified point pair including the unit width through the (NTH n(ENTGET(entlast))) function; Use the CDR function to obtain the right value of the point pair and get the unit width; Create a duplicate value detection formula based on the COUNTIF function in Excel; Apply conditional formatting in Excel to highlight cells with repeated cell widths; Return to CAD to correct the repeated cell widths until verification passes. Verification passes when there are no repeated cell widths.
5. The method according to claim 2, characterized in that: The amplifying process of the thickness value of the rock formation by mathematical operation includes: When it is detected that the thickness of the rock layer is less than the minimum unit threshold of AutoCAD, the amplification program is triggered to amplify the thickness of the rock layer by a preset multiple.
6. The method according to claim 2, characterized in that The method of constructing a string concatenation formula in Excel to automatically generate a set reference SETQ statement sequence and an entity modification ENTMOD instruction includes: Establish a mapping relationship between the point pair number corresponding to the cell width and the table row number; Construct a string concatenation formula in Excel to automatically generate a replacement statement in the format of (SETQ OLD(NTH n(ENTGET(entlast)))NEW(xy)), and generate an execution instruction (ENTMOD(SUBST NEW OLD(ENTGET(entlast))), where (xy) is the point pair corresponding to the point pair sequence number; The step of constructing the AutoLISP code sequence according to the SETQ statement sequence and the ENTMOD instruction includes: The SETQ statement sequence and the ENTMOD instruction are concatenated by the & operator to generate a complete code segment.
7. The method according to claim 1, characterized in that The layered locking includes a dual-layer processing mechanism; the dual-layer processing mechanism includes: Copying the rotated and scaled CAD table into two layers, the two layers including an original layer and a working layer; Overlay and align the two layers; Lock the original layer; The text format in the table is adjusted and / or the layer color and / or the table height is set on the working layer, and the adjusted table is decomposed.