CAD-based layer processing method, apparatus and device, and storage medium

Through the CAD-based layer processing method and device, the rod line is automatically divided into different layers, which solves the problem of manual reliance on rod fitting in frame-based deepening design, and improves design efficiency and accuracy.

CN120105515APending Publication Date: 2025-06-06CHINA CONSTR STEEL STRUCTURE ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510184223.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the frame-based design project, the rod erection relies on manual operation, which is time-consuming and labor-intensive, making it difficult to distinguish and automatically install rod erection in the CAD layout diagram.

Method used

Through the CAD-based layer processing method, different types of member lines are automatically divided into different layers, and the layers are named according to the labels. The layer processing devices and methods in computer equipment are used to realize the automatic installation of members.

Benefits of technology

It improves the work efficiency of designers, reduces the repeated and cumbersome rod erection work, and realizes the automation and accuracy of rod erection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120105515A_ABST
    Figure CN120105515A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of building steel structures, and discloses a CAD-based layer processing method, device and equipment and a storage medium, and the method comprises the steps: screening an initial design drawing, and obtaining lines in the initial design drawing and marking characters corresponding to the lines through screening; dividing the same type of lines and marked characters into the same selection set, traversing each object in the selection set, and determining layer information corresponding to each object; traversing each object in the selection set, screening to obtain all character objects, constructing an initial region by utilizing the character objects, and modifying names of object layers in the initial region into the character objects; and modeling based on the model data. According to the method, the lines, representing different rod pieces, of the arrangement diagram are divided into different diagram layers, the diagram layers are named according to the marks, CAD automatically divides different types of rod pieces into different diagram layers, and the problem that all rod pieces in the CAD arrangement diagram cannot be directly distinguished in the same diagram layer is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of building steel structures, and in particular to a CAD-based layer processing method, device, equipment and storage medium. Background Art

[0002] With the rapid rise of the construction industry around the world, especially the booming development of building steel structure technology, more and more buildings choose steel structures as the main frame. This trend not only improves the structural strength and earthquake resistance of buildings, but also promotes the construction industry to move towards lighter and more efficient directions. Along with this, there is a surge in frame-type in-depth design projects, which aim to further optimize the design details of steel structures and ensure the accuracy and safety of the construction process.

[0003] Compared with traditional construction projects, such as heavy industrial plants, steel structure frame detailed projects show higher visual resolution and design accuracy in drawing layout. Its characteristics are that the rods are arranged uniformly and the node connections are accurate, which not only makes it easier for construction workers to understand and operate, but also greatly improves the construction efficiency and quality of the overall project.

[0004] In the relevant technologies, the implementation process of most current framework-type deepening projects still relies heavily on manual erection and adjustment of poles. This link is not only time-consuming and labor-intensive, but also faces the problem of tight and wasteful human resources. Summary of the invention

[0005] In view of this, the present invention provides a CAD-based layer processing method, device, equipment and storage medium to solve the problem that the implementation process of framework-type deepening projects relies on manual construction.

[0006] In a first aspect, the present invention provides a layer processing method based on CAD, the method comprising:

[0007] Obtaining an initial design drawing, screening the initial design drawing, and screening out lines in the initial design drawing and annotation texts corresponding to the lines;

[0008] Divide the same type of lines and annotation text into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object;

[0009] Traverse each object in the selection set to filter out all text objects, use the text objects to construct an initial area, modify the name of the object layer in the initial area to the text object, and obtain the first drawing;

[0010] Correct the lines in the first drawing until all the lines are correct, and obtain a layer file;

[0011] The cross-sectional data corresponding to the lines are obtained, the cross-sectional data are combined with the layer file to obtain the model data, and the preset model software is used to perform modeling based on the model data to obtain the target model corresponding to the initial design drawing.

[0012] In the present invention, the lines representing different rods in the layout drawing are divided into different layers and the layers are named according to the annotations. The CAD automatically divides different types of rods into different layers, which solves the problem that all rods in the CAD layout drawing cannot be directly distinguished in the same layer, and lays the foundation for solving the problem of automatically realizing the erection of rods in the process of frame-type in-depth design modeling. Through this method, the in-depth design personnel are greatly facilitated, making them more efficient in the design process, and no longer wasting energy on repetitive and tedious rod erection work.

[0013] In an optional implementation, the same type of lines and annotation texts are divided into the same selection set, each object in the selection set is traversed, and the layer information corresponding to each object is determined, including:

