[go: up one dir, main page]

CN117313331A - Method for converting Civil3D model into Revit model - Google Patents

Method for converting Civil3D model into Revit model Download PDF

Info

Publication number
CN117313331A
CN117313331A CN202311144646.2A CN202311144646A CN117313331A CN 117313331 A CN117313331 A CN 117313331A CN 202311144646 A CN202311144646 A CN 202311144646A CN 117313331 A CN117313331 A CN 117313331A
Authority
CN
China
Prior art keywords
model
civil3d
revit
format file
family
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311144646.2A
Other languages
Chinese (zh)
Other versions
CN117313331B (en
Inventor
杨远翔
张瑜
汪静
冯丽锋
苏畅
靳成风
蒋昕
杜政鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huiyuan Engineering Data Technology Co ltd
Original Assignee
Zhejiang Huiyuan Engineering Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huiyuan Engineering Data Technology Co ltd filed Critical Zhejiang Huiyuan Engineering Data Technology Co ltd
Priority to CN202311144646.2A priority Critical patent/CN117313331B/en
Publication of CN117313331A publication Critical patent/CN117313331A/en
Application granted granted Critical
Publication of CN117313331B publication Critical patent/CN117313331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04815Interaction with a metaphor-based environment or interaction object displayed as three-dimensional, e.g. changing the user viewpoint with respect to the environment or object
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/12Geometric CAD characterised by design entry means specially adapted for CAD, e.g. graphical user interfaces [GUI] specially adapted for CAD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/04Architectural design, interior design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/32Image data format

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Architecture (AREA)
  • Evolutionary Computation (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种Civil3D模型转换Revit模型的方法,包括步骤如下:项目基点得到Civil3D模型构件,配置完毕后进行批量导出,对Civil3D模型构件进行数模分离,参数和项目基点以JSON格式文件保存,模型以SAT格式文件保存;通过Revit软件读取保存路径,将SAT格式文件导入到族样板中,生成一个代理族,批量为所述代理族添加对应的JSON格式文件进行参数赋值;根据项目基点对应的坐标位置将代理族进行放置,形成Revit模型。本发明有益的效果:不仅通过程序替代手动导出SAT格式文件的操作,还在同一流程中通过程序批量导入Revit,通过这种优化,可以消除繁琐的人工操作,从而缩短了数据交互所需的时间。

The invention discloses a method for converting a Civil3D model into a Revit model, which includes the following steps: obtaining Civil3D model components from project base points, batch exporting after completion of configuration, digital-model separation of Civil3D model components, and saving parameters and project base points in JSON format files. , the model is saved in SAT format file; read the save path through Revit software, import the SAT format file into the family template, generate an agent family, and add corresponding JSON format files to the agent family in batches for parameter assignment; according to the project base point The proxy family is placed at the corresponding coordinate position to form a Revit model. The invention has beneficial effects: not only does the manual export of SAT format files replace the operation of manually exporting SAT format files through the program, but it also imports Revit in batches through the program in the same process. Through this optimization, tedious manual operations can be eliminated, thereby shortening the time required for data interaction. .

Description

一种Civil3D模型转换Revit模型的方法A method for converting Civil3D models into Revit models

技术领域Technical field

本发明涉及计算机建模技术领域,更确切地说,它涉及一种Civil3D模型转换Revit模型的方法。The present invention relates to the technical field of computer modeling, and more specifically, it relates to a method for converting a Civil3D model into a Revit model.

背景技术Background technique

在现代的路桥隧工程中,计算机辅助设计(Civil3D)技术发挥着关键作用,因为它能够有效地生成精确的三维模型。在这些项目中,通常需要将Civil3D模型导入到Revit等其他软件中,以进行进一步地分析和设计。In modern road, bridge and tunnel projects, computer-aided design (Civil3D) technology plays a key role because it can effectively generate accurate three-dimensional models. In these projects, Civil3D models usually need to be imported into other software such as Revit for further analysis and design.

在已有的方法中,提到了一种通过以下步骤进行Civil3D模型导入的方式,包括:Among the existing methods, a way to import Civil3D models through the following steps is mentioned, including:

1、手动导出SAT格式文件:工程人员需要手动将Civil3D模型导出为SAT格式文件,这个步骤需要耗费一定的时间和操作成本。1. Manually export SAT format files: Engineers need to manually export the Civil3D model to SAT format files. This step requires a certain amount of time and operating costs.

2、使用Dynamo进行导入:工程人员在Revit中使用Dynamo工具,连接到预先编写好的电池包(脚本),然后通过操作来实现导入。然而,这个过程可能会因为Dynamo的通用性封装以及复杂的操作流程而变得相对冗长。2. Import using Dynamo: Engineers use the Dynamo tool in Revit, connect to the pre-written battery pack (script), and then implement the import through operations. However, this process may become relatively lengthy due to Dynamo's universal encapsulation and complex operation process.

3、点击导入:在连接到电池包后,工程人员需要手动执行导入命令,从而将Civil3D模型数据批量导入Revit中。3. Click Import: After connecting to the battery pack, engineers need to manually execute the import command to import Civil3D model data into Revit in batches.

现有技术仅能通过Dynamo进行操作,由于Dynamo是对API的通用封装,适用于多种项目环境,导致运行时间较长且操作复杂,限制了工程人员的操作效率。具体地,由于需要对Civil3D导出的SAT格式文件进行处理,因此操作流程必须保持统一规范:导出SAT格式文件后立即导入Revit;然而,采用这种方法可能在实际操作中会变得繁琐,容易出错。另外,可能存在每个图层含有大量构件的情况,这可能导致更新进度条时出现屏幕假死状态,影响用户体验。The existing technology can only be operated through Dynamo. Since Dynamo is a universal encapsulation of APIs and is suitable for a variety of project environments, it results in long running time and complex operations, which limits the operating efficiency of engineering personnel. Specifically, since the SAT format files exported by Civil3D need to be processed, the operation process must remain unified and standardized: import the SAT format files into Revit immediately after exporting; however, using this method may become cumbersome and error-prone in actual operations. . In addition, each layer may contain a large number of components, which may cause the screen to freeze when updating the progress bar, affecting the user experience.

为了提高工程人员的工作效率,需要一种更有效的方法来实现Civil3D模型到Revit的快速导入。In order to improve the work efficiency of engineering personnel, a more effective method is needed to quickly import Civil3D models into Revit.

发明内容Contents of the invention

本发明的目的是针对现有技术的不足,提出了一种Civil3D模型转换Revit模型的方法,不仅通过程序替代手动导出SAT格式文件的操作,还在同一流程中通过程序批量导入Revit,通过这种优化,可以消除繁琐的人工操作,从而缩短了数据交互所需的时间。The purpose of this invention is to address the shortcomings of the existing technology and propose a method for converting Civil3D models to Revit models, which not only replaces the manual export of SAT format files through programs, but also imports Revit in batches through programs in the same process. Through this Optimization can eliminate tedious manual operations, thereby shortening the time required for data interaction.

本发明的目的是通过如下技术方案来完成的。一种Civil3D模型转换Revit模型的方法,包括:The object of the present invention is achieved through the following technical solutions. A method for converting Civil3D models to Revit models, including:

步骤1、通过Civil3D软件根据图层进行构件分组,对每个分组的构件逐一配置参数和项目基点得到Civil3D模型构件,配置完毕后进行批量导出,对Civil3D模型构件进行数模分离,参数和项目基点以JSON格式文件保存,模型以SAT格式文件保存;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. After the configuration is completed, perform batch export and perform digital-analog separation of Civil3D model components. Parameters and project base points Save as a JSON format file, and the model as a SAT format file;

步骤2、通过Revit软件读取保存路径,将SAT格式文件导入到族样板中,生成一个代理族,批量为所述代理族添加对应的JSON格式文件进行参数赋值;Step 2. Read the save path through Revit software, import the SAT format file into the family template, generate an agent family, and add corresponding JSON format files to the agent family in batches for parameter assignment;

步骤3、根据项目基点对应的坐标位置将代理族进行放置,形成Revit模型。Step 3. Place the proxy family according to the coordinate position corresponding to the project base point to form a Revit model.

更进一步地,步骤1中,对所有构件的唯一编码的集合进行分组,分组的键是以每个构件的图层进行分组,将构件本身作为键值对的值,最后得到一个数据字典。Furthermore, in step 1, the uniquely coded set of all components is grouped. The grouping key is grouped by 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.

更进一步地,步骤2中,对于每个图层的构件,将SAT格式文件导入到族样板中,然后解析图形几何,基于解析图形几何的结果生成一个代理族;根据SAT格式文件的文件名找到与其匹配的JSON格式文件,将JSON格式文件中的参数赋值给所述代理族。Furthermore, in step 2, for the components of each layer, import the SAT format file into the family template, then analyze the graphic geometry, and generate a proxy family based on the results of the analyzed graphic geometry; find it according to the file name of the SAT format file Match the JSON format file and assign the parameters in the JSON format file to the agent family.

更进一步地,当根据SAT格式文件的文件名找不到每个图层对应的JSON格式文件时,则通过手动指定路径来完成导入。Furthermore, when the JSON format file corresponding to each layer cannot be found based on the file name of the SAT format file, the import is completed by manually specifying the path.

更进一步地,当根据SAT格式文件的文件名找到每个图层对应的JSON格式文件时,将JSON格式文件打开,手动修改每个图层包含的参数信息;将修改后的JSON格式文件反序列化解析为动态数组,完成参数更新。Furthermore, when the JSON format file corresponding to each layer is found according to the file name of the SAT format file, open the JSON format file and manually modify the parameter information contained in each layer; deserialize the modified JSON format file. It is parsed into a dynamic array and the parameters are updated.

本发明的机理:Mechanism of the invention:

1、Civil3D模型构件分组导出流程的方法和实现:本发明通过Civil3D软件根据图层进行构件分组与SAT格式文件(模型文件)导出结合,通过批量处理和图层关联,实现了批量导出每个图层所包含构件的SAT格式文件的流程。1. Method and implementation of the Civil3D model component grouping and export process: The present invention combines the component grouping according to layers with the export of SAT format files (model files) through Civil3D software, and realizes the batch export of each figure through batch processing and layer association. The process of SAT format files of components contained in the layer.

2、Revit中的自动导入、解析和代理族生成:本发明在Revit中实现了自动化的SAT格式文件(模型文件)导入、图形几何解析,以及基于解析结果生成代理族的过程。对于每个图层的构件,程序会根据内部的族样板自动进行SAT导入,然后自动解析图形几何。随后,基于图形几何再次生成一个代理族,模拟了Dynamo不开源的内置电池包。此过程同时包括对应的JSON格式文件的查找,如果存在,会将参数赋值给该代理族,如果不存在则不进行操作。2. Automatic import, analysis and generation of agent families in Revit: The present invention realizes the process of automatic import of SAT format files (model files), graphic geometry analysis, and generation of agent families based on the analysis results in Revit. For the components of each layer, the program will automatically import SAT based on the internal family template, and then automatically analyze the graphic geometry. Subsequently, an agent family was generated again based on the graphic geometry, simulating Dynamo's unopened built-in battery pack. This process also includes searching for the corresponding JSON format file. If it exists, the parameters will be assigned to the agent family. If it does not exist, no operation will be performed.

3、与Dynamo类似的内置电池包模拟:通过在Revit中模拟Dynamo内置电池包的功能,本发明实现了对特定任务的优化。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 realizes the optimization of specific tasks.

4、参数赋值与JSON格式文件的关联:根据JSON格式文件对生成的代理族进行参数赋值,这一连接点体现了创新性和实际应用的价值。4. Association between parameter assignment and JSON format file: Parameter assignment is performed on the generated agent family based on the JSON format file. This connection point reflects the value of innovation and practical application.

本发明与现有技术相比,具有以下优点:Compared with the prior art, the present invention has the following advantages:

1、快速图层匹配导入:本发明通过程序化方法,使1000个构件的Civil3D文件导入SAT格式文件只需5分钟内完成,相较于1-2小时的手动操作以及1-2小时的Dynamo导入,效率极大提升。1. Fast layer matching and import: This invention uses a programmed method to import Civil3D files with 1000 components into SAT format files in only 5 minutes, compared with 1-2 hours of manual operation and 1-2 hours of Dynamo Import, the efficiency is greatly improved.

2、显著节约时间:在传统工作中,处理1000个构件的Civil3D文件需要2-4小时,而在本发明下,仅需数分钟。考虑到项目中需要处理大量图纸,通常需要3-4天的人力。本发明能显著减少时间成本,同时降低了错误风险。2. Significant time saving: In traditional work, it takes 2-4 hours to process a Civil3D file with 1,000 components, but under the present invention, it only takes a few minutes. Considering the large number of drawings that need to be processed in the project, it usually requires 3-4 days of manpower. The invention can significantly reduce time costs and reduce the risk of errors.

3、操作友好性:本发明不仅支持通过Dynamo进行操作,还为不熟悉Dynamo的工程人员提供了友好的傻瓜式操作方式,消除了操作的技术门槛。3. Operation friendliness: The present invention not only supports operation through Dynamo, but also provides a friendly fool-like operation method for engineers who are not familiar with Dynamo, eliminating the technical threshold of operation.

4、人工成本削减:由于程序的介入,不仅提高了操作效率,还大幅降低了人工成本。处理1000个构件的Civil3D文件所需时间从几小时甚至几天减少至几分钟,从而显著降低了人力成本。4. Labor cost reduction: Due to the intervention of the program, not only the operating efficiency is improved, but the labor cost is also significantly reduced. The time required to process a Civil3D file of 1,000 components is reduced from hours or even days to minutes, thus significantly reducing labor costs.

5、高度的自动化:本发明实现了对Civil3D模型到Revit模型的高度自动化导入,极大地减少了繁琐的手动操作,从而使工程人员能更专注于更高价值的任务,提升整体工作效率。5. High degree of automation: This invention realizes a highly automated import of Civil3D models into Revit models, greatly reducing tedious manual operations, thereby enabling engineering personnel to focus more on higher-value tasks and improving overall work efficiency.

附图说明Description of the drawings

图1为本发明的流程示意图;Figure 1 is a schematic flow diagram of the present invention;

图2为用户进入选择状态时的界面示意图;Figure 2 is a schematic diagram of the interface when the user enters the selection state;

图3为图层的分组进行独立的参数配置时的界面示意图;Figure 3 is a schematic diagram of the interface when grouping layers for independent parameter configuration;

图4为配置基点的界面示意图;Figure 4 is a schematic diagram of the interface for configuring base points;

图5为以SAT格式文件保存的界面示意图;Figure 5 is a schematic diagram of the interface for saving files in SAT format;

图6为通过Revit软件读取保存路径的界面示意图;Figure 6 is a schematic diagram of the interface for reading the save path through Revit software;

图7为根据SAT格式文件的文件名找到与其文件名匹配的JSON格式文件的界面示意图;Figure 7 is a schematic diagram of the interface for finding a JSON format file matching its file name based on the file name of the SAT format file;

图8为Revit模型的界面示意图。Figure 8 is a schematic diagram of the interface of the Revit model.

具体实施方式Detailed ways

下面结合附图和实施例对本发明做进一步描述。The present invention will be further described below in conjunction with the accompanying drawings and examples.

实施例:Example:

本发明提供了一种Civil3D模型转换Revit模型的方法,以MVVM框架进行前后端分离开发,将前端View的数据以biding的形式与后端viewModel中的Model数据源进行绑定,达到后端数据源动态控制前端数据展示的目的,具体流程示意图如图1所示:The present invention provides a method for converting a Civil3D model into a Revit model, using the MVVM framework for separate front-end and back-end development, and binding the data of the front-end View to the Model data source in the back-end viewModel in the form of bidding to achieve the back-end data source. The purpose of dynamically controlling front-end data display, the specific process diagram is shown in Figure 1:

步骤1、通过Civil3D软件根据图层进行构件分组,对每个分组的构件逐一配置参数和项目基点得到Civil3D模型构件,配置完毕后进行批量导出,对Civil3D模型构件进行数模分离,参数和项目基点以JSON格式文件保存,模型以SAT格式文件保存。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. After the configuration is completed, perform batch export and perform digital-analog separation of Civil3D model components. Parameters and project base points Save it as a JSON format file and the model as a SAT format file.

1、如图2所示,用户启动时进入选择状态,选择完毕后将选中的构件以图层分组并显示在面板上;1. As shown in Figure 2, the user enters the selection state when starting. After the selection is completed, the selected components are grouped into layers and displayed on the panel;

数据结构:data structure:

在内存中声明数据结构LayerModel(用于展示与管理的主要数据结构),数据结构包含如下:Declare the data structure LayerModel (the main data structure used for display and management) in memory. The data structure includes the following:

①string RfaInputName族名称①string RfaInputName family name

②bool isCheck是否选中② bool isCheck is selected?

③string layerName图层名称③string layerName layer name

④List<ObjectId>Ids该图层包含的多个构件的id的集合④List<ObjectId>Ids is a collection of IDs of multiple components contained in this layer.

⑤List<ParaGroupModel>paraGroupModels参数类型组(文本,数据,常规)⑤List<ParaGroupModel>paraGroupModels parameter type group (text, data, regular)

⑥ParaGroupModel SelectedParaGroupModel当前选择的参数类型⑥ParaGroupModel SelectedParaGroupModel currently selected parameter type

在内存中声明数据结构BasePointModel(项目基点的数据结构),数据结构包含如下:Declare the data structure BasePointModel (the data structure of the project base point) in memory. The data structure includes the following:

①double x①double x

②double y②double y

③double z③double z

在内存中声明数据结构ParaGroupModel(参数类型组的数据结构),数据结构包含如下:Declare the data structure ParaGroupModel (data structure of parameter type group) in memory. The data structure includes the following:

①string name名字① string name name

②ObservableCollection<ParaModel>paraModels参数集合②ObservableCollection<ParaModel>paraModels parameter collection

在内存中声明数据结构ParaModel(参数类型组的数据结构),数据结构包含如下:Declare the data structure ParaModel (data structure of parameter type group) in memory. The data structure includes the following:

①string paraName参数名①string paraName parameter name

②string paraValue参数值②string paraValue parameter value

分组的逻辑:通过Linq(参考微软官方文档对Linq的名词解释)将用户获取的所有构件的id的集合进行Groupby分组(参考微软官方文档对Groupby的名词解释),分组操作只使用了Linq语法中的Groupby方法,指的是通过这种方法,将拥有相同属性的构件进行分组。分组的键是以每个构件的图层进行分组,将构件本身作为键值对的值,分组操作中声明的键是string类型,值是objectid类型,最后得到一个dictionary<string,objectid>的字典。Grouping logic: Group the set of IDs of all components obtained by the user through Linq (refer to the noun explanation of Linq in Microsoft official documents). The grouping operation only uses Linq syntax. The Groupby method refers to grouping components with the same properties through this method. The grouping key is grouped by 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 of dictionary<string,objectid> is obtained. .

在窗口实例化前对窗口的viewModel里的layerModels集合进行数据构造,构造的数据类型见上文数据结构。Before instantiating the window, perform data construction on the layerModels collection in the window's viewModel. The constructed data type is shown in the data structure above.

2、用户逐一为每个分组的构件配置参数和项目基点勾选后,设置当前的要编辑的图层,逻辑如下:勾选后将当前ViewModel中的缓冲数据SelecedLayerModel设置为当前传进方法里的layerModel并刷新数据源,可通过参数分组类型下拉框选择要设置的参数的分组,并可分别对该图层的该分组进行独立的参数配置,如图3所示。2. After the user configures parameters and project base points for each grouped component one by one, set the current layer to be edited. The logic is as follows: After checking, the buffered data SelectedLayerModel in the current ViewModel is set to the currently passed in method. layerModel and refresh the data source, you can select the group of parameters to be set through the parameter grouping type drop-down box, and you can configure independent parameters for this group of the layer, as shown in Figure 3.

点击项目基点部分的设置弹出窗口:点击添加后将基点配置到右侧面板上,并将数据结构BasePointModel以JSON格式存在本地,并且可对已配置好的基点进行编辑或删除,配置完成后点击确定,如图4所示。Click the setting pop-up window of the project base point part: click Add to configure the base point on the right panel, and save the data structure BasePointModel locally in JSON format, and you can edit or delete the configured base point. After the configuration is completed, click OK ,As shown in Figure 4.

配置好项目基点后,可手动将点击保存参数,将layerModels数据源保存到本地JSON格式文件,当下次还需要使用该参数时可点击更新参数将JSON反序列化为layermodels重新赋值给viewModel下的layerModels数据源达成动态更新效果。具体地,①用户在操作界面配置参数完成后,或者不配置参数,程序后台会生成一个变量名为layerModels,类型为LayerModel的动态数组。并将其通过JSON序列化的方式保存到本地路径下。②用户可以自行在本地路径下找到每个图层对应的JSON格式文件(参数文件),并通过记事本打开后可以手动修改每个图层包含的参数信息。③点击更新参数,程序将自动读取该路径下的参数文件,程序会进行JSON格式的反序列化解析为变量名为layerModels,类型为LayerModel的动态数组,重新更新到软件中,完成参数更新操作。After configuring the project base point, you can manually click to save the parameters and save the layerModels data source to a local JSON format file. When you need to use the parameters next time, you can click to update the parameters to deserialize the JSON into layermodels and reassign them to layerModels under the viewModel. The data source achieves dynamic update effect. Specifically, ① After the user configures parameters on the operation interface, or does not configure parameters, 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. ② Users can find the JSON format file (parameter file) corresponding to each layer in the local path, and after opening it through Notepad, they can manually modify the parameter information contained in each layer. ③ Click Update Parameters, and the program will automatically read the parameter file under the path. The program will deserialize and parse the JSON format into a dynamic array with variable name layerModels and type LayerModel, and then update it to the software again to complete the parameter update operation. .

其中,layerModels中的数据结构均包含上述提到的数据结构(如族的名字,图层信息,构建信息等)。Among them, the data structures in layerModels include the data structures mentioned above (such as family names, layer information, construction information, etc.).

3、点击批量导出,程序将再次自动保存参数到本地,并将构件的所有ids以图层分组导出到本地为SAT格式,文件的名称为图层名称,保存路径在“我的文档”里,如图5所示。尽管每个图层含有大量构件的情况不常见,本发明确保在这种情况下,Revit的内置操作面板将显示每个小构件生成的进度条。用户可以通过监控这些小进度条的变化来判断假死状态是否仍在继续,从而提高在处理复杂情况时的操作可控性和反馈机制。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 in layer groups. The name of the file is the layer name, and the saving path is in "My Documents". As shown in Figure 5. Although it is uncommon for each layer to contain a large number of components, the present invention ensures that in this case, Revit's built-in operation panel will display the progress bar generated by each small component. Users can monitor changes in these small progress bars to determine whether the state of suspended animation is still continuing, thereby improving operational controllability and feedback mechanisms when dealing with complex situations.

将构件以SAT的形式导出Export components as SAT

Civil3DDataContext.Editor.Command("Export",path,SelectionSet.FromObjectIds(layerModel.Ids.ToArray()),"");Civil3DDataContext.Editor.Command("Export",path,SelectionSet.FromObjectIds(layerModel.Ids.ToArray()),"");

Path路径以SAT结尾。Path ends with SAT.

需要说明的是:导出的SAT通过后台以记事本的方式打开,在其第三行的第一个字符1后面添加000,达到修改单位的目的。It should be noted that the exported SAT is opened in Notepad in the background, and 000 is added after the first character 1 in the third line to modify the unit.

步骤2、通过Revit软件读取保存路径,将SAT格式文件导入到族样板中,生成一个代理族,批量为所述代理族添加对应的JSON格式文件进行参数赋值。其中,族样板是指包含在软件目录里的Revit内置样板文件,相当于载入SAT格式文件的载体。代理族相当于是一个替换了导入Revit中的SAT格式文件的程序自动生成的族文件(族文件是指以SAT格式文件导入进程序族样板后,再导入进Revit的文件),程序生成的代理族是Revit软件的内部能够识别出来具有参数信息的内部模型,能够进行材质赋予等操作。Step 2. Read the save path through Revit software, import the SAT format file into the family template, generate an agent family, and add corresponding JSON format files to the agent family in batches for parameter assignment. Among them, 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 a program that replaces the SAT format file imported into Revit (the family file refers to the file that is imported into Revit after the SAT format file is imported into the program family template). The proxy family generated by the program It is the internal model of Revit software that can identify the internal model with parameter information, and can perform operations such as material assignment.

1、通过Revit软件读取保存路径的界面如图6所示,程序根据SAT格式文件的名字找到与其名字匹配的JSON格式文件(参数文件)如图7所示,使工程人员能够在遵循操作手册的情况下,更有效地处理导出的SAT格式文件并在Revit中导入。通过设计,即使出现导入时找不到SAT格式文件的情况,工程人员也可以通过手动指定路径来完成导入,从而保持操作的灵活性和稳定性。1. The interface for reading the save path through Revit software is shown in Figure 6. The program finds the JSON format file (parameter file) matching its name based on the name of the SAT format file, as shown in Figure 7, so that engineers can follow the operation manual. case, more efficiently handle exported SAT format files and import in Revit. Through design, even if the SAT format file cannot be found during import, engineers can complete the import by manually specifying the path, thereby maintaining the flexibility and stability of the operation.

2、点击开始录入,通过RevitApi中SATImportOptions的导出设置,将SAT导入到族环境下,并获取其GeoemtryElement并通过解析几何得到其solid属性,把对solid(solid:参考欧克特官方对RevitAPI中solid类型的定义,本发明的solid:指的是对导入的SAT格式文件,进行解析图形几何得到的SAT格式文件本身的几何体信息,solid可以理解为一个几何体信息的载体)进行FreeFormElement元素的构件,将其图纸转化为Revit内部模型,保证模型可以被赋予材质。2. Click to start input, and import SAT into the family environment through the export settings of SATImportOptions in RevitApi, and obtain its GeoemtryElement and obtain its solid attribute through analytical geometry. The definition of type, solid in this invention: refers to the geometry information of the SAT format file itself obtained by analyzing the graphic geometry of the imported SAT format file. Solid can be understood as a carrier of geometry information) and is a component of the FreeFormElement element. The drawings are converted into Revit internal models to ensure that the models can be assigned materials.

需要说明的是:由于导入SAT格式文件后,revit会将该SAT格式文件解析为“导入符号”,它是不具有任何图形几何信息的,只具有查看的功能,不可以对它赋予材质等操作。本发明将导入的SAT格式文件,进行解析图形几何,得到它的solid后,通过RevitAPI提供的FreeFormElement方法,新建一个代理族,并通过程序自动删除导入的SAT格式文件。It should be noted that after importing a SAT format file, Revit will parse the SAT format file into an "imported symbol". It does not have any graphic geometry information and only has the function of viewing. It cannot be assigned materials or other operations. . The present invention analyzes the graphic geometry of the imported SAT format file, and after obtaining its solid, creates a new agent family through the FreeFormElement method provided by Revit API, and automatically deletes the imported SAT format file through the program.

步骤3、添加参数完成后,根据项目基点对应的坐标位置将代理族进行放置,形成Revit模型。具体为:通过解析到的参数文件JSON中的数据对该族进行参数赋值后,通过解析本地项目基点basePointModel获取族的项目基点并进行放置,形成Revit模型如图8所示。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, the project base point of the family is obtained by parsing the local project base point basePointModel and placed, forming a Revit model as shown in Figure 8.

综上,本发明通过编程来替代繁琐的手动操作和复杂的Dynamo连接步骤,从而实现更快速、简化的Civil3D模型批量导入Revit的过程。通过这种改进,旨在有效地节约时间,提高工程人员的操作效率,并为Civil3D数据交互带来创新性的解决方案。In summary, the present invention replaces tedious 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 aims to effectively save time, improve the operating efficiency of engineering personnel, and bring innovative solutions to Civil3D data interaction.

上述实施例的说明只是用于帮助理解本发明。应当指出,对于本技术领域的普通人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The description of the above embodiments is only used to assist understanding of the present invention. It should be pointed out that for those skilled 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 protection scope of the claims of the present invention.

Claims (5)

1.一种Civil3D模型转换Revit模型的方法,其特征在于,包括:1. A method for converting a Civil3D model into a Revit model, which is characterized by including: 步骤1、通过Civil3D软件根据图层进行构件分组,对每个分组的构件逐一配置参数和项目基点得到Civil3D模型构件,配置完毕后进行批量导出,对Civil3D模型构件进行数模分离,参数和项目基点以JSON格式文件保存,模型以SAT格式文件保存;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. After the configuration is completed, perform batch export and perform digital-analog separation of Civil3D model components. Parameters and project base points Save as a JSON format file, and the model as a SAT format file; 步骤2、通过Revit软件读取保存路径,将SAT格式文件导入到族样板中,生成一个代理族,批量为所述代理族添加对应的JSON格式文件进行参数赋值;Step 2. Read the save path through Revit software, import the SAT format file into the family template, generate an agent family, and add corresponding JSON format files to the agent family in batches for parameter assignment; 步骤3、根据项目基点对应的坐标位置将代理族进行放置,形成Revit模型。Step 3. Place the proxy family according to the coordinate position corresponding to the project base point to form a Revit model. 2.根据权利要求1所述的Civil3D模型转换Revit模型的方法,其特征在于,步骤1中,对所有构件的唯一编码的集合进行分组,分组的键是以每个构件的图层进行分组,将构件本身作为键值对的值,最后得到一个数据字典。2. The method for converting a Civil3D model into a Revit model according to claim 1, characterized in that, in step 1, the uniquely coded collection of all components is grouped, and the grouping key is grouped by the layer of each component, Use the component itself as the value of the key-value pair, and finally get a data dictionary. 3.根据权利要求2所述的Civil3D模型转换Revit模型的方法,其特征在于,步骤2中,对于每个图层的构件,将SAT格式文件导入到族样板中,然后解析图形几何,基于解析图形几何的结果生成一个代理族;根据SAT格式文件的文件名找到与其匹配的JSON格式文件,将JSON格式文件中的参数赋值给所述代理族。3. The method for converting a Civil3D model into a Revit model according to claim 2, characterized in that 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 analyzed, and based on the analysis The result of the graphic geometry generates an agent family; according to the file name of the SAT format file, a matching JSON format file is found, and the parameters in the JSON format file are assigned to the agent family. 4.根据权利要求3所述的Civil3D模型转换Revit模型的方法,其特征在于,当根据SAT格式文件的文件名找不到每个图层对应的JSON格式文件时,则通过手动指定路径来完成导入。4. The method for converting a Civil3D model into a Revit model according to claim 3, 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, it is completed by manually specifying the path. Import. 5.根据权利要求3所述的Civil3D模型转换Revit模型的方法,其特征在于,当根据SAT格式文件的文件名找到每个图层对应的JSON格式文件时,将JSON格式文件打开,手动修改每个图层包含的参数信息;将修改后的JSON格式文件反序列化解析为动态数组,完成参数更新。5. The method for converting a Civil3D model into a Revit model according to claim 3, 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 each file is manually modified. Parameter information contained in each layer; deserialize and parse the modified JSON format file into a dynamic array to complete the parameter update.
CN202311144646.2A 2023-09-06 2023-09-06 Method for converting Civil3D model into Revit model Active CN117313331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311144646.2A CN117313331B (en) 2023-09-06 2023-09-06 Method for converting Civil3D model into Revit model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311144646.2A CN117313331B (en) 2023-09-06 2023-09-06 Method for converting Civil3D model into Revit model

Publications (2)

Publication Number Publication Date
CN117313331A true CN117313331A (en) 2023-12-29
CN117313331B CN117313331B (en) 2024-12-17

Family

ID=89272861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311144646.2A Active CN117313331B (en) 2023-09-06 2023-09-06 Method for converting Civil3D model into Revit model

Country Status (1)

Country Link
CN (1) CN117313331B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721903A (en) * 2021-08-05 2021-11-30 安徽建工建筑工业有限公司 Prefabricated part model modeling method based on Revit and Dynamo
CN114936390A (en) * 2022-03-22 2022-08-23 中国建筑第八工程局有限公司 Method for calculating actual pile length of engineering pile based on Dynamo visual programming
CN116542067A (en) * 2023-05-17 2023-08-04 周圣文 Modeling method for digital twin water plant
EP4223951A1 (en) * 2022-02-03 2023-08-09 Saqib Hashim Aziz Multifunctional system and method for constructing building parts and method for optimisation thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721903A (en) * 2021-08-05 2021-11-30 安徽建工建筑工业有限公司 Prefabricated part model modeling method based on Revit and Dynamo
EP4223951A1 (en) * 2022-02-03 2023-08-09 Saqib Hashim Aziz Multifunctional system and method for constructing building parts and method for optimisation thereof
CN114936390A (en) * 2022-03-22 2022-08-23 中国建筑第八工程局有限公司 Method for calculating actual pile length of engineering pile based on Dynamo visual programming
CN116542067A (en) * 2023-05-17 2023-08-04 周圣文 Modeling method for digital twin water plant

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张洪伟;庞维福;: "连续梁-钢桁组合桥BIM建模技术研究", 铁路技术创新, no. 05, 30 October 2018 (2018-10-30), pages 46 - 50 *

Also Published As

Publication number Publication date
CN117313331B (en) 2024-12-17

Similar Documents

Publication Publication Date Title
CN110825369A (en) Method for automatically generating codes based on java language
US9104810B2 (en) Creating a test case
CN106844190B (en) Test script automatic generation method and device
CN106569801A (en) Complex parameter-based configuration display control system
CN100474318C (en) Automatic generation system for designing BOM
CN102779037B (en) A kind of automatic generation and the unified visual programming method safeguarding java project
CN105677875A (en) Visual modeling platform based on unified constraint of normal data elements
CN110968294B (en) Business domain model establishing system and method
CN114816374A (en) Visual data analysis process modeling method and system
CN107122171A (en) Automatically generate the method and system of data manipulation in operation flow
CN101604286B (en) Method for generating keyword-driving table
CN104063231B (en) Test resource rapid access method based on HIT-TENA
CN114610649A (en) Instruction tracking test method, system, equipment and medium
CN118760485A (en) State machine model construction method, operation method, operation device and storage medium
CN114048188A (en) A system and method for data migration across databases
CN113919158A (en) Simulation method and device for flight control panel and storage medium
CN117313331A (en) Method for converting Civil3D model into Revit model
CN109902085B (en) A configuration storage structure optimization method and system
CN114911466B (en) Data quality control system of acquisition terminal
CN113297083B (en) Cross-platform IC test method, device, equipment and medium
CN103530122B (en) Programmable instrument standard command generation method based on graphical interface
CN115203162A (en) A WYSIWYG Graph Data Construction Method
CN114968207A (en) A BIOS-oriented BS agile development method
CN114020751A (en) Big data platform management system, method, equipment and storage medium
CN113761857B (en) A form processing method and device based on form designer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant