Method, device and electronic equipment for converting revit model to sketchup model and readable medium
By identifying solid components in a Revit model, extracting layers, face sets, material and color data, and generating Ruby script files, the problem of data loss when converting a Revit model to a SketchUp model is solved, achieving efficient and accurate model conversion.
Patent Information
- Application Number
- CN202510323195.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-03-19
AI Technical Summary
Existing technologies often result in the loss of color, material, and layer data when converting Revit models to SketchUp models, leading to model distortion and impacting work efficiency.
By identifying solid components in the Revit model view, a set of solid components is generated. The component layers, face sets, materials, and colors are parsed to form a component dataset. A Ruby script file is then generated. The script is loaded and executed in the SketchUp modeling environment to automatically generate the corresponding SketchUp model.
It preserves the model's color, material, and layer data to the greatest extent possible, ensuring the model's integrity and accuracy without requiring additional modifications, thus improving conversion efficiency.
Smart Images

Figure CN120277763B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of BIM technology, and in particular to a method for converting a Revit model to a SketchUp model, an apparatus for converting a Revit model to a SketchUp model, an electronic device, and a computer-readable medium. Background Technology
[0002] Revit and SketchUp are two widely used software programs for architectural design and modeling. Revit, as a BIM software, excels at building parametric models containing rich architectural information, while SketchUp is known for its intuitive and easy-to-use interface and powerful push-pull modeling capabilities, and is often used for schematic design and model presentation.
[0003] SketchUp provides a powerful Ruby console that allows users to manipulate and extend SketchUp's functionality by writing Ruby scripts, enabling tasks beyond its native features such as automated design and model generation.
[0004] In real-world projects, it's often necessary to convert Revit models to SketchUp models for rendering and animation. Currently, due to the differences in modeling logic and data formats between the two software programs, intermediate formats such as IFC, DWG, and DXF are commonly used for conversion. However, this often results in the loss of data such as colors, materials, and layers, and even distortion of component models, impacting work efficiency. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a method for converting a Revit model to a SketchUp model that overcomes or at least partially solves the above problems, and a corresponding apparatus for converting a Revit model to a SketchUp model, an electronic device, and a computer-readable medium.
[0006] This invention discloses a method for converting a Revit model to a SketchUp model, the method comprising:
[0007] Identify components in the Revit model view that meet the entity criteria and generate a set of entity components;
[0008] The entity component set is parsed to extract the component layers, face sets, and the material, color, and vertex sets of the faces, forming a component dataset;
[0009] Generate Ruby script files based on the component dataset;
[0010] Load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model.
[0011] Optionally, identify components in the Revit model view that meet the entity criteria, and generate a set of entity components, including:
[0012] Collect the current model file of the Revit model and the files linked to the Revit model;
[0013] The system iterates through the components in the current model file of the Revit model and the files linked to the Revit model, filters out non-solid components using preset rules, and forms a set of solid components.
[0014] Optionally, the components in the current model file of the Revit model and the files linked to the Revit model are traversed, and non-solid components are filtered out according to preset rules to form a set of solid components, including:
[0015] The solidity of a component is verified by its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component.
[0016] And / or,
[0017] Filter by component type: Filter components of view type or annotation type.
[0018] Optionally, the set of entity components is parsed to extract component layers, face sets, and the material, color, and vertex sets of the faces, forming a component dataset, including:
[0019] Iterate through each component in the entity component set, extract the component's category name, and set the category name as the corresponding component's layer attribute;
[0020] Analyze the 3D solid structure of the component, obtain all the faces contained in the 3D solid structure, and get the face set;
[0021] Based on the face set, extract the face material, color, and vertex set; wherein, if the component belongs to the pipeline type, the material of the component is the corresponding material in the preset material library matched according to the pipeline system classification;
[0022] The component dataset is composed of component layers, face sets, and face materials, colors, and vertex sets.
[0023] Optionally, based on the component dataset, a Ruby script file is generated, including:
[0024] Create a string of variable characters, and add base classes and methods to the string of variable characters according to Ruby script syntax; the base classes and methods include the ElementObject class, Point collection conversion function, coordinate to point set conversion function, material conversion function, edge softening function, and component generation function;
[0025] Extract the component layer, face set, and face material, color, and vertex set from the component dataset. Convert the component layer, face set, and face material, color, and vertex set according to Ruby script syntax and add them to the string of the variable character.
[0026] Save the added string as a Ruby script file.
[0027] The present invention also discloses an apparatus for converting a Revit model to a SketchUp model, the apparatus comprising:
[0028] The solid component recognition module is used to identify components in the Revit model view that meet the solid conditions and generate a set of solid components;
[0029] The component data extraction module is used to parse the set of entity components, extract the component layers, face sets, and the material, color, and vertex sets of the faces to form a component dataset;
[0030] The Ruby script file generation module is used to generate Ruby script files based on the component dataset;
[0031] The SketchUp model generation module is used to load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model.
[0032] Optionally, the entity component recognition module includes:
[0033] The Revit model file collection submodule is used to collect the current model file of the Revit model and the files linked to the Revit model;
[0034] The non-solid component filtering submodule is used to traverse the components in the current model file of the Revit model and the files linked to the Revit model, and filter non-solid components according to preset rules to form a set of solid components.
[0035] Optionally, the non-solid component filtering submodule includes:
[0036] The first non-solid component filtering unit is used to verify the solidity of a component through its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component.
[0037] And / or,
[0038] The second non-physical component filtering unit is used to filter by component type: filtering components of view type or annotation type.
[0039] Optionally, the component data extraction module includes:
[0040] The layer extraction submodule is used to traverse each component in the entity component set, extract the category name of the component, and set the category name as the layer attribute of the corresponding component;
[0041] The face extraction submodule is used to parse the 3D solid structure of the component, obtain all the faces contained in the 3D solid structure, and obtain a face set;
[0042] The surface data extraction submodule is used to extract the material, color, and vertex set of the surface based on the surface set; wherein, if the component belongs to the pipeline type, the material of the component is the corresponding material in the preset material library matched according to the pipeline system classification;
[0043] The component dataset generation submodule is used to combine component layers, face sets, and face materials, colors, and vertex sets into a component dataset.
[0044] Optionally, the Ruby script file generation module includes:
[0045] Add submodules to the basic classes and methods to create strings with variable characters, and add basic classes and methods to the strings with variable characters according to Ruby script syntax; the basic classes and methods include the ElementObject class, Point collection conversion function, coordinate to point set conversion function, material conversion function, edge softening function, and component generation function;
[0046] The component data addition submodule is used to extract the component layer, face set, and face material, color, and vertex set from the component dataset, respectively, and convert the component layer, face set, and face material, color, and vertex set according to Ruby script syntax and add them to the variable character string;
[0047] The Ruby script file generation submodule is used to save the added string as a Ruby script file.
[0048] The present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0049] The memory is used to store computer programs;
[0050] When the processor executes the program stored in the memory, it implements the method for converting a Revit model to a SketchUp model as described in this invention.
[0051] The present invention also discloses one or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method for converting a Revit model to a SketchUp model as described in the present invention.
[0052] This invention has the following advantages:
[0053] The method for converting Revit models to SketchUp models according to this invention identifies components in the Revit model view that meet the entity criteria and generates a set of entity components. This completes the screening of entity components in the Revit model. Furthermore, it extracts the layers, face sets, material, color, and vertex sets of the entity components to form a component dataset, thus completing the extraction of component data required for model conversion. A Ruby script file is generated based on the component dataset and loaded and executed in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model. This method can retain key data such as color, material, and layers of the model to the greatest extent, ensuring the integrity and accuracy of the model, thereby eliminating the need for additional manual intervention and improving the efficiency of model conversion. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating the steps of a method for converting a Revit model to a SketchUp model according to an embodiment of the present invention.
[0055] Figure 2 This is an example diagram illustrating the effect of generating a SketchUp model according to an embodiment of the present invention;
[0056] Figure 3 This is an example diagram of the code for adding basic data in an embodiment of the present invention;
[0057] Figure 4 This is an example diagram of the code for converting vertex Point set data according to an embodiment of the present invention;
[0058] Figure 5 This is an example diagram of the code for generating face data using ElementObject in an embodiment of the present invention;
[0059] Figure 6 This is an example diagram of the code saved as a Ruby script file according to an embodiment of the present invention;
[0060] Figure 7 This is a structural block diagram of a device for converting a Revit model to a SketchUp model according to an embodiment of the present invention;
[0061] Figure 8 This is a block diagram of an electronic device provided in an embodiment of the present invention;
[0062] Figure 9 This is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed Implementation
[0063] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0064] Reference Figure 1 The diagram illustrates a flowchart of a method for converting a Revit model to a SketchUp model according to an embodiment of the present invention, which may specifically include the following steps:
[0065] Step 101: Identify components in the Revit model view that meet the entity conditions and generate a set of entity components;
[0066] Step 102: Parse the set of entity components, extract the component layers, face sets, and the material, color, and vertex sets of the faces to form a component dataset;
[0067] Step 103: Generate a Ruby script file based on the component dataset;
[0068] Step 104: Load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model.
[0069] This invention first filters components in the Revit model view, automatically identifying and generating a set of solid components based on geometric entity conditions (such as building components like walls, floors, doors, and windows), effectively excluding non-solid elements such as 2D annotations and symbols. Then, each component in the set undergoes in-depth analysis: the Revit layer name to which the component belongs is extracted, the geometric face set of the component is decomposed, the vertex coordinate data of each face is accurately obtained, and the material name and color parameters of the face are extracted, forming a component dataset containing geometric information and attribute data. After data extraction, data conversion is performed. Based on the SketchUp Ruby API interface specification, the component dataset is converted into an executable Ruby script file. When the generated Ruby script runs in SketchUp, it can perform modeling operations item by item according to the component dataset, automatically generating a 3D model with consistent geometry, matching materials and colors, and corresponding layer structure to the Revit model. Figure 2This image shows an example of the generated SketchUp model. Compared to the problems of material loss and layer flattening caused by exporting and importing common formats (such as IFC or DWG), this method directly extracts the original model parameters and reconstructs them procedurally, achieving a high degree of fidelity in the integrity and accuracy of the components in the converted SketchUp model. This method can be used in scenarios such as architectural scheme visualization and construction briefings, providing design teams with a lightweight SketchUp model that can be used directly without manual repairs, significantly improving cross-platform collaboration efficiency.
[0070] In an optional embodiment of the present invention, identifying components in the Revit model view that meet the entity conditions and generating a set of entity components includes:
[0071] Collect the current model file of the Revit model and the files linked to the Revit model;
[0072] The system iterates through the components in the current model file of the Revit model and the files linked to the Revit model, filters out non-solid components using preset rules, and forms a set of solid components.
[0073] In this embodiment, the FilteredElementCollector is used to retrieve all Documents from the Revit model, forming a Document collection. This Document collection includes not only the current Revit model file but also all files linked to the model. After collecting the files, each Document in this collection is traversed, and all entity components within it are extracted and aggregated into an entity component set. This ensures that all possible components are considered, regardless of whether they exist in the current model or in linked external models.
[0074] In an optional embodiment of the present invention, the components in the current model file of the Revit model and the files linked to the Revit model are traversed, and non-solid components are filtered out according to preset rules to form a set of solid components, including:
[0075] The solidity of a component is verified by its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component.
[0076] And / or,
[0077] Filter by component type: Filter components of view type or annotation type.
[0078] In this embodiment, when traversing the components in the current model file and linked files of the Revit model, two methods can be used to filter the components to generate a set of solid components that meet the entity conditions:
[0079] Method 1: When traversing components, obtain the 3D solid attribute (Solid) and face of each component. If a component's Solid attribute is empty, meaning the component does not have actual 3D geometry, then the component is determined to be a non-solid component and excluded from the solid component set. This method ensures that only components with actual 3D geometry are retained by directly verifying the component's geometric attributes.
[0080] Method 2: When traversing components, filter by the component's type attribute to exclude view type and annotation type components. These types of components are usually used for view annotations, symbols, or 2D representations and do not have actual entity attributes, therefore they do not meet the criteria for entity components. This method can quickly filter out non-entity components that do not need to be processed, improving processing efficiency.
[0081] By combining the two methods described above, components that meet the entity conditions can be efficiently selected to form a set of entity components, providing an accurate data foundation for subsequent model processing and analysis.
[0082] In an optional embodiment of the present invention, the set of entity components is parsed to extract component layers, face sets, and the material, color, and vertex sets of the faces, forming a component dataset, including:
[0083] Iterate through each component in the entity component set, extract the component's category name, and set the category name as the corresponding component's layer attribute;
[0084] Analyze the 3D solid structure of the component, obtain all the faces contained in the 3D solid structure, and get the face set;
[0085] Based on the face set, extract the face material, color, and vertex set; wherein, if the component belongs to the pipeline type, the material of the component is the corresponding material in the preset material library matched according to the pipeline system classification;
[0086] The component dataset is composed of component layers, face sets, and face materials, colors, and vertex sets.
[0087] In this embodiment, the set of entity components is traversed, and each component is processed sequentially to extract and construct a component dataset. The specific steps are as follows:
[0088] 1. Obtain the component and its layer attributes:
[0089] Traverse the set of entity components to obtain each component. Then, obtain the category name of the component and set it as the layer attribute of the component. This ensures that the components can be divided into layers according to their categories (such as walls, floors, pipes, etc.), which facilitates subsequent classification management and analysis.
[0090] 2. Analyze the geometric structure of the components:
[0091] The `get_Geometry` method is used to obtain the 3D solid structure of the component and the faces that make up the solid. By parsing this geometric data, all faces contained in the component are extracted to form a face set.
[0092] 3. Extract the attribute information of the face:
[0093] Based on the face set, the material, color, and vertex set (Point set) of each face are further extracted. For pipeline type components, the material is matched with the corresponding material from the preset material library according to MEPSystemType.
[0094] 4. Construct the component dataset:
[0095] The extracted component layers, face sets, materials, colors, and vertex sets are combined to form a component dataset.
[0096] Through the above steps, this embodiment achieves a comprehensive analysis of the set of solid components, extracts the key geometric and attribute information of the components, and organizes them into a structured component dataset, providing reliable data support for subsequent model conversion.
[0097] In an optional embodiment of the present invention, generating a Ruby script file based on the component dataset includes:
[0098] Create a string of variable characters, and add base classes and methods to the string of variable characters according to Ruby script syntax; the base classes and methods include the ElementObject class, Point collection conversion function, coordinate to point set conversion function, material conversion function, edge softening function, and component generation function;
[0099] Extract the component layer, face set, and face material, color, and vertex set from the component dataset. Convert the component layer, face set, and face material, color, and vertex set according to Ruby script syntax and add them to the string of the variable character.
[0100] Save the added string as a Ruby script file.
[0101] In this embodiment, the process of generating Ruby script files from the component dataset is as follows:
[0102] 1. Create a mutable string:
[0103] Use StringBuilder to create a mutable string named RubyString, which can be used to dynamically construct Ruby script content.
[0104] 2. Add basic classes and methods:
[0105] In accordance with Ruby script file format requirements, basic data is added to the RubyString string, including defining the ElementObject class, Point collection conversion functions, coordinate to point set conversion functions, material conversion functions, edge softening functions, and component generation functions. These basic classes and methods provide necessary support for subsequent component data processing. Figure 3 Example image of code for adding basic data.
[0106] 3. Extract and convert material data:
[0107] Extract all material data from the component dataset, and convert the material data into the corresponding format in the Ruby script according to the Ruby script file format requirements (e.g., convert material names, color values, etc. into Ruby variables or hash tables), and add it to the string RubyString.
[0108] 4. Convert other component data:
[0109] Iterate through the component dataset, sequentially retrieving the layers, face sets, colors, and vertex sets for each component. Based on the Ruby script file format requirements, convert this component data to the corresponding Ruby script format (e.g., convert the vertex set to a Ruby array, and the material and color to Ruby property assignment statements), and add it to the RubyString string. Figure 4 Example code diagram for transforming data in the Point collection.
[0110] 5. Generate surface data:
[0111] According to the Ruby script file format requirements, add ElementObject to the RubyString string to generate face data, that is, convert the face set of the component into code to generate geometric faces in the Ruby script, so as to ensure that the geometric information of the component can be correctly reconstructed. Figure 5 Example code diagram for generating face data for ElementObject.
[0112] 6. Save as a Ruby script file:
[0113] The final constructed string (RubyString) is saved as a Ruby script file. This script file contains all the transformation and generation logic for the component data and can be directly used for reconstruction in an environment that supports Ruby scripts. Figure 6 Example image of code saved as a Ruby script file.
[0114] Through the above steps, this embodiment can convert a component dataset into a Ruby script file.
[0115] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0116] Reference Figure 7 The diagram illustrates a structural block diagram of a device for converting a Revit model to a SketchUp model according to an embodiment of the present invention, which may specifically include the following modules:
[0117] The solid component identification module 701 is used to identify components in the Revit model view that meet the solid conditions and generate a set of solid components;
[0118] The component data extraction module 702 is used to parse the set of entity components, extract the component layers, face sets, and the material, color, and vertex sets of the faces to form a component dataset;
[0119] Ruby script file generation module 703 is used to generate Ruby script files based on the component dataset;
[0120] The SketchUp model generation module 704 is used to load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model.
[0121] Optionally, the entity component recognition module includes:
[0122] The Revit model file collection submodule is used to collect the current model file of the Revit model and the files linked to the Revit model;
[0123] The non-solid component filtering submodule is used to traverse the components in the current model file of the Revit model and the files linked to the Revit model, and filter non-solid components according to preset rules to form a set of solid components.
[0124] Optionally, the non-solid component filtering submodule includes:
[0125] The first non-solid component filtering unit is used to verify the solidity of a component through its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component.
[0126] And / or,
[0127] The second non-physical component filtering unit is used to filter by component type: filtering components of view type or annotation type.
[0128] Optionally, the component data extraction module includes:
[0129] The layer extraction submodule is used to traverse each component in the entity component set, extract the category name of the component, and set the category name as the layer attribute of the corresponding component;
[0130] The face extraction submodule is used to parse the 3D solid structure of the component, obtain all the faces contained in the 3D solid structure, and obtain a face set;
[0131] The surface data extraction submodule is used to extract the material, color, and vertex set of the surface based on the surface set; wherein, if the component belongs to the pipeline type, the material of the component is the corresponding material in the preset material library matched according to the pipeline system classification;
[0132] The component dataset generation submodule is used to combine component layers, face sets, and face materials, colors, and vertex sets into a component dataset.
[0133] Optionally, the Ruby script file generation module includes:
[0134] Add submodules to the basic classes and methods to create strings with variable characters, and add basic classes and methods to the strings with variable characters according to Ruby script syntax; the basic classes and methods include the ElementObject class, Point collection conversion function, coordinate to point set conversion function, material conversion function, edge softening function, and component generation function;
[0135] The component data addition submodule is used to extract the component layer, face set, and face material, color, and vertex set from the component dataset, respectively, and convert the component layer, face set, and face material, color, and vertex set according to Ruby script syntax and add them to the variable character string;
[0136] The Ruby script file generation submodule is used to save the added string as a Ruby script file.
[0137] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0138] In addition, embodiments of the present invention also provide an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804.
[0139] Memory 803 is used to store computer programs;
[0140] The processor 801, when executing the program stored in the memory 803, implements the method for converting a Revit model to a SketchUp model as described in the above embodiments.
[0141] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0142] The communication interface is used for communication between the aforementioned terminal and other devices.
[0143] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0144] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0145] like Figure 9 As shown, in another embodiment of the present invention, a computer-readable storage medium 901 is also provided, which stores instructions that, when run on a computer, cause the computer to execute the method for converting a Revit model to a SketchUp model as described in the above embodiment.
[0146] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the method for converting a Revit model to a SketchUp model as described in the above embodiments.
[0147] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0149] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0150] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for converting a Revit model to a SketchUp model, characterized in that, The method includes: Identify components in the Revit model view that meet the entity criteria and generate a set of entity components; The entity component set is parsed to extract the component layers, face sets, and the material, color, and vertex sets of the faces, forming a component dataset; Generate Ruby script files based on the component dataset; Load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model; Identify components in the Revit model view that meet the entity criteria and generate a set of entity components, including: Collect the current model file of the Revit model and the files linked to the Revit model; Iterate through the components in the current model file of the Revit model and the files linked to the Revit model, filter out non-solid components according to preset rules, and form a set of solid components; Iterate through the components in the current model file and linked files of the Revit model, filter out non-solid components using preset rules, and form a set of solid components, including: The solidity of a component is verified by its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component. And / or, Filter by component type: Filter components of view type or annotation type.
2. The method according to claim 1, characterized in that, The entity component set is parsed to extract component layers, face sets, and face material, color, and vertex sets, forming a component dataset, including: Iterate through each component in the entity component set, extract the component's category name, and set the category name as the corresponding component's layer attribute; Analyze the 3D solid structure of the component, obtain all the faces contained in the 3D solid structure, and get the face set; Based on the face set, extract the face material, color, and vertex set; wherein, if the component belongs to the pipeline type, the material of the component is the corresponding material in the preset material library matched according to the pipeline system classification; The component dataset is composed of component layers, face sets, and face materials, colors, and vertex sets.
3. The method according to claim 1, characterized in that, Based on the aforementioned component dataset, generate Ruby script files, including: Create a string of variable characters, and add base classes and methods to the string of variable characters according to Ruby script syntax; the base classes and methods include the ElementObject class, Point collection conversion function, coordinate to point set conversion function, material conversion function, edge softening function, and component generation function; Extract the component layer, face set, and face material, color, and vertex set from the component dataset. Convert the component layer, face set, and face material, color, and vertex set according to Ruby script syntax and add them to the string of the variable character. Save the added string as a Ruby script file.
4. A device for converting a Revit model to a SketchUp model, characterized in that, The device includes: The solid component recognition module is used to identify components in the Revit model view that meet the solid conditions and generate a set of solid components; The component data extraction module is used to parse the set of entity components, extract the component layers, face sets, and the material, color, and vertex sets of the faces to form a component dataset; The Ruby script file generation module is used to generate Ruby script files based on the component dataset; The SketchUp model generation module is used to load and execute the Ruby script file in the SketchUp modeling environment to automatically generate a SketchUp model corresponding to the Revit model. The solid component recognition module includes: The Revit model file collection submodule is used to collect the current model file of the Revit model and the files linked to the Revit model; The non-solid component filtering submodule is used to traverse the components in the current model file of the Revit model and the files linked to the Revit model, filter non-solid components according to preset rules, and form a set of solid components; The non-solid component filtering submodule includes: The first non-solid component filtering unit is used to verify the solidity of a component through its three-dimensional solid properties: if the three-dimensional solid properties of a component are empty, it is determined to be a non-solid component. And / or, The second non-physical component filtering unit is used to filter by component type: filtering components of view type or annotation type.
5. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the method for converting a Revit model to a SketchUp model as described in any one of claims 1-3.
6. A computer-readable medium, characterized in that, The computer-readable medium stores instructions that, when executed by one or more processors, cause the processors to perform the method for converting a Revit model to a SketchUp model as described in any one of claims 1-3.
Citation Information
Patent Citations
'Sketch Up' plant process designing method based on 'Ruby' language
CN107729703A
Cross-platform data analysis method, device and equipment based on BIM model
CN118313130A