[0014] Get all objects in the current selection set, assign indexes to the objects according to the order in which they appear in the current selection set, and store them in the modified selection set;

[0015] Traverse the modified selection set based on the index, obtain the layer with index 0, and determine the layer with index 0 as the current layer;

[0016] Iterate through each object in the modified selection set, and use the entget function to obtain the attribute list of each object, where the attribute list includes a key for representing the attribute name and a value for representing the attribute value of each object;

[0017] Traverse the property list, determine the layer information corresponding to each object, and set the layer to the open state.

[0018] In this method, by dividing into different selection sets, traversing the objects in the selection set, and determining the layer information corresponding to the objects, it is possible to filter the lines and the annotation text corresponding to the lines, which facilitates the subsequent use of the layer information for layer division and naming.

[0019] In an optional implementation, traversing each object in the selection set to filter out all text objects, using the text objects to construct an initial region, modifying the name of the object layer in the initial region to the text object, and obtaining a first drawing includes:

[0020] Get the number of objects in the selection set and the preset range value, where the preset range value is used to represent the maximum distance between the text object and the line object;

[0021] Traverse the property lists corresponding to all objects in the selection set to determine whether the current object is a text object;

[0022] When the current object is a text object, the coordinates and position of the current object are extracted, and the initial area is determined based on the coordinates and position;

[0023] Search for straight line objects or circle objects in the initial area, modify the names of the layers of all objects in the initial area to text objects, and obtain the first drawing.

[0024] In this method, the initial area is constructed through text objects, whether the object is within the area is determined, and the layer objects in the area are modified. This enables the change of the layer name of each rod line, which facilitates the subsequent division of the rods with different layer names, laying the foundation for the automated erection of rods in the process of in-depth design and modeling of framework-type components.

[0025] In an optional implementation, when the object in the initial area is a straight line object, the shortest distance between the text object and the line connecting the two end points of the straight line object is calculated;

[0026] Based on the shortest distance, determine whether the straight line object is in the initial area;

[0027] When the straight line object is in the initial area, the names of the layers of all objects in the initial area are modified to text objects to obtain the first drawing.

[0028] In this method, when the object is a straight line object, the shortest distance from the text object to the two end points of the straight line object is calculated to determine whether the straight line object is in the initial area, thereby achieving the division of the straight line objects in the initial area into correctly named layers.

[0029] In an optional implementation, when the object in the initial area is a circular object, the center and radius of the circular object are obtained;

[0030] Calculate the distance between the text object and the center of the circle, and determine whether the distance is within the initial area;

[0031] When the circle object is in the initial area, the names of the layers of all objects in the initial area are modified to text objects to obtain the first drawing.

[0032] In this method, when the object is a circle object, the distance from the text object to the center of the circle object is calculated to determine whether the circle object is in the initial area, thereby achieving the division of the circle object in the initial area into a correctly named layer.

[0033] In an optional implementation, the lines in the first drawing are corrected until all the lines are correct to obtain a layer file, including:

[0034] Determine whether there are incomplete selection objects or missing lines;

[0035] When the selected objects are incomplete or lines are missing, return to the step of traversing each object in the selection set to filter out all text objects until all the lines are correct and the layer file is obtained;

[0036] Determine whether the same line object in the first drawing corresponds to multiple text objects, or whether the text object is different from the annotation text;

[0037] When the same line object in the first drawing corresponds to multiple text objects and the text objects are different from the annotation texts, corrections to the line objects are obtained until all the lines are correct and a layer file is obtained.

[0038] In this method, by closing different layers to display, check whether there are omissions due to incomplete object selection and line omissions due to a small range value during the operation. The same line object has multiple TEXT objects within the range value, and the closer TEXT object is not the annotation of the line, causing the program to make an incorrect judgment and lead to incorrect division of the line layer. This ensures that all lines are correct.

[0039] In a second aspect, the present invention provides a CAD-based layer processing device, the device comprising:

[0040] The line and annotation screening module is used to obtain the initial design drawings, screen the initial design drawings, and screen the lines in the initial design drawings and the annotation texts corresponding to the lines;

[0041] The layer information determination module is used to divide the lines and annotation texts of the same type into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object;

[0042] A layer renaming module is used to traverse each object in the selection set to filter out all text objects, use the text objects to build an initial area, modify the name of the object layer in the initial area to the text object, and obtain the first drawing;

