A method for converting Civil3D model to Revit model
Through programmatic methods, the import process of Civil 3D models is automatically processed in Civil 3D and Revit, and the problems of cumbersome and low efficiency in the existing technology are solved, and the rapid and simplified model import is realized, which significantly improves the work efficiency of engineers and User experience.
Patent Information
- Application Number
- CN202311144646.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-09-06
AI Technical Summary
In the prior art, the import process of Civil 3D model to Revit model is cumbersome and inefficient. It requires manual export of SAT format files and importing them through Dynamo, resulting in complex operations, time-consuming and error-prone, affecting the work efficiency of engineers.
Through programmatic methods, group components according to layers and batch export of SAT format files in Civil 3D, automatically import and parse graphic geometry in Revit, generate proxy families, and assign parameters through JSON format files to realize the automated process of batch import of Revit models.
It significantly shortens the data interaction time from hours to minutes, reduces labor costs and error risks, improves operational efficiency and user experience, and supports higher value task allocation.
Smart Images

Figure CN117313331B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer modeling, and more specifically, to a method for converting a Civil3D model into a Revit model. Background Art
[0002] In modern road, bridge and tunnel engineering, computer-aided design (Civil3D) technology plays a key role because it can effectively generate accurate 3D models. In these projects, Civil3D models usually need to be imported into other software such as Revit for further analysis and design.
[0003] In the existing method, a method of importing a Civil3D model is mentioned through the following steps, including:
[0004] 1. Manually export SAT format files: Engineers need to manually export Civil3D models to SAT format files. This step takes a certain amount of time and operation costs.
[0005] 2. Import using Dynamo: Engineers use the Dynamo tool in Revit, connect to a pre-written battery pack (script), and then import through operations. However, this process may become relatively lengthy due to Dynamo's universal encapsulation and complex operation process.
[0006] 3. Click Import: After connecting to the battery pack, engineers need to manually execute the import command to batch import Civil3D model data into Revit.
[0007] The existing technology can only be operated through Dynamo. Since Dynamo is a universal encapsulation of API and is applicable to a variety of project environments, it takes a long time to run and is complex to operate, which limits the efficiency of engineers. Specifically, since the SAT format file exported from Civil3D needs to be processed, the operation process must be kept uniform and standardized: import the SAT format file immediately after exporting it to Revit; however, this method may become cumbersome and prone to errors in actual operation. In addition, there may be a situation where each layer contains a large number of components, which may cause the screen to freeze when updating the progress bar, affecting the user experience.
[0008] In order to improve the work efficiency of engineers, a more effective method is needed to quickly import Civil3D models into Revit. 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 converting a Civil3D model to a Revit model. The method not only replaces the manual export of SAT format files through a program, but also batch imports Revit through the program in the same process. Through this optimization, tedious manual operations can be eliminated, thereby shortening the time required for data interaction.
[0010] The object of the present invention is achieved through the following technical solution: A method for converting a Civil3D model into a Revit model, comprising:
[0011] Step 1: Use Civil3D software to group components according to layers, configure parameters and project base points for each grouped component one by one to obtain Civil3D model components, and export them in batches after configuration is completed. Separate the digital and analog components of the Civil3D model components, save the parameters and project base points in JSON format files, and save the model in SAT format files;
[0012] Step 2: read the save path through Revit software, import the SAT format file into the family template, generate a proxy family, and add the corresponding JSON format file to the proxy family in batches to assign parameters;
[0013] Step 3: Place the proxy family according to the coordinate position corresponding to the project base point to form a Revit model.
[0014] Furthermore, in step 1, the sets of unique codes of all components are grouped, the key of the grouping is to group the layer of each component, and the component itself is used as the value of the key-value pair, and finally a data dictionary is obtained.
[0015] Furthermore, in step 2, for the components of each layer, the SAT format file is imported into the family template, and then the graphic geometry is parsed, and a proxy family is generated based on the results of parsing the graphic geometry; according to the file name of the SAT format file, a JSON format file matching it is found, and the parameters in the JSON format file are assigned to the proxy family.
[0016] Furthermore, when the JSON format file corresponding to each layer cannot be found according to the file name of the SAT format file, the import is completed by manually specifying the path.
[0017] Furthermore, when the JSON format file corresponding to each layer is found according to the file name of the SAT format file, the JSON format file is opened, and the parameter information contained in each layer is manually modified; the modified JSON format file is deserialized and parsed into a dynamic array to complete the parameter update.
[0018] Mechanism of the present invention:
[0019] 1. Method and implementation of Civil3D model component grouping export process: The present invention combines component grouping according to layers with SAT format file (model file) export through Civil3D software, and realizes the process of batch exporting SAT format files of components contained in each layer through batch processing and layer association.
[0020] 2. Automatic import, parsing and proxy family generation in Revit: The present invention implements the process of automated SAT format file (model file) import, graphic geometry parsing, and proxy family generation based on the parsing results in Revit. For the components of each layer, the program automatically performs SAT import according to the internal family template, and then automatically parses the graphic geometry. Subsequently, a proxy family is generated again based on the graphic geometry, simulating the built-in battery pack of Dynamo that is not open source. This process also includes the search for the corresponding JSON format file. If it exists, the parameters will be assigned to the proxy family. If it does not exist, no operation will be performed.
[0021] 3. Simulation of built-in battery pack similar to Dynamo: By simulating the function of Dynamo's built-in battery pack in Revit, the present invention achieves optimization for specific tasks.
[0022] 4. Association between parameter assignment and JSON format file: Parameters of the generated proxy family are assigned according to the JSON format file. This connection point reflects the value of innovation and practical application.
[0023] Compared with the prior art, the present invention has the following advantages:
[0024] 1. Fast layer matching import: The present invention uses a programmatic method to import a Civil3D file of 1,000 components into a SAT format file in just 5 minutes, which greatly improves efficiency compared to 1-2 hours of manual operation and 1-2 hours of Dynamo import.
[0025] 2. Significant time savings: In traditional work, it takes 2-4 hours to process a Civil3D file of 1,000 components, but with the present invention, it only takes a few minutes. Considering that a large number of drawings need to be processed in a project, it usually takes 3-4 days of manpower. The present invention can significantly reduce time costs and reduce the risk of errors.
[0026] 3. Operation-friendliness: The present invention not only supports operation through Dynamo, but also provides a friendly fool-proof operation mode for engineers who are not familiar with Dynamo, eliminating the technical threshold of operation.
[0027] 4. Reduction of labor costs: Due to the intervention of the program, not only the operation efficiency is improved, but also the labor costs are greatly reduced. The time required to process a Civil3D file with 1,000 components is reduced from several hours or even days to a few minutes, thus significantly reducing labor costs.
[0028] 5. High degree of automation: The present invention realizes highly automated import of Civil3D models into Revit models, greatly reducing tedious manual operations, thereby allowing engineers to focus more on higher value tasks and improve overall work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the process of the present invention;
[0030] Figure 2 This is a schematic diagram of the interface when the user enters the selection state;
[0031] Figure 3 Schematic diagram of the interface for configuring independent parameters for layer groups;
[0032] Figure 4 This is a schematic diagram of the interface for configuring base points;
[0033] Figure 5 This is a schematic diagram of the interface saved in SAT format;
[0034] Figure 6 This is a schematic diagram of the interface for reading the save path through Revit software;
[0035] Figure 7 A schematic diagram of an interface for finding a JSON format file that matches a SAT format file's file name;
[0036] Figure 8 This is a schematic diagram of the Revit model interface. DETAILED DESCRIPTION
[0037] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0038] Example:
[0039] The present invention provides a method for converting a Civil3D model into a Revit model. The method uses the MVVM framework for 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. The specific process diagram is shown in FIG. Figure 1 As shown:
[0040] Step 1: Use Civil3D software to group components according to layers, configure parameters and project base points for each grouped component one by one to obtain Civil3D model components, and export them in batches after configuration. Separate the digital and analog parts of the Civil3D model components, save the parameters and project base points in JSON format files, and save the models in SAT format files.
[0041] 1. If Figure 2 As shown, the user enters the selection state when starting, and after the selection is completed, the selected components are grouped into layers and displayed on the panel;
[0042] Data structure:
[0043] Declare the data structure LayerModel in memory (the main data structure for display and management), which contains the following:
[0044] ① string RfaInputName family name
[0045] ②bool isCheck whether it is selected
[0046] ③string layerName layer name
[0047] ④List <objectid>Ids: A collection of ids of multiple components contained in this layer
[0048] ⑤List <paragroupmodel>paraGroupModels parameter type group (text, data, general)
[0049] ⑥ParaGroupModel SelectedParaGroupModel currently selected parameter type
[0050] Declare the data structure BasePointModel (data structure of the project base point) in memory. The data structure contains the following:
[0051] ①double x
[0052] ②double y
[0053] ③double z
[0054] Declare the data structure ParaGroupModel (data structure of parameter type group) in memory. The data structure contains the following:
[0055] ① string name
[0056] ②ObservableCollection <paramodel>paraModels parameter collection
[0057] Declare the data structure ParaModel (data structure of parameter type group) in memory. The data structure contains the following:
[0058] ① string paraName parameter name
[0059] ② string paraValue parameter value
[0060] Grouping logic: Use Linq (refer to Microsoft's official documentation for the definition of Linq) to group the set of all component IDs obtained by the user (refer to Microsoft's official documentation for the definition of Groupby). The grouping operation only uses the Groupby method in Linq syntax, which means that components with the same properties are grouped in this way. The key of the grouping is to group the layer of each component, and the component itself is used as the value of the key-value pair. The key declared in the grouping operation is of string type, and the value is of objectid type. Finally, a dictionary is obtained.<string,objectid> Dictionary.
[0061] Before the window is instantiated, the layerModels collection in the window's viewModel is constructed. The constructed data type is shown in the data structure above.
[0062] 2. After the user configures the parameters and project base points for each group of components one by one, set the current layer to be edited. The logic is as follows: After checking, set the buffered data SelecedLayerModel in the current ViewModel to the layerModel in the current method and refresh the data source. You can select the group of parameters to be set through the parameter group type drop-down box, and you can configure the parameters of the group of the layer independently, such as Figure 3 shown.
[0063] Click the Settings pop-up window of the project base point section: Click Add to configure the base point on the right panel, and save the data structure BasePointModel in JSON format locally. You can edit or delete the configured base point. After the configuration is completed, click OK. Figure 4 shown.
[0064] After configuring the project base point, you can manually click Save Parameters to save the layerModels data source to a local JSON format file. When you need to use the parameter next time, you can click Update Parameters to deserialize the JSON into layermodels and reassign it to the layerModels data source under viewModel to achieve a dynamic update effect. Specifically, ① After the user completes the parameter configuration in the operation interface, or does not configure the parameter, the program background will generate a dynamic array with a variable name of layerModels and a type of LayerModel. And save it to the local path through JSON serialization. ② The user can find the JSON format file (parameter file) corresponding to each layer in the local path by himself, and open it with Notepad to manually modify the parameter information contained in each layer. ③ Click Update Parameters, the program will automatically read the parameter file under the path, and the program will perform JSON format deserialization and parse it into a dynamic array with a variable name of layerModels and a type of LayerModel, and re-update it to the software to complete the parameter update operation.
[0065] Among them, the data structures in layerModels all contain the data structures mentioned above (such as family name, layer information, construction information, etc.).
[0066] 3. Click Batch Export, the program will automatically save the parameters to the local again, and export all the ids of the components to the local in SAT format by layer group. The file name is the layer name, and the save path is in "My Documents", such as Figure 5 As shown. Although it is not common for each layer to contain a large number of components, the present invention ensures that in this case, the built-in operation panel of Revit will display the progress bar of each small component generation. The user can determine whether the suspended state is still continuing by monitoring the changes of these small progress bars, thereby improving the controllability and feedback mechanism of the operation when dealing with complex situations.
[0067] Export the component as SAT
[0068] Civil3DDataContext.Editor.Command("Export",path,SelectionSet.FromObjectIds(layerModel.Ids.ToArray()),"");
[0069] The Path ends with SAT.
[0070] It should be noted that the exported SAT is opened in the background as Notepad, and 000 is added after the first character 1 in the third line to achieve the purpose of modifying the unit.
[0071] Step 2. Read the save path through the Revit software, import the SAT format file into the family template, generate a proxy family, and add the corresponding JSON format files to the proxy family in batches for parameter assignment. Among them, the family template refers to the Revit built-in template file contained in the software directory, which is equivalent to the carrier for loading SAT format files. The proxy family is equivalent to a family file automatically generated by the program that replaces the SAT format file imported into Revit (the family file refers to the file that is imported into the program family template after the SAT format file is imported into Revit). The proxy family generated by the program is an internal model with parameter information that can be recognized by the Revit software, and can perform operations such as material assignment.
[0072] 1. The interface for reading the save path through Revit software is as follows Figure 6 As shown, the program finds the JSON format file (parameter file) that matches the name of the SAT format file according to its name. Figure 7 As shown, engineers can more effectively process the exported SAT format files and import them into Revit by following the operation manual. By design, even if the SAT format file cannot be found during import, engineers can complete the import by manually specifying the path, thus maintaining the flexibility and stability of the operation.
[0073] 2. Click Start Input, import SAT into the family environment through the export settings of SAT Import Options in Revit API, obtain its GeoemtryElement and obtain its solid properties through analytical geometry, and make solid (solid: refer to the official definition of solid type in Revit API by Ocute, the solid of the present invention: refers to the geometric information of the SAT format file itself obtained by parsing the graphic geometry of the imported SAT format file, solid can be understood as a carrier of geometric information) a component of FreeFormElement element, and convert its drawings into Revit internal models to ensure that the model can be assigned materials.
[0074] It should be noted that after importing the SAT format file, Revit will parse the SAT format file into an "import symbol", which does not have any graphic geometry information and only has the function of viewing, and cannot be assigned materials and other operations. The present invention parses the imported SAT format file for graphic geometry, obtains its solid, and then creates a new proxy family through the FreeFormElement method provided by RevitAPI, and automatically deletes the imported SAT format file through the program.
[0075] Step 3: After adding parameters, place the proxy family according to the coordinate position corresponding to the project base point to form a Revit model. Specifically: after assigning parameters to the family through the data in the parsed parameter file JSON, parse the local project base point basePointModel to obtain the family's project base point and place it to form a Revit model. Figure 8 shown.
[0076] In summary, the present invention replaces cumbersome manual operations and complex Dynamo connection steps through programming, thereby achieving a faster and simplified process of batch importing Civil3D models into Revit. Through this improvement, it is intended to effectively save time, improve the operating efficiency of engineers, and bring innovative solutions to Civil3D data interaction.
[0077] 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.< / paramodel> < / paragroupmodel> < / objectid>
Claims
1. A method for converting a Civil3D model to a Revit model, characterized in that: include: Step 1: Use Civil3D software to group components according to layers, configure parameters and project base points for each grouped component one by one to obtain Civil3D model components, and export them in batches after configuration is completed. Separate the digital and analog components of the Civil3D model components, save the parameters and project base points in JSON format files, and save the model in SAT format files; Step 2: read the save path through Revit software, import the SAT format file into the family template, generate a proxy family, and add the corresponding JSON format file to the proxy family in batches to assign parameters; For each layer of components, the SAT format file is imported into the family template, and then the graphic geometry is parsed, and a proxy family is generated based on the result of parsing the graphic geometry; a JSON format file matching the SAT format file is found according to the file name of the SAT format file, and the parameters in the JSON format file are assigned to the proxy family; Step 3: Place the proxy family according to the coordinate position corresponding to the project base point to form a Revit model.
2. The method for converting a Civil3D model to a Revit model according to claim 1, characterized in that: In step 1, the uniquely coded sets of all components are grouped, the grouping key is to group the layer of each component, and the component itself is used as the value of the key-value pair, and finally a data dictionary is obtained.
3. The method for converting a Civil3D model to a Revit model according to claim 1, characterized in that: When the JSON format file corresponding to each layer cannot be found according to the file name of the SAT format file, the import is completed by manually specifying the path.
4. The method for converting a Civil3D model to a Revit model according to claim 1, characterized in that: When the JSON format file corresponding to each layer is found according to the file name of the SAT format file, the JSON format file is opened and the parameter information contained in each layer is manually modified; the modified JSON format file is deserialized and parsed into a dynamic array to complete the parameter update.
