Three-dimensional geological profile illustration rapid drawing method based on Autolisp

The method for rapidly drawing 3D geological profile illustrations using the Autolisp language solves the problem of low efficiency in drawing geological profile maps in existing technologies. It enables rapid, accurate, and standardized drawing of 3D geological model profile maps, improving the efficiency and quality of results compilation in the field of geological exploration.

CN120973277AActive Publication Date: 2025-11-18TIBET XIANGLONG MINING CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511032987.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-18
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

In the field of geological exploration, the existing technology for exporting profile maps from 3D geological modeling software to CAD platforms for text illustration is characterized by low operational efficiency and cumbersome procedures. This is especially true for complex geological profiles and densely distributed geological elements, which causes geologists to spend a lot of time on repetitive mechanical work, affecting the efficiency of output.

Method used

A rapid drawing method for 3D geological profile illustrations based on Autolisp is adopted. It achieves automated processing by using interactive rectangular positioning for rapid clipping, fence-based clipping, rapid addition of borders, and attribute-driven batch selection of primitive objects, replacing the traditional manual operation process.

Benefits of technology

This greatly improves the efficiency of geological profile cutting, reducing the drawing time of a single profile illustration from half an hour to within 2 minutes, reducing repetitive operations, and improving the efficiency and quality of geological results compilation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973277A_ABST
    Figure CN120973277A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional geological section illustration rapid drawing method based on Autolisp. The method comprises the following steps: S1, interactive rectangle positioning rapid cutting; s2, quickly cutting upper line segments of the earth surface line based on a fence mode; s3, quickly adding a frame; and S4, attribute-driven primitive object batch selection is carried out. According to the method, an existing CAD illustration drawing process depending on a large amount of manual operation is thoroughly replaced, the three-dimensional geological model profile map is drawn into the report illustration quickly, accurately and standardly, the efficiency and quality of achievement compilation in the geological exploration field are greatly improved, and the problems of mechanical duplication and the like existing in the illustration drawing process of geological personnel at present are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rapid drawing technology for three-dimensional geological model profile diagrams and report illustrations, and in particular to a method for rapid drawing of three-dimensional geological profile illustrations based on Autolisp. Background Technology

[0002] In the field of geological exploration, 3D geological modeling software is typically used to model geological bodies and generate 2D geological cross-sections. However, to meet the specific requirements for accuracy, standardization, and aesthetics in geological design or the main text of geological reports, the generated cross-sections often need to be imported into a computer-aided design (CAD) platform for extensive manual editing, modification, and standardization before they can be transformed into usable professional illustrations. The process of converting cross-sections generated by 3D geological software into report illustrations involves tedious post-processing, such as concentrating geological elements, removing irrelevant coordinate lines for legend placement, and adding borders. When geological exploration projects involve numerous geological cross-sections, this repetitive and mechanical process consumes a significant amount of geologists' time, preventing them from effectively focusing on core geological tasks. Therefore, it is essential to utilize computer technology to redevelop and integrate this repetitive process, enabling geologists to efficiently and quickly convert 3D geological model cross-sections into report illustrations.

[0003] Currently, there is a serious bottleneck in the efficiency of exporting cross-sectional views from 3D geological modeling software to CAD platforms for text illustration in the geological field. The core problem lies in the cumbersome CAD processing of report illustrations: for complex geological cross-sections with intersecting fault lines and stratigraphic boundaries, the native TRIM command is required for trimming, which involves repetitive clicks and is lengthy and inefficient; the construction of standard map frames requires manual execution of multiple steps such as offsetting, extending, trimming, and line type adjustment to meet cartographic specifications; and the accuracy and efficiency of using native CAD commands are low when dealing with densely distributed geological features with similar attributes.

[0004] The aforementioned practices significantly extend the post-processing and drawing cycle of a single illustration, forcing geologists to devote their main energy to repetitive mechanical labor, thus severely squeezing out the core geological work that generates value. This is especially true for large-scale exploration projects that require processing multiple profiles, leading to a dramatic increase in manpower and a severe misallocation of geological talent resources. Manual illustration drawing severely restricts the efficiency of geological output. Summary of the Invention

[0005] This invention provides a method for rapidly drawing 3D geological profile illustrations based on Autolisp. It utilizes Autolisp language for secondary CAD development of related operations, creating a highly automated and intelligent toolchain for post-processing 3D geological model profiles. This completely replaces the existing CAD illustration drawing process that relies heavily on manual operations, enabling the rapid, accurate, and standardized drawing of 3D geological model profiles into report illustrations. This significantly improves the efficiency and quality of geological exploration results compilation, and solves problems such as repetitive mechanical labor encountered by geologists in the current illustration drawing process.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for rapidly drawing 3D geological profile illustrations based on Autolisp includes the following steps: S1. Interactive rectangle positioning and fast cropping: Interact with the user to obtain the diagonal points of the rectangle, determine the minimum horizontal coordinate, maximum horizontal coordinate, minimum vertical coordinate and maximum vertical coordinate of the rectangle based on the diagonal points, draw a temporary rectangle and generate a list of closed fence points based on the four coordinates, use the temporary rectangle as the boundary and the list of closed fence points as the selector to crop the outer line segments of the rectangle and obtain the preliminary cropped cross-sectional view. S2. Quickly trim the upper segment of the ground line based on the fence pattern; Based on the preliminary trimmed profile obtained in S1, interact with the user to obtain the baseline, extract the key points of the baseline and generate the upper fence point list, trim the upper segment of the ground line that intersects with the upper fence point list to obtain the simplified profile. S3. Quickly add borders; Based on the simplified cross-section obtained in S2, after turning off object snap, select the left and right polylines as the baseline objects, extract the coordinates of the baseline endpoints, calculate the coordinates of the inner and outer borders, and draw the surface line extrapolation rectangle, inner and outer borders. After modifying the border line width attribute, restore object snap to obtain a cross-section with standard borders. S4. Attribute-driven batch selection of primitive objects: Based on the cross-sectional view with standard borders obtained in S3, the system interacts with the user to select reference objects and extract their attribute combinations. It then traverses all objects in the map to filter out objects that match the attribute combination, highlights them, and outputs the number of matches, resulting in standardized illustrations that can be directly used in reports.

[0007] In this specification, step S1, obtaining the diagonal points of a rectangle, includes: using an interactive function to obtain the first and diagonal points of the rectangle specified by the user; determining if the user has completed their selection before proceeding to the next step; otherwise, exiting the process.

[0008] In this specification, S1, generating a closed fence point list includes: calculating one-thousandth of the distance between the diagonal points of the rectangle as the offset, and generating a closed fence point list with the beginning and end connected in the order of top left corner → top right corner → bottom right corner → bottom left corner → top left corner based on the minimum and maximum horizontal and vertical coordinates of the rectangle.

[0009] In this specification, during step S2, when extracting key points of the baseline, if the baseline is a closed polyline, the tail point is deleted to remove duplicate coordinates by determining whether the first and last vertices coincide, ensuring that the generated fence point list only covers the upper area of ​​the baseline.

[0010] In this specification, S2, generating the upper fence point list includes: extracting the endpoints or vertices of the baseline, adding an offset to the coordinates of each point to obtain the initial fence points, and adding an extra offset point at the beginning and end of the fence point list to cover the endpoints of the baseline.

[0011] In this specification, drawing the border in S3 includes: calculating and extending the ground line outward by 10 units based on the endpoints of the left and right polyline to draw the ground line extension rectangle. The distance between this rectangle and the inner border is 10 units, and the distance between the inner border and the outer border is 2 units. The outer border line width is set to 0.8, and the line widths of the inner border and the ground line extension rectangle are set to 0.1.

[0012] In this manual, disabling object snapping in S3 involves: first, obtaining and saving the initial value of the system variable for the current object snapping mode using the Autolisp getvar function, and then setting the system variable to 0 using the setvar function to disable all object snapping modes.

[0013] In this manual, selecting left and right polylines in S3 includes: using the entsel command to prompt the user to select the left and right polylines; using the car function to save the obtained reference object primitive name to the lineName variable; using enget to obtain the set of key-value pairs of the lineName variable that conforms to the DXF group code standard; using the assoc function to obtain the primitive type with group code 0; determining whether it is a polyline; if not, exiting the process; and finally, using a foreach loop to traverse the data with group code 10 in the primitive information to extract the vertex coordinates of the selected reference line segment and save the coordinates of the two endpoints of the line segment.

[0014] In this manual, in S4, the custom function CheckPropsMatch compares the objects and attribute combinations of the entire drawing and adds the matching objects to the selection set, where the filtering range is the entire drawing.

[0015] In this specification, step S4 involves extracting the attributes of the reference object, including obtaining the layer, color, linetype scale, and line width of the reference object, and storing them as a list of attribute combinations after deduplication.

[0016] In summary, the present invention has at least the following beneficial effects: This invention enables rapid processing of 3D geological software slices into text illustrations by developing a complete toolchain for illustration creation. Key features include: interactive rectangular positioning and clipping, and surface line-based clipping functions, transforming traditional manual trimming into automated single-selection processing, significantly improving the efficiency of geological profile clipping and achieving second-level image clipping; a quick border addition function that can be flexibly adjusted according to relevant cartographic specifications, enabling automatic border generation; and an attribute-driven batch selection function that overcomes the bottleneck of manual screening of complex geological elements, strictly matching selected element attributes, achieving results far superior to the built-in similar object selection function in CAD software.

[0017] Compared to the past practice of geologists manually drawing 3D geological model cross-sections into report illustrations using CAD, this technical solution can greatly improve the work efficiency of geologists by using a full-process secondary development command written in Autolisp language. It reduces the drawing time of a single cross-section illustration from half an hour to within 2 minutes, helping geologists to break free from repetitive mapping operations and focus more on value creation. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the method for rapidly drawing three-dimensional geological profile illustrations based on Autolisp involved in this invention.

[0020] Figure 2 This is a schematic diagram illustrating the determination of a rectangular range based on diagonal points, as described in this invention.

[0021] Figure 3 This is a schematic diagram illustrating the creation of a fence point list based on the minimum / maximum coordinates of a rectangle and an outward expansion based on a small offset delta, as described in this invention.

[0022] Figure 4 This is a schematic diagram of the interactive rectangular positioning and fast cropping method involved in this invention.

[0023] Figure 5 This is a schematic diagram of the interactive rectangular positioning and fast cropping effect involved in this invention.

[0024] Figure 6 This is a schematic diagram of the rapid cropping method based on the fence pattern involved in this invention.

[0025] Figure 7 This is a schematic diagram illustrating the rapid cropping effect based on the fence pattern involved in this invention.

[0026] Figure 8 This is a schematic diagram illustrating the detailed specifications regarding the border of the cross-sectional view in the standards involved in this invention.

[0027] Figure 9 This is a schematic diagram illustrating the method and effect of quickly adding borders as described in this invention.

[0028] Figure 10 This is a schematic diagram illustrating the rapid border-adding effect involved in this invention.

[0029] Figure 11 This is a schematic diagram of the primitive objects to be selected for the attribute-driven batch selection function of primitive objects involved in this invention.

[0030] Figure 12 This is a schematic diagram illustrating the batch selection of attribute-driven primitive objects involved in this invention.

[0031] Figure 13 This is a schematic diagram comparing the effects of batch selection of attribute-driven primitive objects involved in this invention. Detailed Implementation

[0032] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0033] The following disclosure provides many different implementations or examples for carrying out different structures of the embodiments of the present invention. To simplify the disclosure of the embodiments of the present invention, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the embodiments of the present invention. Furthermore, reference numerals and / or reference letters may be repeated in different examples of the embodiments of the present invention; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various implementations and / or arrangements discussed.

[0034] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0035] like Figure 1 As shown, this embodiment provides a method for rapidly drawing 3D geological profile illustrations based on Autolisp, including the following steps: S1. Interactive rectangle positioning and fast cropping: Interact with the user to obtain the diagonal points of the rectangle, determine the minimum horizontal coordinate, maximum horizontal coordinate, minimum vertical coordinate and maximum vertical coordinate of the rectangle based on the diagonal points, draw a temporary rectangle and generate a list of closed fence points based on the four coordinates, use the temporary rectangle as the boundary and the list of closed fence points as the selector to crop the outer line segments of the rectangle and obtain the preliminary cropped cross-sectional view. S2. Quickly trim the upper segment of the ground line based on the fence pattern; Based on the preliminary trimmed profile obtained in S1, interact with the user to obtain the baseline, extract the key points of the baseline and generate the upper fence point list, trim the upper segment of the ground line that intersects with the upper fence point list to obtain the simplified profile. S3. Quickly add borders; Based on the simplified cross-section obtained in S2, after turning off object snap, select the left and right polylines as the baseline objects, extract the coordinates of the baseline endpoints, calculate the coordinates of the inner and outer borders, and draw the surface line extrapolation rectangle, inner and outer borders. After modifying the border line width attribute, restore object snap to obtain a cross-section with standard borders. S4. Attribute-driven batch selection of primitive objects: Based on the cross-sectional view with standard borders obtained in S3, the system interacts with the user to select reference objects and extract their attribute combinations. It then traverses all objects in the map to filter out objects that match the attribute combination, highlights them, and outputs the number of matches, resulting in standardized illustrations that can be directly used in reports.

[0036] In some embodiments, in S1, obtaining the diagonal points of a rectangle includes: using an interactive function to obtain the first corner point and the diagonal points of the rectangle specified by the user; determining whether the user has completed the selection and proceeding to the next step; otherwise, exiting the process.

[0037] In some embodiments, in S1, generating a list of closed fence points includes: calculating one-thousandth of the distance between the diagonal points of the rectangle as an offset, and generating a list of closed fence points connected end to end in the order of top left corner → top right corner → bottom right corner → bottom left corner → top left corner based on the minimum and maximum horizontal and vertical coordinates of the rectangle.

[0038] In some embodiments, during step S2, when extracting key points of the baseline, if the baseline is a closed polyline, the tail point is deleted to remove duplicate coordinates by determining whether the first and last vertices overlap, ensuring that the generated fence point list only covers the upper area of ​​the baseline.

[0039] In some embodiments, in S2, generating the upper fence point list includes: extracting the endpoints or vertices of the baseline, adding an offset to the coordinates of each point to obtain the initial fence points, and adding an extra offset point at the beginning and end of the fence point list to cover the endpoints of the baseline.

[0040] In some embodiments, drawing the border in S3 includes: calculating and drawing a ground line extrapolation rectangle by extrapolating 10 units outward based on the endpoints of the left and right polysegment lines. The rectangle is 10 units apart from the inner border, and the inner border is 2 units apart from the outer border. The outer border line width is set to 0.8, and the inner border and the ground line extrapolation rectangle line width are set to 0.1.

[0041] In some embodiments, disabling object snapping in S3 includes: first obtaining and saving the initial value of the system variable for the current object snapping mode using the Autolisp getvar function, and then setting the system variable to 0 using the setvar function to disable all object snapping modes.

[0042] In some embodiments, selecting left and right polylines in S3 includes: prompting the user to select left and right polylines using entsel; saving the obtained reference object primitive name to the lineName variable using the car function; obtaining the set of key-value pairs of the lineName variable conforming to the DXF group code standard using enget; obtaining the primitive type with group code 0 using the assoc function; determining whether it is a polyline; and exiting the process if not. Finally, using a foreach loop to traverse the data with group code 10 in the primitive information to extract the vertex coordinates of the selected reference line segment and saving the coordinates of the two endpoints of the line segment.

[0043] In some embodiments, in S4, a custom function CheckPropsMatch compares the entire drawing object with the attribute combination, and adds the matching object to the selection set, wherein the filtering range is the entire drawing.

[0044] In some embodiments, in S4, extracting reference object attributes includes: obtaining the layer, color, linetype scale, and line width of the reference object, and storing them as a list of attribute combinations after deduplication.

[0045] The technical concept of this invention is as follows: This invention addresses the inefficiency of manually drawing 3D geological profile sections into reports or design illustrations by geological workers. It proposes a CAD secondary development method based on the Autolisp language. This method achieves rapid illustration drawing through a complete toolchain, including interactive rectangular positioning and fast clipping, fast clipping based on a fence pattern, rapid border addition, and attribute-driven batch selection of primitive objects. Furthermore, considering various line segment selection types and exception handling, the overall technical solution exhibits strong robustness. The method utilizes the Autolisp language, primarily through its built-in functions and related user-defined functions, and includes the following steps: Step S1: Interactive rectangular positioning and quick cropping, used for drawing boundary cleaning and standardized drawing preparation.

[0046] Because the orebody model profiles generated by 3D geological software are relatively large, while the illustrations placed in the report text are relatively small and the geological elements are concentrated, it is necessary to compress the profiles as much as possible to retain the main geological elements. This step is mainly used to automatically trim the outer line segments of the user-selected rectangle after selecting two diagonal points to define the rectangle, for drawing boundary cleaning and preparation for standardized drawing output.

[0047] Step S1.1: Use getpoint to get the first corner point of the user-specified rectangle and save it to variable pt1. Use getcorner to get the opposite corner point of the user-specified rectangle and save it to variable pt2. Determine the rectangle range based on variables pt1 and pt2.

[0048] `getpoint` is an interactive function used in AutoCAD to obtain the coordinates of a point input by the user. It supports mouse clicks, absolute coordinates, and relative coordinates input via keyboard. In this embodiment, since we need to interact with the user to obtain the map clipping range, we use mouse clicks to obtain the coordinates of the diagonal points of the clipping rectangle. `getcorner` is also an interactive function specifically used to obtain the diagonal points of a rectangle. When used in conjunction with the `getpoint` function, AutoCAD displays a dynamic rectangle from the base point obtained by `getpoint` to the current cursor position, visually representing the range of the rectangle selected by the user.

[0049] Preferably, the corner point variables pt1 and pt2 used for interactive acquisition of the saved cropping rectangle range are judged to check whether the user has completed the rectangle selection operation. If so, proceed to step S1.2; otherwise, exit the process.