[0043] A line correction module is used to correct the lines in the first drawing until all the lines are correct, thereby obtaining a layer file;

[0044] The model building module is used to obtain the cross-sectional data corresponding to the lines, combine the cross-sectional data with the layer file to obtain the model data, use the preset model software to build the model based on the model data, and obtain the target model corresponding to the initial design drawing.

[0045] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the CAD-based layer processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the CAD-based layer processing method of the first aspect or any corresponding embodiment thereof.

[0047] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the CAD-based layer processing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 It is a flowchart of a CAD-based layer processing method according to an embodiment of the present invention.

[0050] Figure 2a is a schematic diagram of an initial drawing according to an embodiment of the present invention.

[0051] Figure 2b is a schematic diagram of a filtered drawing according to an embodiment of the present invention.

[0052] Figure 3 It is a schematic diagram of a drawing after line layering according to an embodiment of the present invention.

[0053] Figure 4 is a schematic diagram of a “dxfimport” tool interface according to an embodiment of the present invention.

[0054] Figure 5a It is a schematic diagram of a CSV file before modification according to an embodiment of the present invention.

[0055] Figure 5b It is a schematic diagram of a modified CSV file according to an embodiment of the present invention.

[0056] Figure 6 is a schematic diagram of an imported model according to an embodiment of the present invention.

[0057] Figure 7 It is a flowchart of another CAD-based layer processing method according to an embodiment of the present invention.

[0058] Figure 8 It is a flowchart of another CAD-based layer processing method according to an embodiment of the present invention.

[0059] Fig. 9 4 is a structural block diagram of a layer processing device based on CAD according to an embodiment of the present invention.

[0060] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0062] In the relevant technologies, the implementation process of most current framework-type deepening projects still relies heavily on manual erection and adjustment of poles. This link is not only time-consuming and labor-intensive, but also faces the problem of tight and wasteful human resources.

[0063] In order to solve the above problems, a CAD-based layer processing method is provided in an embodiment of the present invention, which is used in a computer device. It should be noted that its execution subject can be a CAD-based layer processing device, which can be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware. The computer device can be a terminal, a client, or a server. The server can be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer, or other intelligent hardware devices. In the following method embodiments, the execution subject is taken as an example of a computer device for explanation.

[0064] The computer device in this embodiment is suitable for use in CAD, where the lines representing different rods in the layout drawing are divided into different layers and the layers are named according to the annotations. The present invention provides a CAD-based layer processing method, which realizes the operation of dividing the lines representing different rods in the layout drawing into different layers and naming the layers according to the annotations. CAD automatically divides different categories of rods into different layers, which solves the problem that all rods in the CAD layout drawing cannot be directly realized in the same layer and cannot be distinguished, and lays the foundation for solving the problem of automatically realizing the erection of rods in the process of frame-type in-depth design modeling. Through this method, it is greatly convenient for in-depth designers to be more efficient in the design process, and no longer waste energy on repetitive and tedious rod erection work.

[0065] According to an embodiment of the present invention, a CAD-based layer processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0066] In this embodiment, a CAD-based layer processing method is provided, which can be used in the above-mentioned computer device. Figure 1 is a flow chart of a layer processing method based on CAD according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:

[0067] Step S101, obtaining an initial design drawing, screening the initial design drawing, and screening out lines in the initial design drawing and the annotation texts corresponding to the lines.

[0068] In one example, a design drawing is opened in CAD, and lines and their annotations are filtered. A line and its annotation text represented by a rod are selected.

[0069] Step S102, dividing the lines and annotation texts of the same type into the same selection set, traversing each object in the selection set, and determining the layer information corresponding to each object.

[0070] In one example, Figure 2a is a schematic diagram of an initial drawing according to an embodiment of the present invention, Figure 2b is a schematic diagram of a filtered drawing according to an embodiment of the present invention, such as Figure 2a and Figure 2b As shown, all the above-mentioned types of objects are divided into the same selection set, and all the objects in the current selection set are obtained according to the program, and the selection set is stored. After that, the layer of the first object is obtained from the selection set, and the layer is set as the current layer. Next, each object in the selection set is traversed, its layer is obtained and set to the open state. The filtered drawing is then copied to a new CAD file.

[0071] Step S103, traverse each object in the selection set to filter out all text objects, use the text objects to construct an initial area, modify the name of the object layer in the initial area to the text object, and obtain a first drawing.

