Method for Generating Point Cloud of BIM Model of Prefabricated Components Based on Revit API and Dynamo
Through the point cloud generation method of prefabricated component BIM model based on Revit API and Dynamo, the problem of poor compatibility of point cloud processing software and dissatisfied with special functional requirements in the existing technology is solved, and efficient point cloud data use and component detection functions are realized.
Patent Information
- Application Number
- CN202210388106.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-04-13
AI Technical Summary
The prior art is difficult to compatible with different point cloud processing software, and some software cannot meet the special needs of component detection, resulting in inefficient use of point cloud data.
Through the point cloud generation method of prefabricated component BIM model based on Revit API and Dynamo, the entity-class geometric objects of the BIM model are extracted and converted into geometric objects supported by Dynamo, and designed point cloud data that is compatible with different point cloud processing software is generated and stored as .txt format files.
It realizes the reading of the coordinates of the designed point cloud locations by different point cloud processing software, improves the efficiency of point cloud data usage, and supports functions such as point cloud fitting alignment and component type recognition.
Smart Images

Figure CN114818061B_ABST
Abstract
Description
Technical Field
[0001] This application relates to building informatization technology, and particularly discloses a method for generating point clouds of precast component BIM models based on Revit API and Dynamo, belonging to the technical field of computing, reckoning or counting. Background Art
[0002] Prefabricated building is a widely adopted construction process at present. Components are prefabricated in batches at the factory and then transported to the construction site, where the precast components and cast-in-place components are assembled to complete the overall construction. The geometric dimensions of precast components after batch production, as well as geometric shape changes such as bending and torsion during prestress tensioning, transportation, and beam storage, are all important concerns for detecting the quality of fabricated components.
[0003] Point cloud data is high-precision, high-density, and fully digital surface coordinate data of the target object obtained through 3D laser scanners or machine vision technology, representing the actual geometric shape of the target object. There have been numerous studies comparing the point cloud model with the design model of the target object to obtain the differences between the actual shape and the design shape of the target object. This idea has been widely applied in the dimensional inspection of civil engineering components and industrial parts.
[0004] BIM (Building Information Modeling) technology is a data-based tool applied to engineering design, construction, and management. Prefabricated buildings often use BIM technology for simulation assembly and information storage. Revit is a commonly used BIM modeling software, and its auxiliary programming tool Dynamo often serves as a bridge for data communication between Revit and other software, which can convert the information carried by the BIM model into other forms of data. However, the geometric objects of Dynamo are different from those of Revit, and the geometric object types need to be converted during data interaction.
[0005] Currently, most related research is to accurately fit and align the point cloud obtained by 3D laser scanning with its BIM 3D model, and then compare the deviations between the two. This process usually relies on professional point cloud processing software. However, the functions that each software is good at are different. For example, some software cannot implement the function of detecting the verticality of buildings, and most software cannot meet the needs of users for some special functions; when importing 3D model files, the file formats supported by each software are also different, and file type conversion is often required, and the process is relatively cumbersome. Summary of the Invention
[0006] The object of the present invention is to address the deficiencies of the above-mentioned background art, and provide a method for generating point clouds of precast component BIM models based on Revit API and Dynamo, obtaining a text file in txt format storing the position coordinates of the design point clouds, realizing the reading of the position coordinates of the design point clouds by different point cloud processing software, providing data support for point cloud fitting alignment, component type recognition, etc., and solving the technical problems that different point cloud processing software cannot be compatible with BIM 3D models and some point cloud processing software cannot meet the detection requirements of all components.
[0007] The present invention adopts the following technical solutions to achieve the above object:
[0008] A method for generating point clouds of precast component BIM models based on Revit API and Dynamo relies on the Autodesk Revit platform to establish a family file of the precast component BIM model; constructs an element collector and creates an element filter under the Revit secondary development program framework. The element collector collects all elements in the document stored in the BIM model family file, and the element filter filters the information collected by the element collector to retain the family instances of the target precast component BIM model; obtains geometric objects of the solid type from the family instances of the target precast component BIM model, and obtains geometric objects of the face type and edge type from the geometric objects of the solid type; converts the geometric objects of the face type into geometric objects of the face type supported by Dynamo, and converts the geometric objects of the edge type into geometric objects of the line type supported by Dynamo; uses the built-in geometric operation methods in Dynamo to discretize the supported geometric objects of the face type and line type into point sets.
[0009] Furthermore, for the method for generating point clouds of precast component BIM models based on Revit API and Dynamo, the specific method for obtaining geometric objects of the solid type from the family instances of the target precast component BIM model is: access the geometric elements of the family instances of the target precast component BIM model, sequentially access the geometric objects contained in the geometric elements, and convert the geometric objects of the solid type into subtypes of the solid type.
[0010] Furthermore, based on the point cloud generation method of the prefabricated component BIM model of Revit API and Dynamo, the specific method of converting the surface type geometric object into the surface type geometric object supported by Dynamo is as follows: applying the triangulation method in the Revit API to convert the surface type geometric object into a triangular mesh type geometric object, accessing the vertex attributes of the triangular mesh model type geometric object, and obtaining the corner point coordinates of the surface type geometric object; creating corner points through the Point.ByCoordinates method in Dynamo; connecting the corner points on the same face into a closed curve through the PolyCurve.ByPoints method in Dynamo; and then creating a plane with the closed curve as the boundary through the Surface.ByPatch method in Dynamo to obtain the surface type geometric object supported by Dynamo.
[0011] Furthermore, based on the point cloud generation method of the prefabricated component BIM model of Revit API and Dynamo, the specific method of converting the edge type geometric object into the line type geometric object supported by Dynamo is: applying the AsCurve method in the Revit API to convert the edge type geometric object into a line type geometric object, and obtaining the coordinates of the two end points of the line type geometric object; calling the coordinates of the two end points of the line type geometric object through the Point.ByCoordinates method in Dynamo to create endpoints; connecting the endpoints through the Line.ByStartPointEndPoint method in Dynamo to create a line segment, and obtaining the line type geometric object supported by Dynamo.
[0012] Furthermore, based on the Revit API and Dynamo point cloud generation method of the prefabricated component BIM model, the specific method of using Dynamo's built-in geometric operation method to discretize the surface type geometric objects and line type geometric objects it supports into point sets is as follows: through the Surface.PointAtParameter method in Dynamo, UV parameter pairs are randomly generated, the coordinates of the points at the UV parameters on the surface type geometric objects are extracted, and the noise points outside the surface contour are removed through the Geometry.DistanceTo method; the coordinates of the points at the specified parameters on the line type geometric objects are extracted through the Curve.PointAtParameter method in Dynamo.
[0013] Furthermore, a point cloud generation method for a prefabricated component BIM model based on Revit API and Dynamo utilizes Dynamo's built-in geometric operation method to discretize the surface-type geometric objects and line-type geometric objects it supports into point sets, and then outputs the discretized point sets as .txt format files.
[0014] Furthermore, for the method of generating point clouds of precast component BIM models based on the Revit API and Dynamo, the Revit secondary development program framework relies on the.NET framework and is built through an external command interface based on the C# language.
[0015] A computer-readable storage medium stores a computer program thereon, and when the program is executed by a processor, it implements the above-mentioned method of generating point clouds of precast component BIM models based on the Revit API and Dynamo.
[0016] A method for identifying precast components uses the above-mentioned method of generating point clouds of precast component BIM models based on the Revit API and Dynamo to obtain a point cloud model of the precast component, and identifies the component type and obtains the dimension detection result by fitting and aligning the scanned point cloud of the precast component with the design point cloud.
[0017] The present invention adopts the above technical solutions and has the following beneficial effects:
[0018] (1) The present invention relies on the Autodesk Revit platform, extracts the entity class geometric objects of the precast component BIM model under the Revit secondary development program framework, converts the geometric objects in Revit into geometric objects supported by Dynamo by calling the Revit API through Dynamo, obtains the design point cloud compatible with different point cloud processing software, provides design point cloud data for point cloud alignment and component identification, and there is no need to convert the file type when different point cloud processing software calls the point cloud file in txt format, improving the use efficiency of point cloud data.
[0019] (2) The design point cloud generated by the present invention is stored in a txt format file. After importing the design point cloud of the txt format file into data processing software such as Matlab and Python, users can modify or add or subtract it according to actual needs to meet the requirements of special detection functions. Description of the Drawings
[0020] Figure 1 It is the overall flow chart for generating point clouds of the BIM model of the present invention.
[0021] Figure 2 It is the BIM model of the precast box girder in an embodiment of the present invention.
[0022] Figure 3 It is the point cloud after the plane of the beam end of the precast box girder BIM model in an embodiment of the present invention is discretized.
[0023] Figure 4 It is the point cloud after the beam end side line of the precast box girder BIM model in an embodiment of the present invention is discretized.
[0024] Figure 5The point cloud after the beam ends of the precast box girder BIM model are discretized in an embodiment of the present invention.
[0025] Figure 6 The point cloud after the overall discretization of the precast box girder BIM model in an embodiment of the present invention. Detailed implementation manners
[0026] In order to make the invention purpose, technical solutions and technical effects of the present application clearer, the present application will be further described in detail below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] Taking a precast concrete box girder as an example, the flowchart for generating the point cloud of the precast concrete box girder BIM model is as Figure 1 shown, and it includes the following eight steps.
[0028] Step 1: Relying on the Autodesk Revit platform, establish the.rfa family file of the precast concrete box girder component BIM model according to the design drawings
[0029] Based on the "Metric Profiles" family file built into Revit, make the parametric profile family files of the concrete box girder section and the cross beam section. Based on the "Metric Profiles - Beams and Supports" family file built into Revit, establish the concrete box girder BIM model family file by lofting the profile family, and the generated concrete box girder BIM model is as Figure 2 shown.
[0030] Step 2: Relying on the.NET framework, using the C# language, build the Revit secondary development program framework through the external command interface
[0031] Create a new class library project in Visual Studio, add the Revit API.dll and Revit APIUI.dll reference files to the project, add the common Revit namespaces, and in addition, add the Dynamo geometry-related namespaces; write the functional code in the method named Execute.
[0032] Step 3: Construct an element collector, use the element collector to store all elements in the document. The element collector contains the element types (FamilySymbol) and instances (FamilyInstance). Further create an element filter, and the element filter filters the information collected by the element collector and retains the specific family instances required.
[0033] For a concrete box girder with a family type of Sweep, the element collector collects and stores all elements from the concrete box girder BIM model family file, and the element filter filters the elements stored in the element collector to retain the instances of the type Sweep.
[0034] Step 4: Access the geometric elements (GeometryElement) of the family instance, then access the geometric objects (GeometryObject) contained in the geometric elements, and obtain the geometric objects of the solid (Solid) type from them.
[0035] Access the geometric elements (GeometryElement) of the family instance. The geometric elements include points (Point), curves (Curve), edges (Edge), faces (Face), solids (Solid), etc. contained in the model, which are collectively called the geometric objects (GeometryObject) of the model. Sequentially access the geometric objects contained in the geometric elements, and determine whether it is of the solid type. If so, cast the geometric object to its subtype - the solid (Solid) type. The subsequent steps are all based on the geometric objects of the subtype, that is, the solid type. For example, for the instance of the type Sweep obtained in Step 3, access the geometric elements of the family instance of the type sweep, then access each type of geometric object in the geometric elements of the family instance of the type sweep, determine the type of the geometric object, and obtain the geometric object of the solid (Solid) type.
[0036] Step 5: Access the properties of the geometric objects of the solid (Solid) type to obtain the geometric objects of the face (Face) type and the edge (Edge) type.
[0037] Step 6: With the help of the geometric creation methods built into the Revit add-in Dynamo, convert the geometric objects of the face type and the line type in Revit into geometric objects supported by Dynamo, and create surfaces (Surface) and lines (Line) in Dynamo.
[0038] For the geometric objects of the face type, apply the Triangulate method in the Revit API to convert the face into a mesh (Mesh) type, access the Vertices property of the mesh, and finally obtain the corner point coordinates XYZ of the face. Extract the three coordinate data of the corner points respectively, and create the corner points through the Point.ByCoordinates method in Dynamo, that is, the creation of the geometric objects of the point type supported by Dynamo is completed.
[0039] Use the PolyCurve.ByPoints method in Dynamo to connect the corner points on the same surface into a closed curve, and then use the Surface.ByPatch method to create a plane with the closed curve as the boundary, thus completing the conversion of the surface type geometric objects supported by Revit to the surface type geometric objects supported by Dynamo;
[0040] For edge-type geometric objects, use the AsCurve method in the Revit API to convert the edge to a line type and obtain the XYZ coordinates of the two end points of the line. Extract the three coordinate data of the endpoints and create the endpoints through the Point.ByCoordinates method in Dynamo, thus completing the creation of point-type geometric objects supported by Dynamo;
[0041] By creating a line segment through the Line.ByStartPointEndPoint method in Dynamo, the conversion of edge-type geometric objects supported by Revit to line-type geometric objects supported by Dynamo is completed.
[0042] Step 7: Based on the geometric objects created in Dynamo, call Dynamo's built-in geometric operation methods to discretize lines and surfaces into point sets.
[0043] Through the Surface.PointAtParameter method in Dynamo, randomly generate UV parameter pairs. The parameters must be greater than 0 and less than 1. Extract the coordinates of the points at the UV parameters on the surface. When the shape of the surface is irregular, the randomly generated points may be located outside the surface contour and become noise points. At this time, the Geometry.DistanceTo method is also needed to determine the positional relationship between the point and the surface contour, and remove the noise points outside the contour. Figure 3 Shown is the point cloud of the precast concrete box girder BIM model after the beam end plane is discretized.
[0044] Use the Curve.PointAtParameter method to extract the coordinates of the point at the specified parameter on the line. The parameter must be greater than 0 and less than 1. Figure 4 Shown is the point cloud after the beam end edges of the precast concrete box girder BIM model are discretized.
[0045] The points extracted from each plane and edge line are combined to form the discretized point set of the entity. Figure 5 Shown is the point cloud of the precast concrete box girder BIM model after the beam ends are discretized.
[0046] Step 8: Output the discretized point set densePoints as a .txt file. Figure 6 Shown is the point cloud after the overall discretization of the precast concrete box girder BIM model.
Claims
1. A method for generating point clouds of precast component BIM models based on the Revit API and Dynamo, characterized in that: Build a family file of the precast component BIM model relying on the Autodesk Revit platform; Construct an element collector and create an element filter under the Revit secondary development program framework. The element collector collects all elements in the BIM model family file, and the element filter filters the information collected by the element collector to retain the family instances of the target precast component BIM model. The Revit secondary development program framework relies on the.NET framework and is built through an external command interface based on the C# language; Obtain geometric objects of entity type from the family instances of the target precast component BIM model, and obtain geometric objects of face type and edge type from the geometric objects of entity type; Convert the geometric objects of face type into geometric objects of face type supported by Dynamo, and convert the geometric objects of edge type into geometric objects of line type supported by Dynamo; The specific method for converting the geometric objects of face type into geometric objects of face type supported by Dynamo is as follows: Apply the triangulation method in the Revit API to convert the geometric objects of face type into geometric objects of triangular mesh type, access the vertex attributes of the geometric objects of triangular mesh type, and obtain the corner point coordinates of the geometric objects of face type; Create corner points through the Point.ByCoordinates method in Dynamo; Connect the corner points on the same face into a closed curve through the PolyCurve.ByPoints method in Dynamo; Then, create a plane with the closed curve as the boundary through the Surface.ByPatch method in Dynamo to obtain geometric objects of face type supported by Dynamo; The specific method for converting the geometric objects of edge type into geometric objects of line type supported by Dynamo is as follows: Apply the AsCurve method in the Revit API to convert the geometric objects of edge type into geometric objects of line type, and obtain the coordinates of the two end points of the geometric objects of line type; Create end points by calling the coordinates of the two end points of the geometric objects of line type through the Point.ByCoordinates method in Dynamo; Connect the end points to create a line segment through the Line.ByStartPointEndPoint method in Dynamo to obtain geometric objects of line type supported by Dynamo; Use the built-in geometric operation methods in Dynamo to discretize the geometric objects of face type and line type supported by it into point sets.
2. The method for generating point cloud of precast component BIM model based on Revit API and Dynamo according to claim 1, characterized in that The specific method for obtaining geometric objects of entity type from the family instances of the target precast component BIM model is as follows: Access the geometric elements of the family instances of the target precast component BIM model, and sequentially access the geometric objects contained in the geometric elements, and convert the geometric objects of entity type into subtypes of entity type.
3. The method for generating point cloud of precast component BIM model based on Revit API and Dynamo according to claim 1, characterized in that The specific method of discretizing the geometric objects of surface type and line type supported by Dynamo into point sets by using the built-in geometric operation methods in Dynamo is as follows: By using the Surface.PointAtParameter method in Dynamo, randomly generate UV parameter pairs, extract the coordinates of the points at the UV parameters on the geometric objects of surface type, and eliminate the noise points outside the surface contour by using the Geometry.DistanceTo method; By using the Curve.PointAtParameter method in Dynamo, extract the coordinates of the points at the specified parameters on the geometric objects of line type.
4. The method for generating point cloud of prefabricated component BIM model based on Revit API and Dynamo according to claim 1, wherein After discretizing the geometric objects of surface type and line type supported by Dynamo into point sets by using the built-in geometric operation methods in Dynamo, output the discretized point sets as.txt format files.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method for generating point clouds of precast component BIM models based on Revit API and Dynamo described in claim 1.
6. A method for identifying prefabricated components, characterized in that, Adopt the method for generating point clouds of precast component BIM models based on Revit API and Dynamo described in claim 1 to obtain the point cloud model of the precast component, and fit and align the scanned point cloud of the precast component with the designed point cloud to identify the component type and obtain the dimension detection result.
Citation Information
Patent Citations
BIM model-based prefabricated part point cloud identification method
CN110060338A
Prefabricated part model modeling method based on Revit and Dynamo
CN113721903A