[0050] The relevant code is as follows: (if (and (setq pt1 (getpoint "\nSpecifies the first corner point of the rectangle: ")) (setq pt2 (getcorner pt1 "\nSpecify diagonal point: "))) Step S1.2: With object snapping mode off, use the command to draw a temporary rectangle based on the obtained pt1 and pt2 variables. Then, use entlast to save the newly drawn temporary rectangle in the variable rect for use as the clipping boundary in the clipping operation of step S1.5.

[0051] The `command` function is a crucial bridge connecting LISP programs and AutoCAD commands in CAD secondary development. It executes one or more AutoCAD commands and supports variable parameter sequences, where each parameter is a response to the command. For example, in this embodiment, the `command` parameter list is "_.rectang" "_non" pt1 "_non" pt2, indicating that the `_.rectang` function is called to draw a rectangle using the coordinates of variables pt1 and pt2 in object snap-off mode.

[0052] Preferably, using _.rectang for temporary rectangle drawing ensures code compatibility across different versions of CAD platforms.

[0053] The main function of the "_non" parameter is to temporarily disable all running object snap settings, ensuring that the program uses precisely specified coordinate points instead of automatically snapping to nearby geometric features. It is often used for procedural, precise drawing.

[0054] Preferably, the "_non" parameter is used to temporarily disable all object snapping, ensuring that precise coordinates are used when drawing rectangles instead of nearby snap points, thereby avoiding accidental snapping to coordinates near pt1 or pt2 and ensuring consistency between program execution and user intent.

[0055] `entlast` is an entity manipulation function used to retrieve the most recently created main entity in the graph database. `entlast` is called after a rectangle is drawn using the command; at this point, the most recently created entity in the graph database is the temporary rectangle, effectively avoiding the inefficiency of global search. The temporary rectangle primitive `rect` obtained through `entlast` is used as the clipping boundary in subsequent step S1.5.

[0056] The relevant code is as follows: (command "_.rectang" "_non" pt1 "_non" pt2) (setq rect (entlast)) Step S1.3: Based on the diagonal points pt1(x1,y1) and pt2(x2,y2) of the rectangle obtained through interaction with the user, determine the minimum x1, maximum x2, minimum y1, and maximum y2 of the rectangle by combining the functions car, cadr, min, and max.

[0057] For example, if the diagonal points of the rectangle obtained by the user are (1,2) and (3,4), then the minimum x-coordinate is 1, the maximum x-coordinate is 3, the minimum y-coordinate is 2, and the maximum y-coordinate is 4. In this case, the coordinates of the top-left corner of the rectangle are (x1,y2), the top-right corner is (x2,y2), the bottom-right corner is (x2,y1), and the bottom-left corner is (x1,y1), as detailed below. Figure 2 As shown. Since the range of the rectangle can also be determined by determining the maximum / minimum horizontal and vertical coordinates, the coordinate values ​​of the two diagonal points of the rectangle are extracted and used in step S1.4 to combine and determine the coordinates of the four points of the rectangle for expanding and generating the fence point list.

[0058] `car` and `cadr` are list operation functions. `car` returns the first element of the list, and `cadr` returns the second element. Therefore, `car` and `cadr` can be used to obtain the x and y coordinates of a point, respectively.

[0059] The relevant code is as follows: (setq x1 (min (car pt1) (car pt2)) y1 (min (cadr pt1) (cadr pt2)) x2 (max (car pt1) (car pt2)) y2 (max (cadr pt1) (cadr pt2))) Step S1.4: Calculate a small offset delta according to the size of the rectangle rect at a certain ratio, combine the coordinates of the four corner points of the rectangle using the minimum / maximum horizontal and vertical coordinates of the rectangle, and create a fence point list fencePoints with the beginning and end connected based on the small offset delta.

[0060] Preferably, a small offset delta is calculated proportionally to the size of the rectangle. It is recommended that this value be set to one-thousandth of the distance between the diagonal points pt1 and pt2 of the rectangle. This ensures that the small offset is applicable to CAD drawings at different scales, guaranteeing that the offset is small compared to the size of the rectangle and thus ensuring compatibility with drawings at different scales. A list of fence points is then created by expanding the minimum / maximum coordinates of the rectangle based on the small offset delta, as shown below. Figure 3 As shown.

[0061] Based on the maximum / minimum horizontal and vertical coordinates of the rectangle extracted in step S1.3, the coordinate values ​​of the four corner points of the rectangle can be combined to obtain the coordinate values ​​of the four corner points of the rectangle. For example, the coordinates of the upper left corner of the rectangle are (x1, y2) and the coordinates of the lower right corner of the rectangle are (x2, y1). Then, the values ​​of the expanded fence point list are calculated based on the coordinate values ​​of the four corner points of the rectangle and the small offset delta, which are used as the clipping object selector in step S1.5.

[0062] Preferably, since the fence mode uses a polyline as the object selector, only objects intersecting the polyline are selected. If the fence point list is not closed, there may be redundant line segments on one side of the rectangle that cannot be selected for clipping. Only by closing the fence point list to form a continuous rectangular loop can it be ensured that all objects around the temporary rectangle are traversed by the fence point list, guaranteeing the clipping effect. Therefore, the fence point list fencePoints uses a series of coordinates connected end to end. For example, in this embodiment, the fence point list fencePoints is arranged in the manner of "top left corner coordinate → top right corner coordinate → bottom right corner coordinate → bottom left corner coordinate → top left corner coordinate", ensuring full coverage of the clipping area outside the rectangle and quickly clipping redundant geological elements outside the drawing boundary.

[0063] The relevant code is as follows: (setq fencePoints (list (list (- x1 delta) (- y1 delta)) ; Left-bottom outer expansion point (list (- x1 delta) (+ y2 delta)) ; Top-left outer expansion point (list (+ x2 delta) (+ y2 delta)) ; Top right outer expansion point (list (+ x2 delta) (- y1 delta)) ; Lower right outer expansion point (list (- x1 delta) (- y1 delta)) ; Closes back to the starting point)) Step S1.5: Based on the fence mode, use the fence point list (fencePoints) and the temporary rectangle (rect) to perform a line segment clipping operation outside the user-defined rectangular area, thus cleaning up the drawing boundaries and preparing for standardized output. First, use the command to invoke the native _.trim command, using the temporary rectangle (rect) as the clipping boundary; second, use the command to switch to fence mode; third, iterate through the fence point list (fencePoints), inputting each fence point sequentially using the command; finally, use the command to end the fence point input and perform the clipping.

[0064] "Fence mode" is an efficient way to select objects, especially when performing editing commands such as TRIM and EXTEND, allowing for flexible selection of graphic elements that need to be manipulated. Its core functionality involves drawing a continuous line segment (the "fence line") and selecting all objects that intersect that line. By drawing a continuous fence line with any direction, all graphic objects crossed by this line are automatically selected. For example, in the TRIM command, the portion of the line segment crossed by the fence line is directly cut off. Compared to rectangular selection (window selection), the fence line can adapt to irregular shapes (such as intersecting lines or curved structures), precisely controlling the part to be manipulated and avoiding accidental selection.

[0065] Because the fence pattern is used to perform clipping operations on the excess area outside the rectangular area obtained through user interaction, a temporary rectangle `rect` is selected as the baseline boundary for the clipping operation. The fence point list `fencePoints` acts as the clipping object selector, determining which objects need to be clipped. In other words, `fencePoints` only selects the clipping objects, and the temporary rectangle defines the clipping boundary. Clipping based on the fence pattern allows for large-area clipping to be completed in a single operation.

[0066] The relevant code is as follows: (command "_.trim" rect "") (command "_fence") (foreach pt fencePoints (command pt)) (command "" "") Step S1.6: Clean up the temporary rectangle object using entdel rect.

[0067] Since the rectangle drawn in step S1.2 is only used as the clipping boundary and is a temporary object, it does not need to be retained. After the clipping is completed, the object needs to be deleted using the entdel command.

[0068] How to use interactive rectangular positioning and quick cropping: Figure 4 As shown, the cropping effect is as follows: Figure 5 As shown.

[0069] Step S2: Quickly trim intersecting segments above the ground line based on the fence pattern For report illustrations, since the overall content is relatively compact and the map size needs to be as small as possible, the legend needs to be placed in the blank space of the illustration. Therefore, the coordinate lines above the ground line in the cross-sectional view that do not need to be retained need to be deleted.

[0070] Step S2.1: Use the entsel command to interact with the user to obtain the baseline and save the selected primitive name to the variable en.

[0071] The `entsel` function prompts the user to select a single graphic element by specifying a point and returns a list containing the element name and the coordinates of the pick point. It is often used in conjunction with the `car` function to retrieve the graphic element name of the selected object.

[0072] Preferably, to improve the robustness of the technical solution, it is checked whether the user has selected a baseline. If the user selects a certain graphic object, step S2.2 is executed; otherwise, the process is exited and the user is prompted "no object selected".

[0073] The relevant code is as follows: (if (not (setq en (car (entsel "\nSelect baseline (straight line or polyline): "))))) (progn (princ "\nNo object selected") (exit))) Step S2.2: Extract key points based on the baseline selected by the user, which will be used to generate a fence point list later.

[0074] Step S2.2.1: First, use enget to obtain the set of key-value pairs that conform to the DXF group code standard for variable en; second, use assoc to obtain the primitive type data corresponding to group code 0, and save the primitive type to variable objType; finally, determine whether the type of variable objType is LINE, LWPOLYLINE or other.

[0075] `entget` is a function for accessing drawing data. It converts AutoCAD objects into a program-processable list of associated data. This function returns a set of key-value pairs conforming to the DXF group code standard, where the group code acts as the key to identify data types (such as element types, layers, geometric coordinates, etc.), and the corresponding value stores the specific data. `assoc` is a function for the associated list. It efficiently extracts the value corresponding to a specific group code from the data returned by `entget`. It finds and returns the first matching key-value pair through precise key matching, and its return result can be directly used in the CDR value extraction section. In CAD data processing, it is the primary means of accessing object attributes, and is particularly suitable for processing structured data in DXF format.

[0076] Preferably, this step improves the robustness of the technical solution by obtaining the graphic element type of the user-selected object and performing corresponding operations based on different graphic element types. When the user selects a baseline type of LINE or LWPOLYLINE, the relevant operations are performed; if it is another type, the user is prompted "This graphic element type is not supported" and the process is exited.

[0077] The relevant code is as follows: (setq edata (entget en)) (setq objType (cdr (assoc 0 edata))) (cond ((= objType "LINE") (The user selected a line as the primitive type) ((= objType "LWPOLYLINE") (The user selected a polyline as the primitive type.) (t (princ "\nUnsupported primitive type!") (exit))) Step S2.2.2: If the primitive type of the en variable is LINE, use the assoc and cdr functions to obtain the data corresponding to group code 10 and group code 11 to obtain the key points of the line, and save the key points to the variable basePts; if it is of type LWPOLYLINE, use the assoc and cdr functions to obtain the data corresponding to group code 10 to obtain all vertices of the polyline, and save the key points to the variable basePts. At the same time, if it is a closed polyline, delete the tail point.

[0078] DXF (Drawing Interchange Format) group codes are an integer code system in AutoCAD used to identify the attributes of graphic elements. They form the basis of AutoCAD's data exchange format. Each group code corresponds to a specific type of graphic data, completely describing all attributes of an AutoCAD entity through numeric codes and associated values. For line types, group code 10 represents the coordinates of the line's starting point, group code 11 represents the coordinates of the line's ending point, and for polylines, group code 10 represents a list of polyline vertex coordinates.

[0079] Therefore, if the user obtains the variable en primitive type as a line through entsel, the start and end coordinates of the line can be obtained using assoc and cdr, and the coordinates can be saved to the basePts variable.

[0080] The relevant code is as follows: (setq basePts (list (cdr (assoc 10 edata)) (cdr (assoc 11 edata)))) If the primitive type of variable en is a polyline, firstly, a lambda expression is used to define filtering conditions, and an anonymous function is created to determine whether an element is polyline vertex data; secondly, vl-remove-if-not is used for fast filtering to retain vertex data; finally, by combining the mapcar and cdr functions, the part of the list except the first element is retained in batches, and finally the vertex coordinate list variable basePts that can be used directly is obtained.

[0081] Lambda functions are the implementation of anonymous functions in the LISP language. They allow the creation of one-time-use functions without defining a formal function name, making them suitable for passing arguments to higher-order functions. The `vl-remove-if-not` function removes elements from a list that do not meet specific conditions. It is often used in conjunction with lambda functions to remove all elements that do not satisfy the test function's conditions. The `mapcar` function takes each element of one or more specified lists as an argument to a function and returns the function's return values ​​as a new list.

[0082] The relevant code is as follows: (setq basePts (mapcar 'cdr (vl-remove-if-not '(lambda (x)(= (car x)10)) edata))) In 3D modeling software, the surface line of a cross-section may be a closed, coincident curve, meaning that the beginning and end may be connected. If the connected polyline is expanded outward, it may cause unpredictability in program execution and affect the trimming effect.

[0083] Preferably, to ensure that the fence path generated based on the baseline selected by the user is generated only above the baseline, it is necessary to use the equal function to determine whether the polyline is a closed polyline with its beginning and end connected. If so, the end point is deleted to strictly ensure that the fence path is only above the baseline, so that the clipping object selected based on the fence point list is strictly consistent with the expectation.

[0084] Since lists in Autolisp are essentially singly linked lists and there is no built-in function to directly delete the last element of a list, deleting the last element requires traversing the entire linked list, which is inefficient. Therefore, double reverse is used to achieve fast deletion of the last element of the list.

[0085] The relevant code is as follows: (if (equal (car basePts) (last basePts) 1e-6) (setq basePts (reverse (cdr (reverse basePts))))) It should be noted that if the runtime environment supports the `butlast` function, the following code can be used: (if (equal (car basePts) (last basePts) 1e-6) (setq basePts (butlast basePts)) Step S2.3: Using the small offset delta calculated in step S1.4, the lambda and mapcar functions are used to increase the small offset delta in the list variable basePts that stores the baseline vertices, generating a list of fence points fencePts corresponding to the ground baseline for selecting clipping objects in step S2.5.

[0086] Since the clipping boundary is used to select the surface baseline, the purpose of clipping is to cut off the redundant coordinate lines above the surface line to clear the space for the illustration information, etc. Therefore, the fence point list is different from the expansion in step S1. This fence point list is only above the surface line. Therefore, the mapcar and lambda functions are used to add a small offset delta to the coordinates of the surface baseline vertices to obtain the fence point list fencePts.

[0087] The relevant code is as follows: (setq fencePts (mapcar '(lambda (pt) (list (+ (car pt) delta) (+ (cadr pt) delta) (caddr pt))) basePts)) Step S2.4: Add an extra offset point at the beginning and end of the fence point list fencePts.

[0088] To prevent objects at the endpoints from just touching but not crossing the fence line, thus preventing them from being properly trimmed, the append function is used to add an extra offset point at the beginning and end of the fence point list fencePts to ensure that the path covers the ground baseline.

[0089] The relevant code is as follows: (setq fencePts (append (list (list (- (caar fencePts) delta) (+ (cadar fencePts) delta))) fencePts (list (list (+ (car (last fencePts)) delta) (+ (cadr (last fencePts))delta))))) Step S2.5: Use the command to call _.trim to perform the trimming operation.

[0090] The method is similar to S1.5, and will not be described in detail again. The relevant code is as follows: (command "_.trim" en "") (command "_fence") (command "" "") The method for using the fence-based quick cropping technique is as follows: Figure 6 As shown, the cropping effect is as follows: Figure 7 As shown.

[0091] Step S3: Quickly add inner and outer borders and set line type parameters according to the specifications.

[0092] After cropping and deleting unnecessary parts as much as possible, borders need to be drawn to make the report illustrations more aesthetically pleasing. This example uses the Zijin "Geological Exploration Work Guidelines (Q / Z)-GP-GD-001-2018" standard as an example. The standard requires that the surface line be drawn as an outward-extending rectangle, 10 units from the end point of the cropped surface line, with a line width of 0.1. This rectangle should be 10 units from the inner border, with the inner border also having a line width of 0.1. The distance between the inner and outer borders should be 2 units, and the outer border should have a line width of 0.8. The detailed specifications regarding illustration borders in this standard are as follows: Figure 8 As shown.

[0093] Select the leftmost and rightmost polylines after trimming in steps S1 and S2 as the baseline. Using these polylines as the baseline, calculate the coordinates of each border vertex, and then use the command to call the pline to draw the polyline to achieve automatic border drawing.

[0094] Step S3.1: Use the getvar function to get the current object capture mode (osmode) parameter and save it to the variable osm, and set osmode to 0 to turn off the object capture mode.

[0095] Object Snap Mode is one of the core features of AutoCAD, allowing users to precisely snap to specific geometric feature points (such as endpoints, midpoints, and centers) of existing graphic objects. Its behavior is controlled by the system variable `osmode`. In LISP programs, the original value of `osmode` must be retrieved and saved using the `getvar` function before modifying it, and restored when the program ends; otherwise, it will disrupt the user's working environment settings.

[0096] Preferably, to avoid the inability to accurately select coordinate points when automatically drawing borders later due to the use of object snap mode, the object snap mode should be turned off. After the automatic border addition process is completed, the value of the variable osm should be reassigned to the system variable osmode to ensure that the object snap mode does not change due to the execution of this command.

[0097] The relevant code is as follows: (setq osm (getvar "osmode")) (setvar "osmode" 0) Step S3.2: Prompt the user to select a baseline object and extract the coordinates of the baseline endpoints. First, use `entsel` to prompt the user to select the left and right polylines, and use the `car` function to save the obtained baseline object primitive name to the `lineName` variable. Second, use `entget` to obtain the set of key-value pairs in the `lineName` variable that conforms to the DXF group code standard. Third, use the `assoc` function to obtain the primitive type with group code 0, and determine whether it is a polyline; if not, exit the process. Finally, use a `foreach` loop to traverse the primitive information and extract the vertex coordinates of the selected baseline segment, and save the coordinates of the two endpoints of the segment to the variables `pLeft1` and `pLeft2`.

[0098] It should be noted that the method for obtaining the coordinates of the endpoints of the polyline is the same for both the left and right sides, so here we will only take obtaining the coordinates of the endpoints of the left baseline as an example.

[0099] The relevant code is as follows: (setq s_line (entsel "Please select the polyline on the left:" )) (setq line_name (car s_line));s (setq line_data (entget line_name)) (if (= "LWPOLYLINE" (cdr (assoc 0 line_data))) (progn (setq points nil) (foreach ele line_data (if (= (car ele) 10) (setq points (append points (LIST (cdr ele))))))) (alert "Please select polyline!") (setq p1 (car points)) (setq p2 (cadr points)) Step S3.3: Using the left polyline endpoints pLeft1 and pLeft2 obtained in step S3.2 as reference points, calculate the coordinates of each border vertex.

[0100] The relevant code is as follows: pLeft1new and pLeft2new are the top and bottom vertices of the rectangle extrapolated from the left edge of the ground. (setq pLeft1new (list (- (car pLeft1) 10) (cadr pLeft1))) (setq pLeft2new (list (- (car pLeft2) 10) (cadr pLeft2))) (print p1new)(print p2new) ;;pleftbottomin and pleftupin are the top and bottom points on the left side of the inner border. (setq pleftbottomin (list (- (car pLeft1new ) 10) (- (cadr pLeft1new) 10))) (setq pleftupin (list (car pleftbottomin) (+ (cadr pLeft2new ) 45))) ;;(command "line" pleftbottomin pLeft1new "") ;;pleftbottomout and pleftupout have two points on the top and bottom left of their outer borders. (setq pleftbottomout (list (- (car pLeft1new ) 12) (- (cadr pLeft1new) 12))) (setq pleftupout (list (car pleftbottomout) (+ (cadr pleftupin) 2))) Step S3.4: Based on the coordinates of each border vertex calculated in Step S3.3, use the command command to call pline to draw the ground line extrapolation rectangle and the inner and outer borders respectively. After drawing the ground line extrapolation rectangle, use entlast to save the line segment to the variable changeStyle1 for use in step S3.5 to modify the line segment properties. After drawing the outer border, use entlast to save the line segment to the variable changeStyle2 for use in step S3.5 to modify the line segment properties.

[0101] The command is used to call pline to draw line segments based on the calculated coordinates of the border vertices. For the inner and outer borders, the pline closing function is enabled using the parameter "c". Finally, the empty string parameter "" is used to replace the actual press of the Enter key to end the pline drawing command, complete the polyline drawing and exit the command.

[0102] For primitive objects whose border properties need to be modified, after drawing line segments using the command command, the newly drawn primitive is saved using entlast to avoid the inefficiency of global search and to facilitate obtaining DXF group code information in step S3.5 to modify line segment properties.

[0103] The relevant code is as follows: (command "pline" pLeft1 pLeft2 pLeft2new pLeft1new p1Rightnewp2Rightnew pRight2 pRight1 "") (setq changeStyle1 (entlast)) (command "pline" pleftbottomin pleftupin prightupin prightbottomin "c" "") (command "pline" pleftbottomout pleftupout prightupoutprightbottomout "c" "") (setq changeStyle2 (entlast)) Step S3.5: Modify border line segment attributes. First, use the entget function to obtain the element attributes of the element variables changeStyle1 and changeStyle2 obtained in step S3.4; second, use the subst function to modify the line segment width value corresponding to group code 43; finally, use entmod to update the element and use entupd to refresh the display.

[0104] The `subst` function replaces a specified element in a list, the `entmod` function modifies the DXF group code data of a graphic element, and the `entup` function updates the display of a graphic element on the screen. Since modifying graphic element attributes using `entmod` does not immediately refresh the screen display, `entup` is often used in conjunction with `entmod` to force a regeneration of the graphic element's display.

[0105] The relevant code is as follows: (progn (setq obj (entget changeStyle2)) (setq obj (subst (cons 43 0.8) (assoc 43 obj) obj)) (entmod obj) (entupd changeStyle1)) Step S3.6: Restore object snap mode In step S3.1, the object capture mode variable osm, which was saved before the specific execution of step S3, is reassigned to the system variable osmode to ensure that the user-defined object capture mode is not changed before and after the execution of this step.

[0106] The relevant code is as follows: (setvar "osmode" osm) ;; Enables object snapping.

[0107] How to quickly add borders: Figure 9 As shown, the border effect is as follows Figure 10 As shown.

[0108] Step S4: Batch selection of attribute-driven primitive objects (involves two custom functions).

[0109] In reports, it's common to create illustrations of pre- and post-construction sections for comparison. A common method is to first draw the pre-construction illustration, then replace the polylines representing grade and the filling patterns representing resource type with the post-construction grade and resource type. Therefore, a method is needed to quickly and accurately select the polylines representing grade and the filling patterns representing resource type. However, the built-in "select similar objects" function in CAD cannot accurately select relevant objects, and its operation efficiency is relatively low. This step, based on a batch of user-selected reference objects, precisely matches the primitive attributes of the reference objects, enabling rapid and accurate filtering of all objects with the same attribute combinations throughout the entire drawing.

[0110] Step S4.1: Prompt the user to select a reference object and obtain the primitive attributes. First, use a while loop and entsel to wait for each reference object to be selected (enter to end); second, for each selected reference object, use a custom function GetEntityProps to obtain the four key attributes of the DXF (layer (group code 8), color (group code 62), linetype scale (group code 48), line width (group code 370)) for comparison and filtering; finally, use vl-some to perform attribute deduplication, check if the attribute exists to avoid duplicate storage, and output a unique combination to the props_list list.

[0111] Preferably, since the layer, color, linetype scale, and line width in the primitive attributes already represent most of the information about primitive attributes, they are an effective distinguishing feature for different objects. Furthermore, in extensive practice and testing, using only these four attributes to match and filter across the entire image is sufficient to accurately filter primitive objects with the same attributes, achieving a balance between effectiveness and efficiency. Simultaneously, in certain special cases where these four attributes cannot effectively filter the entire image, adding additional attributes for matching is also convenient; it only requires adding code to retrieve primitive attributes in the GetEntityProps custom function.

[0112] The relevant code is as follows: (princ "\nPlease select a reference object (press Enter to end the selection):") (while (setq ent (car (entsel))) (if (setq prop (GetEntityProps ent)) (if (not (vl-some '(lambda (x) (equal x prop)) props_list)) (setq props_list (cons prop props_list))) (princ "\nUnable to retrieve object property!")) The GetEntityProps function is used to retrieve combinations of entity attributes (layer, color, linetype scale, line width).

[0113] The relevant code is as follows: (defun GetEntityProps (ent / dxf layer color ltscale lweightlayerColor) (setq dxf (entget ent)) (list Layers (setq layer (cdr (assoc 8 dxf))) ;; Color (Processed by Layer) (if (setq color (cdr (assoc 62 dxf))) color (progn (setq layerColor (cdr (assoc 62 (tblsearch "LAYER" layer)))) (if layerColor layerColor 256) ; 256=ByLayer)) Line type scale (default 1.0) (if (setq ltscale (cdr (assoc 48 dxf))) ltscale 1.0) Line width (processed by Layer) (if (setq lweight (cdr (assoc 370 dxf))) lweight -1; -1=ByLayer))) Step S4.2: Use ssget to obtain the full image objects, traverse the full image objects, and use the attribute combinations stored in the props_list in step S4.1 as the matching criteria. For each object, call the CheckPropsMatch custom function to filter all matching objects that match the attribute combination from the full image, and add the matching objects to the selection set variable ss_result.

[0114] Preferably, before using ssget to obtain the full image object, it is first determined whether the attribute combination stored in the props_list exists; if it does not exist, the process is terminated.

[0115] The relevant code is as follows: (if props_list (progn (princ "\nFiltering objects...") (if (setq ss_all (ssget "_X")) (progn (setq ss_result (ssadd)) (repeat (setq i (sslength ss_all)) (setq ent (ssname ss_all (setq i (1- i)))) (if (CheckPropsMatch ent props_list) (ssadd ent ss_result))) The CheckPropsMatch function is used to check whether an object matches any combination of properties.

[0116] The relevant code is as follows: (defun CheckPropsMatch (ent props / current_props) (setq current_props (GetEntityProps ent)) (vl-some '(lambda (x) (equal x current_props)) props)) Step S4.3: Use the sslength function to determine if there are any filter objects that match the matching attributes. If so, use the sssetfirst function to highlight and activate the matching objects in CAD, and then use the sslength function to output the number of matching objects to the console.

[0117] The `sslength` function is the core function used to obtain the number of objects in a selection set, returning the number of entities contained in the selection set. `sssetfirst` is a key function controlling the selection state in AutoCAD, used to highlight selected objects in the graphical interface.

[0118] The relevant code is as follows: (cond ((= (sslength ss_result) 0) (princ "\nNo matching object found")) (t (sssetfirst nil ss_result); Highlight the selected object. (princ (strcat "\nSelected" (itoa (sslength ss_result)) " matching objects")))).

[0119] Example of a property-driven batch selection of primitive objects: Figure 11 As shown, after the primitive objects are selected by precise batch selection, as shown... Figure 12 As shown, copying the selected graphic objects in batches with the original image is shown in the example. Figure 13 As shown.

[0120] The embodiments described above are for illustrative purposes only and are not intended to limit the invention. Therefore, any changes in numerical values ​​or substitutions of equivalent elements should still fall within the scope of this invention.

[0121] The above detailed description will enable those skilled in the art to understand that the present invention can indeed achieve the aforementioned objectives and has complied with the provisions of the Patent Law.

[0122] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention. The above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the invention should be included within the scope of protection of the invention.

[0123] It should be noted that the above description of the process is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art can make various modifications and changes to the process under the guidance of this specification. However, these modifications and changes remain within the scope of this specification.

[0124] The basic concepts have been described above. Obviously, for those skilled in the art who have read this application, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore, such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of this application.

[0125] Furthermore, this application uses specific terms to describe its embodiments. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of this application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different positions in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application can be appropriately combined.

[0126] Furthermore, those skilled in the art will understand that aspects of this application can be described and illustrated through several patentable types or situations, including any new and useful combination of processes, machines, products, or substances, or any new and useful improvements thereof. Therefore, aspects of this application can be implemented entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. All of the above hardware or software can be referred to as a “unit,” “module,” or “system.” Furthermore, aspects of this application can take the form of a computer program product embodied in one or more computer-readable media, wherein computer-readable program code is contained therein.

[0127] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this application are not intended to limit the order of the processes and methods of this application. Although some currently considered useful embodiments of the invention have been discussed in the foregoing disclosure by way of various examples, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the substance and scope of the embodiments of this application. For example, although the implementation of the various components described above can be embodied in a hardware device, it can also be implemented as a purely software solution, such as an installation on an existing server or mobile device.

[0128] Similarly, it should be noted that, in order to simplify the description of the present application and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of the embodiments of the present application sometimes combines multiple features into a single embodiment, drawing, or description thereof. However, this approach of the present application should not be construed as reflecting an intention that the claimed subject matter requires more features than expressly recited in each claim. Rather, the subject of the invention should possess fewer features than in any single embodiment described above.

Claims

1. A method for rapid rendering of 3D geological profile illustrations based on Autolisp, characterized in that, Includes the following steps: S1. Interactive rectangle positioning and fast cropping: Interact with the user to obtain the diagonal points of the rectangle, determine the four coordinates of the rectangle based on the diagonal points: minimum horizontal coordinate, maximum horizontal coordinate, minimum vertical coordinate, and maximum vertical coordinate, draw a temporary rectangle and generate a list of closed fence points based on the four coordinates, use the temporary rectangle as the boundary and the list of closed fence points as the selector to crop the outer line segments of the rectangle and obtain the preliminary cropped cross-sectional view. S2. Quickly trim upper segments of the ground line based on fence mode; Based on the preliminary cropped profile obtained in S1, the baseline is obtained through user interaction, key points of the baseline are extracted and a list of upper fence points is generated, and the upper line segments of the ground line that intersect with the list of upper fence points are cropped to obtain a simplified profile. S3. Quickly add borders; Based on the simplified cross-section obtained in S2, after turning off object snap, select the leftmost and rightmost polylines as baseline objects, extract the coordinates of the baseline endpoints, calculate the coordinates of the inner and outer borders, and draw the surface line extrapolation rectangle, inner and outer borders. After modifying the border line width attribute, restore object snap to obtain a cross-section with standard borders. S4. Attribute-driven batch selection of primitive objects: Based on the cross-sectional view with standard borders obtained in S3, the system interacts with the user to select reference objects and extract their attribute combinations. It then traverses all objects in the map to filter out objects that match the attribute combination, highlights them, and outputs the number of matches, resulting in standardized illustrations that can be directly used in reports.

2. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In S1, obtaining the diagonal points of the rectangle includes: using an interactive function to obtain the first and diagonal points of the rectangle specified by the user, determining whether the user has completed the selection, proceeding to the next step, otherwise exiting the process.

3. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In S1, generating a list of closed fence points includes: calculating one-thousandth of the distance between the diagonal points of the rectangle as the offset, and generating a list of closed fence points connected end to end in the order of top left corner → top right corner → bottom right corner → bottom left corner → top left corner based on the minimum and maximum horizontal and vertical coordinates of the rectangle.

4. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In step S2, when extracting key points of the baseline, if the baseline is a closed polyline, the tail point is deleted to remove duplicate coordinates by judging whether the first and last vertices coincide, ensuring that the generated fence point list only covers the upper area of ​​the baseline.

5. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In step S2, generating the upper fence point list includes: extracting the endpoints or vertices of the baseline, adding an offset to the coordinates of each point to obtain the initial fence points, and adding an extra offset point at the beginning and end of the fence point list to cover the endpoints of the baseline.

6. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, Drawing the border in S3 includes: calculating the length of the left and right polyline endpoints and drawing the ground line outward extension rectangle by 10 units. The distance between this rectangle and the inner border is 10 units, and the distance between the inner border and the outer border is 2 units. The line width of the outer border is set to 0.8, and the line width of the inner border and the ground line extension rectangle is set to 0.

1.

7. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In S3, disabling object snapping involves: first, obtaining and saving the initial value of the system variable for the current object snapping mode using the Autolisp getvar function, and then setting the system variable to 0 using the setvar function to disable all object snapping modes.

8. The method for rapid drawing of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, Selecting left and right polylines in S3 involves: using the entsel command to prompt the user to select the left and right polylines; using the car function to save the obtained reference object primitive name to the lineName variable; using enget to obtain the set of key-value pairs of the lineName variable that conforms to the DXF group code standard; then using the assoc function to obtain the primitive type with group code 0, and determining whether it is a polyline. If not, the process exits; finally, using a foreach loop to traverse the data with group code 10 in the primitive information to extract the vertex coordinates of the selected reference line segment, and saving the coordinates of the two endpoints of the line segment.

9. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In S4, the custom function CheckPropsMatch compares all objects in the drawing with their attribute combinations, and adds matching objects to the selection set, where the filtering range is the entire drawing.

10. The method for rapid rendering of three-dimensional geological profile illustrations based on Autolisp according to claim 1, characterized in that, In S4, extracting reference object attributes includes: obtaining the reference object's layer, color, linetype scale, and line width, and storing them as a list of attribute combinations after deduplication.

Citation Information

Patent Citations

  • A method for rapidly drawing a section map based on a CAD topographic map

    CN109035364A

  • Geological profile map three-dimensional space information extraction method and device and storage medium

    CN114898057A

  • Municipal road drawing dividing method based on Autolisp

    CN118365750A

  • Profile drawing system and method based on three-dimensional geological modeling software and AutoCAD

    CN119418000A