[0072] In one example, the line layer name of each bar is changed. The selection set and the number of objects in the selection set are obtained through a function. After that, the user is prompted to enter a range value for subsequent spatial distance calculations. Next, all objects in the selection set are traversed, their property lists are obtained, and it is determined whether the object is a TEXT object. If so, the coordinates and position of the object are obtained, and the range of a rectangular area determined by the upper right and lower left coordinates of the object is calculated, and a straight line object or a circle object is searched within the range. For a straight line object, the shortest distance from the TEXT object to the line connecting the two end points of the straight line is calculated. For a circle object, the distance from the TEXT object to the center of the circle is calculated. If the calculated distance is within the rectangular range, the object layer is changed to the name of the TEXT object. At the same time, after traversing all objects, the number of modified layers is counted and output.

[0073] Step S104, correcting the lines in the first drawing until all the lines are correct, and obtaining a layer file.

[0074] In one example, Figure 3 is a schematic diagram of a line-layered drawing according to an embodiment of the present invention, such as Figure 3 As shown, by confirming whether there are any missing or wrong lines, the missing or wrong lines are operated again until the lines are completely correct to obtain a layer file.

[0075] Step S105, obtaining the cross-sectional data corresponding to the lines, combining the cross-sectional data with the layer file to obtain the model data, using the preset model software to perform modeling based on the model data, and obtaining the target model corresponding to the initial design drawing.

[0076] In one example, Figure 4 is a schematic diagram of a "dxfimport" tool interface according to an embodiment of the present invention, such as Figure 4 As shown, save the file through CAD and select DXF format. Use the "Tekla DXF Import" tool and click "DXF file" to import the file.

[0077] Figure 5a is a schematic diagram of a csv file before modification according to an embodiment of the present invention, Figure 5b is a schematic diagram of a modified csv file according to an embodiment of the present invention, such as Figure 5a and Figure 5bAs shown, click "Save Table", create and open the CSV file through the I / O function of C++, traverse the table data, and write the data in each cell into the file. Since the section tables of various drawing files are located in different locations and cannot be automatically read by the utility, after saving, use Excel to open the file to modify the corresponding relationship between the layer name and the section profile, manually modify it to the section type existing in the Tekla software section library, and then read the table.

[0078] Figure 6 is a schematic diagram of an imported model according to an embodiment of the present invention, such as Figure 6 As shown, click the "Import Model" button to import the model into Tekla to obtain the target model corresponding to the initial design drawing.

[0079] The CAD-based layer processing method provided in this embodiment realizes the division of the lines representing different rods in the layout drawing into different layers and the naming of the layers according to the annotations. CAD automatically divides different types of rods into different layers, which solves the problem that all rods in the CAD layout drawing cannot be directly distinguished in the same layer, and lays the foundation for solving the problem of automatically realizing the erection of rods in the process of frame-type in-depth design modeling. Through this method, the in-depth design personnel are greatly facilitated, making them more efficient in the design process, and no longer wasting energy on repetitive and tedious rod erection work.

[0080] In this embodiment, a CAD-based layer processing method is provided, which can be used in the above-mentioned computer device. Figure 7 FIG. 1 is a flowchart of another CAD-based layer processing method according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:

[0081] Step S701, obtain the initial design drawing, filter the initial design drawing, filter out the lines in the initial design drawing and the annotation texts corresponding to the lines. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0082] Step S702: divide the lines and annotation texts of the same type into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object.

[0083] Specifically, the above step S702 includes:

[0084] Step S7021, obtain all objects in the current selection set, assign indexes to the objects according to the order in which the objects appear in the current selection set, and store them in the modified selection set.

[0085] Step S7022, traverse the modified selection set based on the index, obtain the layer with index 0, and determine the layer with index 0 as the current layer.

[0086] Step S7023, traverse each object in the modified selection set, and use the entget function to obtain the attribute list of each object.

[0087] In the embodiment of the present invention, the attribute list includes a key for representing the attribute name of each object and a value for representing the attribute value.

[0088] Step S7024, traverse the attribute list, determine the layer information corresponding to each object, and set the layer to an open state.

[0089] In one example, a design drawing is opened in CAD, and lines and their annotations are filtered. Select a line and its annotation text represented by a rod, and divide all the above-mentioned types of objects into the same selection set. According to the program, all objects in the current selection set are obtained, and index values ​​are assigned according to the order in which the objects appear in the selection set, and the selection set is stored. After that, the selection set is traversed by the index of the object, and the index is 0, that is, the layer of the first object. Whether the layer is open will not affect the processing of the program, and then the layer is set as the current layer.

