A method for batch generation of Civil3D marking models
Automatically generate Civil 3D marking model through programmatic methods, solving the problems of cumbersome generation of winning marking models in the existing technology and high error rate, and achieving efficient and convenient batch generation of marking models, significantly improving the efficiency and reduction of engineering projects labor costs.
Patent Information
- Application Number
- CN202311248887.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2043-09-26
AI Technical Summary
In the prior art, the generation process of Civil 3D marking model is cumbersome, time-consuming, and manual operation is prone to errors, resulting in failure in generation.
Using a programmatic method, open the DWG format road entity file through Civil3D software, obtain and set the layer parameters of the reticle file, automatically filter and generate the reticle model according to the layer name, including full solid lines, dotted lines and guide arrows to avoid Manually operate the triangular network to delete.
It greatly improves work efficiency, shortens data interaction time, reduces operation threshold and labor costs, and significantly improves the degree of automation and efficiency of model generation.
Smart Images

Figure CN117521189B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer-aided design, and more specifically, to a method for batch generating Civil3D marking models. Background Art
[0002] In modern road, bridge and tunnel engineering, computer-aided design (CAD) technology plays a key role because it can effectively generate accurate three-dimensional models. In these projects, especially for road models, there are usually a lot of line marking designs, which are too cumbersome and require a lot of time to perfect. Many projects even omit the line marking model for efficiency reasons.
[0003] In civil3D, the marking module is currently generated manually, and the process is as follows:
[0004] 1. Line marking (solid line and dotted line): create a marking component through the component editor, import it into Civil3D, select the route or feature line that has been processed and created in the marking 2D drawing as the baseline, and create the marking based on the principle of road creation. In this process, different parameters need to be set for solid lines and dotted lines in the assembly respectively, and the surface where the corresponding marking is located needs to be selected to generate the required marking type.
[0005] 2. Surface marking (guide arrow): Generate road surface from the created road, assign surface elevation to the arrow edge line in the two-dimensional drawing to generate a three-dimensional polyline, and then generate a surface as a feature line based on the principle of terrain creation. Then delete and modify the redundant surface triangulation to create a surface of the guide arrow, and finally extract the solid model of the required marking line through the solid extraction method.
[0006] Disadvantages of existing technology:
[0007] 1. The operation is cumbersome and time-consuming. It takes half a day to a day to manually implement the same model.
[0008] 2. It is easy to make mistakes when manually deleting the triangulated network, resulting in generation failure. Summary of the invention
[0009] The purpose of the present invention is to address the deficiencies of the prior art and propose a method for batch generation of Civil3D marking models. The present invention changes the existing model generation process through a programmed method, greatly improves work efficiency, eliminates tedious manual operations, and thus shortens the time required for data interaction.
[0010] The object of the present invention is achieved by the following technical solution: A method for batch generating Civil3D marking models, comprising the following steps:
[0011] Step 1: Open a road entity file in DWG format through Civil3D software and obtain a line marking file to obtain all layers in the line marking file, where each layer corresponds to a line marking type;
[0012] Step 2: Select a layer, set parameters for the currently selected layer, determine the marking spacing, marking width, and marking thickness of the current layer, and filter the layer by layer keyword to generate a marking layer;
[0013] Step 3: In the road entity file in the DWG format, pick up the road entity to which the marking layer needs to be attached according to the road entity layer name, and generate a marking model based on the currently selected road entity.
[0014] Furthermore, in step 1, the marking types include solid markings, dashed markings, and guide arrow markings.
[0015] Furthermore, in step 2, the layers are filtered by layer keywords, and the method of creating dotted lines, the method of creating guide arrows, and the method of creating solid lines are respectively executed for the data after parameter setting for different layers, thereby generating a marking layer.
[0016] Furthermore, in step 2, the specific steps for filtering layers by layer keywords are as follows: when the layer name in the imported marking file contains the string "dotted", the method for creating dotted lines is executed; when the layer name in the imported marking file contains the string "arrow", the method for creating guide arrows is executed, and in other cases, the method for creating solid lines is executed by default.
[0017] Furthermore, in step 3, when multiple road entity layer names appear, the road entity to which the marking layer needs to be attached is picked up according to the multiple road entity layer names, and the marking model is generated based on the currently selected road entity.
[0018] Mechanism of the present invention:
[0019] 1. DWG import: By importing the road entity file in dwg format, the elements in the imported file can be identified and set.
[0020] 2. Dashed line segmentation: In civil3D, dashed lines are set in a linear manner, resulting in a continuous line, but the display style is in the form of dashed lines. This will result in the inability to segment entities into pieces in the form of dashed lines when generating entities. The present invention divides the marking lines from a design perspective, customizes the spacing, and realizes the desired dashed line entity.
[0021] 3. Line conversion: The present invention realizes the properties of customized lines and their continuity according to the layer in civil3D, realizes various marking styles by processing the lines, performs geometric analysis on the graphics, and generates the entity process based on the analysis results.
[0022] Compared with the prior art, the present invention has the following advantages:
[0023] 1. Automated optimization: Through programmed operations and the use of new generation logic, generation failures when operating triangulated networks are avoided, tedious manual steps are eliminated, and the degree of automation of data generation is improved.
[0024] 2. Time benefit: The present invention shortens the time required for model generation through a programmed method, which helps to improve the efficiency of engineering projects.
[0025] 3. Convenient operation: Through the optimized process, the technical threshold of operation is lowered, allowing more engineering personnel to easily generate data. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a schematic diagram of the process of the present invention;
[0027] Figure 2 This is a schematic diagram of the interface when the user enters the selection state;
[0028] Figure 3 The interface for selecting the marking file and picking the subject Figure 1 ;
[0029] Figure 4 The interface for selecting the marking file and picking the subject Figure 2 ;
[0030] Figure 5 Schematic diagram of the interface for generating a marking model. DETAILED DESCRIPTION
[0031] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0032] The present invention uses the MVVM framework to perform front-end and back-end separation development, binds the data of the front-end View with the Model data source in the back-end viewModel in the form of bidding, and achieves the purpose of dynamically controlling the display of the front-end data by the back-end data source.
[0033] like Figure 1 As shown, the present invention provides a method for batch generating Civil3D marking models, and the specific steps are as follows:
[0034] Step 1: Start Civil3D, open a DWG format road entity file, and select the marking file after starting the program. A selection dialog box will open, and the user can select and open the marking file locally. Figure 2 As shown, after opening, all layers in the marking file will be displayed in the list box on the left. Each layer corresponds to a marking type. You can check the layer to set its attribute parameters. The parameters that need to be set will be displayed in the parameter setting panel below.
[0035] Data structure:
[0036] Declare the data structure LayEntity (the main data structure of the entity layer) in memory. The data structure contains the following:
[0037] 1. string Name layer name
[0038] 2. bool IsSelected is selected
[0039] Declare the data structure LayLine (the main data structure of the marking layer) in memory. The data structure contains the following:
[0040] 1. bool IsSelected is selected
[0041] 2. string Name layer name
[0042] 3. double RealLength: the length of the short solid line
[0043] 4. Double VisLength small space length
[0044] 5. double BxWidth marking line width
[0045] 6. Double BxThickness marking thickness
[0046] Step 2. Users can set parameters for the currently selected layer by clicking on the layer, determine the marking spacing (length of small solid lines, length of small spaces), marking width and marking thickness of the current layer, and determine the marking layer to be generated by checking the checkbox, such as Figure 2-Figure 3 As shown, the marking width is equivalent to the offset width, which will be identified based on the marking layer and is only valid for the line layer. The default value is 150mm. The marking thickness is equivalent to the offset thickness, which is 5mm by default.
[0047] The logic is as follows: filter the marking layer through the layer keyword, and pass the data after parameter setting for different layers to the methods of CreatVisualLine (create dotted line), CreatArrowLine (create guide arrow), and CreatRealLine (create solid line). The layer keyword is shown in the code below. If the layer name of the marking file imported in the previous step contains the string "virtual", the method of creating dotted lines is executed. If the layer name contains the string "arrow", the method of creating guide arrows is executed. In other cases, the method of creating solid lines is executed by default. This judgment is the internal logic of the code and does not need to be used. There is no manual operation process for users. Users only need to set parameters for each marking layer. For example, for the marking layer to generate solid lines, users do not need to set the marking spacing, because the marking spacing only exists in the dotted line layer. The program will automatically determine whether the layer is a dotted line layer based on the aforementioned keywords. If the user sets the spacing for the solid line layer, the program will not execute it but default to the method of creating solid lines to improve the fault tolerance of user operations. The underlying logic is to distinguish the three types in the marking file, namely, markings for all solid lines, markings in the form of dotted lines, and markings for closed graphics such as guide arrows. The program automatically uses three different methods to generate them.
[0048] Step 3: Figure 4-Figure 5 As shown in the figure, a road entity file has been opened in step 1. The user picks the road entity in the current file, and the layer name of the picked entity will be displayed in the list box on the right (such as Figure 2 As shown in the figure), when multiple entity layers appear, the user can select the road entity to be attached by checking the box, click Generate Line Marking, perform geometric analysis on the graphics of the line marking layer, and based on the analysis results, generate a line marking model based on the currently selected road entity.
[0049] After experimental testing, the specific effects of the present invention are as follows:
[0050] 1. Efficiency improvement: The present invention uses a programmed method to generate a 2-kilometer CAD file into a marking entity within 1 minute, which greatly improves efficiency compared to 4-6 hours of manual operation.
[0051] 2. Operation-friendly: The present invention is simple and direct to operate, with a friendly fool-style operation method, eliminating the technical threshold of operation.
[0052] 3. Reduction of labor costs: Due to the intervention of the program, not only the operational efficiency is improved, but also the labor costs are greatly reduced. The time required to generate a 2-kilometer CAD solid model is reduced from several hours or even days to a few minutes, thus significantly reducing labor costs.
[0053] In summary, the present invention greatly improves the efficiency of model generation through a rapid, efficient and friendly operation mode, while reducing labor costs and error rates, bringing significant advantages to modern road, bridge and tunnel engineering.
[0054] The above embodiments are only used to help understand the present invention. It should be noted that, for ordinary persons in the art, several modifications can be made to the present invention without departing from the principle of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for batch generation of Civil3D marking models, characterized in that: The steps include: Step 1: Open a DWG format road entity file and obtain a marking file through Civil3D software to obtain all layers in the marking file, each layer corresponding to a marking type; the marking types include solid line markings, dotted line markings and guide arrow markings; Step 2: Select a layer, set parameters for the currently selected layer, determine the marking spacing, marking width, and marking thickness of the current layer, and filter the layer by layer keyword to generate a marking layer; After setting parameters for different layers, a method for creating a dotted line, a method for creating a guide arrow, and a method for creating a solid line are respectively executed to generate a marking layer; The specific steps to filter layers by layer keywords are as follows: when the layer name in the imported marking file contains the string "dotted", the method of creating dotted lines is executed; when the layer name in the imported marking file contains the string "arrow", the method of creating guide arrows is executed, and in other cases, the method of creating solid lines is executed by default; Step 3: In the road entity file in the DWG format, pick up the road entity to which the marking layer needs to be attached according to the road entity layer name, and generate a marking model based on the currently selected road entity.
2. The method for batch generating Civil3D marking models according to claim 1, characterized in that: In step 3, when multiple road entity layer names appear, the road entity to which the marking layer needs to be attached is picked up according to the multiple road entity layer names, and the marking model is generated based on the currently selected road entity.