[0090] Next, loop through each object in the selection set and use the entget function to get the object's property list. The property list of an AutoCAD object is a list of key-value pairs, where the key is the property name (such as 0 for object type and 8 for layer) and the value is the corresponding property value. By traversing this list, you can find the required layer information. After that, look for the value associated with the layer property in the property list. Extract the value, which represents the object's layer name, get its layer and set it to on. And copy the filtered drawing to a new CAD file.

[0091] In this method, by dividing into different selection sets, traversing the objects in the selection set, and determining the layer information corresponding to the objects, it is possible to filter the lines and the annotation text corresponding to the lines, which facilitates the subsequent use of the layer information for layer division and naming.

[0092] Step S703, traverse each object in the selection set to filter out all text objects, use the text objects to construct an initial area, modify the name of the object layer in the initial area to the text object, and obtain the first drawing. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0093] Step S704: Correct the lines in the first drawing until all the lines are correct, and obtain a layer file. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0094] Step S705, obtain the cross-section data corresponding to the line, combine the cross-section data with the layer file to obtain the model data, use the preset model software to perform modeling based on the model data, and obtain the target model corresponding to the initial design drawing. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0095] The CAD-based layer processing method provided in this embodiment divides the selection sets into different ones, traverses the objects in the selection sets, determines the layer information corresponding to the objects, and implements filtering of lines and the annotation text corresponding to the lines, so as to facilitate the subsequent use of the layer information for layer division and naming.

[0096] In this embodiment, a CAD-based layer processing method is provided, which can be used in the above-mentioned computer device. Figure 8 FIG. 1 is a flowchart of another CAD-based layer processing method according to an embodiment of the present invention. Figure 8 As shown, the process includes the following steps:

[0097] Step S801, obtain the initial design drawing, filter the initial design drawing, filter out the lines in the initial design drawing and the annotation text corresponding to the lines. Figure 7 Step S701 of the illustrated embodiment will not be described in detail here.

[0098] Step S802: divide the lines and annotation texts of the same type into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object. Figure 7 Step S702 of the illustrated embodiment will not be described in detail here.

[0099] Step S803, traverse each object in the selection set to filter out all text objects, use the text objects to construct an initial area, modify the name of the object layer in the initial area to the text object, and obtain the first drawing.

[0100] Specifically, the above step S803 includes:

[0101] Step S8031, obtaining the number of objects in the selection set and the preset range value.

[0102] In the embodiment of the present invention, the preset range value is used to represent the maximum distance between the text object and the line object.

[0103] Step S8032, traverse the attribute lists corresponding to all objects in the selection set to determine whether the current object is a text object.

[0104] Step S8033, when the current object is a text object, extract the coordinates and position of the current object, and determine the initial area based on the coordinates and position.

[0105] Step S8034, searching for straight line objects or circle objects in the initial area, modifying the names of the layers of all objects in the initial area into text objects, and obtaining a first drawing.

[0106] In some optional implementations, the above step S8034 includes:

[0107] Step a1, when the object in the initial area is a straight line object, calculate the shortest distance between the text object and the line connecting the two end points of the straight line object.

[0108] Step a2: Based on the shortest distance, determine whether the straight line object is within the initial area.

[0109] Step a3, when the straight line object is in the initial area, the names of the layers of all objects in the initial area are modified to text objects to obtain a first drawing.

[0110] Step a4: when the object in the initial area is a circular object, the center and radius of the circular object are obtained.

[0111] Step a5, calculating the distance between the text object and the center of the circle, and determining whether the distance is within the initial area.

[0112] Step a6, when the circular object is in the initial area, the names of the layers of all objects in the initial area are modified to text objects to obtain a first drawing.

[0113] In one example, change the line layer name of each bar. Get the selection set obtained in the first step by implementing the ssget function and get the number of objects in the selection set by using the sslength function. After that, prompt the user to enter a range value, which is used to determine the maximum allowable distance between the text object and the line object. Next, traverse all objects in the selection set, get their attribute list, and determine whether the object is a text object by checking whether the type attribute value is "TEXT".

[0114] If it is, use the entget function to get the object's attribute list. Find the values ​​associated with the geometric attributes (such as 10, 11, etc.) in the attribute list. Extract these values, which represent the coordinates and position of the object. Calculate the range of a rectangular area determined by the upper right and lower left coordinates of the object, and search for line objects or circle objects within this range.

[0115] For a line object, calculate the shortest distance from the TEXT object to the line connecting the two end points of the line.

[0116] For the circle object, use the entget function to get the attribute list of the circle object. Find the values ​​associated with the center and radius in the attribute list. Extract these values, which represent the geometric information of the circle. The insertion point of the TEXT object can be obtained by accessing the 1 attribute in its attribute list. The center of the circle can be obtained by accessing the 10 attribute in its attribute list. Then, the distance formula between two points can be used to calculate the distance from the TEXT object to the center of the circle. Calculate the distance from the TEXT object to the center of the circle. The range of a rectangular area is usually determined by specifying two points on its diagonal (i.e., the lower left corner and upper right corner of the rectangle). If the calculated distance is within the rectangular range, the object layer is changed to the name of the TEXT object. After traversing all objects, count and output the number of modified layers.

[0117] In this method, the initial area is constructed through text objects, and it is determined whether the object is in the area. The layer objects in the area are modified, and the line layer names of each rod are changed, which is convenient for the subsequent division of rods with different layer names, laying the foundation for solving the problem of automatic rod erection in the process of frame-type in-depth design modeling. When the object is a straight line object, the shortest distance between the text object and the two end points of the straight line object is calculated to determine whether the straight line object is in the initial area, and the straight line object in the initial area is divided into the correctly named layer. When the object is a circle object, the distance from the text object to the center of the circle object is calculated to determine whether the circle object is in the initial area, and the circle object in the initial area is divided into the correctly named layer.

[0118] Step S804, correcting the lines in the first drawing until all the lines are correct, and obtaining a layer file.

[0119] In an optional implementation, the lines in the first drawing are corrected until all the lines are correct to obtain a layer file, including:

[0120] Determine whether there are incomplete selection objects or missing lines;

[0121] When the selected objects are incomplete or lines are missing, return to the step of traversing each object in the selection set to filter out all text objects until all the lines are correct and the layer file is obtained;

[0122] Determine whether the same line object in the first drawing corresponds to multiple text objects, or whether the text object is different from the annotation text;

[0123] When the same line object in the first drawing corresponds to multiple text objects and whether the text object is different from the annotation text, corrections to the line objects are obtained until all the lines are correct and a layer file is obtained.

[0124] In one example, the following problems are confirmed by turning off different layers:

[0125] 1. During the operation, are there any omissions due to incomplete selection of objects or omissions of lines due to a small range value?

[0126] 2. The same line object has multiple TEXT objects within the range value, and the TEXT object that is closer is not the annotation of the line, causing the program to make an incorrect judgment and lead to the incorrect division of the line layer.

[0127] For missed lines, the second step is repeated and the wrong lines are corrected manually until they are completely correct.

[0128] In this method, by closing different layers to display and confirm whether there are omissions due to incomplete object selection during the operation or omissions of lines due to a small range value, and / or the same line object has multiple TEXT objects within the range value, and the closer TEXT object is not the annotation of the line, causing the program to make an incorrect judgment and resulting in incorrect division of the line layer, ensuring that all lines are correct.

[0129] Step S805, obtain the cross-section data corresponding to the line, combine the cross-section data with the layer file to obtain the model data, use the preset model software to perform modeling based on the model data, and obtain the target model corresponding to the initial design drawing. Figure 7 Step S705 of the illustrated embodiment will not be described in detail here.

[0130] The CAD-based layer processing method provided in this embodiment constructs an initial area through a text object, determines whether the object is in the area, modifies the layer object in the area, and realizes changing the line layer name of each rod, which is convenient for the subsequent use of different layer names to divide the rods, and lays a foundation for solving the problem of automatic rod erection in the process of frame-type in-depth design modeling. When the object is a straight line object, the shortest distance between the text object and the two end points of the straight line object is calculated to determine whether the straight line object is in the initial area, and the straight line object in the initial area is divided into the correctly named layer. When the object is a circle object, the distance from the text object to the center of the circle object is calculated to determine whether the circle object is in the initial area, and the circle object in the initial area is divided into the correctly named layer. By closing different layer displays, it is confirmed whether there is an omission caused by incomplete selection of objects during the operation or a line omission caused by a small range value, and / or the same line object has multiple TEXT objects within the range value, and the TEXT object with a closer distance is not the annotation of the line, causing the program to make an error in judgment, resulting in an incorrect division of the line layer, ensuring that all lines are correct.

[0131] In this embodiment, a CAD-based layer processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0132] This embodiment provides a CAD-based layer processing device, such as Fig. 9 As shown, including:

[0133] The line and annotation screening module 901 is used to obtain the initial design drawings, screen the initial design drawings, and screen the lines in the initial design drawings and the annotation texts corresponding to the lines. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0134] The layer information determination module 902 is used to divide the lines and annotation texts of the same type into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0135] The layer renaming module 903 is used to traverse each object in the selection set to filter out all text objects, use the text objects to construct the initial area, modify the name of the object layer in the initial area to the text object, and obtain the first drawing. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0136] The line correction module 904 is used to correct the lines in the first drawing until all the lines are correct and a layer file is obtained. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0137] Model building module 905 is used to obtain the cross-section data corresponding to the line, combine the cross-section data with the layer file to obtain the model data, use the preset model software to build the model based on the model data, and obtain the target model corresponding to the initial design drawing. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0138] In some optional implementations, the layer information determination module 902 includes:

[0139] The index assigning unit is used to obtain all objects in the current selection set, assign indexes to the objects according to the order in which the objects appear in the current selection set, and store them in the modified selection set.

[0140] The current layer determination unit is used to traverse the modified selection set based on the index, obtain the layer with index 0, and determine the layer with index 0 as the current layer.

[0141] The attribute list acquisition unit is used to traverse each object in the selection set modified by the loop, and use the entget function to obtain the attribute list of each object, wherein the attribute list includes a key for representing the attribute name and a value for representing the attribute value of each object.

[0142] The layer information determination unit is used to traverse the attribute list, determine the layer information corresponding to each object, and set the layer to an open state.

[0143] In some optional implementations, the layer renaming module 903 includes:

[0144] The number and preset range value acquisition unit is used to acquire the number and preset range value of the objects in the selection set, and the preset range value is used to represent the maximum distance between the text object and the line object.

[0145] The text object judgment unit is used to traverse the attribute lists corresponding to all objects in the selection set to judge whether the current object is a text object.

[0146] The initial region determination unit is used to extract the coordinates and position of the current object when the current object is a text object, and determine the initial region based on the coordinates and position.

[0147] The name modification unit is used to search for straight line objects or circle objects in the initial area, modify the names of the layers of all objects in the initial area into text objects, and obtain the first drawing.

[0148] In some optional implementations, the name modification unit includes:

[0149] The shortest distance calculation subunit is used to calculate the shortest distance between the text object and the two end points of the straight line object when the object in the initial area is a straight line object.

[0150] The straight line object judgment subunit is used to judge whether the straight line object is within the initial area based on the shortest distance.

[0151] The first name modification subunit is used to modify the names of the layers of all objects in the initial area into text objects when the straight line object is in the initial area, so as to obtain a first drawing.

[0152] In some optional implementations, the name modification unit further includes:

[0153] The circle object acquisition subunit is used to acquire the center and radius of the circle object when the object in the initial area is a circle object.

[0154] The circle object judgment subunit is used to calculate the distance between the text object and the center of the circle and to judge whether the distance is within the initial area.

[0155] The second name modification subunit is used to modify the names of the layers of all objects in the initial area to text objects when the circle object is in the initial area, so as to obtain a first drawing.

[0156] In some optional implementations, the line correction module 904 includes:

[0157] The omission judgment unit is used to judge whether there is an incomplete selection object or a line omission.

[0158] The traversal return unit is used to return to the step of traversing each object in the selection set to filter out all text objects when there are incomplete selected objects or missing lines, until all the lines are correct and the layer file is obtained.

[0159] The line correspondence judgment unit is used to judge whether the same line object in the first drawing corresponds to multiple text objects, or whether the text object is different from the annotation text.

[0160] The line correction unit is used to obtain corrections to the line objects when the same line object in the first drawing corresponds to multiple text objects and whether the text objects are different from the annotation texts, until all the lines are correct and a layer file is obtained.

[0161] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0162] The CAD-based layer processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.

[0163] The embodiment of the present invention also provides a computer device having the above Fig. 9 The CAD-based layer processing device is shown.

[0164] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.

[0165] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0166] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0167] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0168] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0169] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0170] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0171] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0172] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0173] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A layer processing method based on CAD, characterized in that: The method comprises: Obtaining an initial design drawing, screening the initial design drawing, and screening out lines in the initial design drawing and annotation texts corresponding to the lines; Divide the lines and the annotation texts of the same type into the same selection set, traverse each object in the selection set, and determine the layer information corresponding to each object; Traversing each object in the selection set to filter out all text objects, using the text objects to construct an initial area, and modifying the names of the object layers in the initial area to the text objects to obtain a first drawing; Correcting the lines in the first drawing until all the lines are correct, thereby obtaining a layer file; The cross-sectional data corresponding to the lines are obtained, the cross-sectional data are combined with the layer file to obtain model data, and a preset model software is used to perform modeling based on the model data to obtain a target model corresponding to the initial design drawing.

2. The method according to claim 1, characterized in that The dividing the lines and the annotation texts of the same type into the same selection set, traversing each object in the selection set, and determining the layer information corresponding to each object includes: Get all objects in the current selection set, assign indexes to the objects according to the order in which they appear in the current selection set, and store them in the modified selection set; traversing the modified selection set based on the index, obtaining the layer with the index of 0, and determining the layer with the index of 0 as the current layer; Traverse each object in the modified selection set and use the entget function to obtain a property list of each object, wherein the property list includes a key for representing a property name and a value for representing a property value of each object; The attribute list is traversed to determine the layer information corresponding to each object, and the layer is set to an open state.

3. The method according to claim 2, characterized in that The traversing of each object in the selection set to filter out all text objects, using the text objects to construct an initial area, modifying the name of the object layer in the initial area to the text object, and obtaining a first drawing includes: Acquire the number of objects in the selection set and a preset range value, wherein the preset range value is used to represent the maximum distance between the text object and the line object; Traversing the attribute lists corresponding to all objects in the selection set to determine whether the current object is a text object; When the current object is a text object, extracting the coordinates and position of the current object, and determining the initial area based on the coordinates and position; Search for straight line objects or circle objects in the initial area, modify the names of the layers of all objects in the initial area to the text objects, and obtain the first drawing.

4. The method according to claim 3, characterized in that When the object in the initial area is a straight line object, calculating the shortest distance between the text object and the line connecting the two end points of the straight line object; Based on the shortest distance, determining whether the straight line object is within the initial area; When the straight line object is within the initial area, the names of the layers of all objects within the initial area are modified to the text objects to obtain the first drawing.

5. The method according to claim 3, characterized in that: When the object in the initial area is a circular object, obtaining the center and radius of the circular object; Calculating the distance between the text object and the center of the circle, and determining whether the distance is within the initial area; When the circular object is within the initial area, the names of the layers of all objects within the initial area are modified to the text objects to obtain the first drawing.

6. The method according to claim 1, characterized in that The correcting of the lines in the first drawing until all the lines are correct to obtain a layer file includes: Determine whether there are incomplete selection objects or missing lines; When there is a situation where the selected objects are incomplete or lines are omitted, return to the step of traversing each object in the selected set to filter and obtain all text objects until all the lines are correct and a layer file is obtained; Determining whether the same line object in the first drawing corresponds to multiple text objects, or whether the text object is different from the annotation text; When the same line object in the first drawing corresponds to multiple text objects and whether the text object is different from the annotation text, correction of the line object is obtained until all the lines are correct to obtain a layer file.

7. A layer processing device based on CAD, characterized in that: The device comprises: A line and annotation screening module is used to obtain an initial design drawing, screen the initial design drawing, and screen the lines in the initial design drawing and the annotation texts corresponding to the lines; A layer information determination module, used for dividing the lines and the annotation texts of the same type into the same selection set, traversing each object in the selection set, and determining the layer information corresponding to each object; A layer renaming module, used for traversing each object in the selection set to filter out all text objects, constructing an initial area using the text objects, and modifying the names of the object layers in the initial area to the text objects to obtain a first drawing; A line correction module, used to correct the lines in the first drawing until all the lines are correct, thereby obtaining a layer file; The model building module is used to obtain the cross-sectional data corresponding to the lines, combine the cross-sectional data with the layer file to obtain model data, and use the preset model software to perform modeling based on the model data to obtain the target model corresponding to the initial design drawing.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the CAD-based layer processing method described in any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the CAD-based layer processing method according to any one of claims 1 to 6.

10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the CAD-based layer processing method according to any one of claims 1 to 6.