Revit-based intelligent factory pipeline automatic gradient connection method and device and storage medium
By automatically calculating pipeline intersection points and generating connection accessories in the Revit pipeline model, the problem of time-consuming and labor-consuming manual connection of drainage pipes in smart factories is solved, and the rapid and accurate automatic connection of pipelines is achieved, and the design and construction efficiency is improved.
Patent Information
- Application Number
- CN202411608717.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
During the drawing of the Revit comprehensive pipe model of the smart factory, the manual slope connection of the drainage pipe consumes a lot of time and energy, and it is easy to cause pipeline displacement due to inadvertent operation, affecting the design parameters and construction quality.
A smart factory pipeline automatic slope connection method based on Revit is adopted. Automatic slope connection of the pipeline is realized by picking up pipelines, calculating pipeline intersection points, judging connection methods, redrawing the model, obtaining connection parts and generating connection accessories in the Revit pipeline model.
It realizes fast and automatic connection of pipelines, reduces the workload and error rate of operators, improves design efficiency and construction accuracy, and is suitable for various pipeline types and materials.
Smart Images

Figure CN119475789A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent factory building design, and is particularly applicable to an automatic slope connection method, device and storage medium for intelligent factory pipelines based on Revit. Background Art
[0002] In the process of drawing the Revit pipe system model of the smart factory, the sloped connection between the drainage pipes usually consumes the time and energy of the modelers. The drainage pipes usually have a slope. The connection between these sloped drainage pipes is a great test of the modelers' skills and level. It requires the establishment of sections and constant switching of views. It also requires the calculation and modification of the pipe slope and endpoint coordinates to achieve the correct connection of the two pipes. In this process, if the operation is not careful, it may inadvertently cause the pipe to move and change the design parameters without the operator noticing, resulting in collisions with other professionals or construction errors. Summary of the invention
[0003] The present invention aims to provide a method, device and storage medium for automatic slope connection of smart factory pipelines based on Revit, aiming to solve the problems existing in manual connection of drainage pipes.
[0004] To achieve the above object, the present invention adopts the following technical solutions: The automatic slope connection method of smart factory pipelines based on Revit of the present invention comprises the following steps: S1, pick up pipes in the Revit pipeline model, one at a time, for a total of two; S2, calculate the intersection of the pipeline in space; S3, judging the connection mode of the pipelines according to the positions of the intersection points of the pipelines, and determining the main pipelines and branch pipelines; S4, redraw the Revit pipe model that meets the pipe connection requirements; S5, obtaining pipe connectors near the connection points between the main pipe and the branch pipe; S6, generating pipeline connection accessories according to the connection method in step S3 and the connection parts obtained in step S5.
[0005] Furthermore, step S1 specifically includes: S1.1, create a Revit pipe filter and pick only pipes; S1.2, when picking up the second pipe, determine whether it is the same pipe. If it is the same pipe, prompt to continue picking up.
[0006] Furthermore, step S2 specifically includes: S2.1, respectively obtain the starting point and end point coordinates of the center lines of the two pipelines; S2.2, calculate the vectors V1 and V2 of the two pipes respectively; S2.3, the result of the cross product of vectors V1 and V2 is vector X. If the length of vector X is 0, it means that the two pipes are parallel and cannot be connected; otherwise, calculate the intersection of the two pipes in space.
[0007] Furthermore, step S2.3 calculates the intersection of the two pipes in space, specifically including: S2.3.1, calculate the intersection coordinates PT1 of the plane PL1 formed by the starting point of the center line of the first pipeline, the vector V1 and the vector X, and the starting point of the center line of the second pipeline, the vector V2; S2.3.2, calculate the plane PL2 formed by the starting point of the center line of the second pipeline, vector V2 and vector X; and the intersection coordinates PT2 with the end point of the center line of the first pipeline and vector V1.
[0008] Furthermore, step S3 specifically includes: S3.1, if the intersection coordinate PT1 is on the center line segment of the first pipeline, the connection accessory of the two pipelines is a tee, the first pipeline is the main pipeline, and the second pipeline is the branch pipeline; PT1 is the pipeline intersection point PI; S3.2, if the intersection coordinate PT2 is on the center line segment of the second pipeline, the connection accessory of the two pipelines is a tee, the second pipeline is the main pipeline, and the first pipeline is the branch pipeline; PT2 is the pipeline intersection point PI; S3.3, if the distance between the pipe intersection point PI and the end point of the main pipe is less than 1.5 times the diameter of the main pipe, the two pipes shall be connected by an elbow; S3.4, if the intersection point coordinate PT1 is outside the centerline segment of the first pipeline, and PT2 is outside the centerline segment of the second pipeline, the two pipelines are connected by an elbow; S3.5, when elbow connection is adopted, the pipe with larger diameter is the main pipe, and the pipe with smaller diameter is the branch pipe; the intersection point PI of the two pipes is determined as the intersection coordinate falling on the extension line of the center line segment of the main pipe.
[0009] Furthermore, step S4 specifically includes: S4.1, when two pipes are connected by a tee, the main pipe is cut into two sections at the intersection PI, the point where the branch pipe is far away from the main pipe is identified as the starting point, the intersection PI is identified as the end point, and the Revit pipe model is redrawn; S4.2, when two pipes are connected by an elbow, redraw the Revit pipe model with the centerline endpoints of the two pipes farthest from the intersection point PI as the starting point and the intersection point PI as the end point.
[0010] Furthermore, step S5 specifically includes: S5.1, use the API provided by Revit to obtain all the connectors contained in the main pipe and branch pipe; S5.2, calculate the length of all connectors from the intersection point PI; connectors with a distance of 0 will be used to generate elbow connections or tee connections; S5.3, according to step S3, when an elbow connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 2; when a tee connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 3.
[0011] The Revit-based pipeline automatic slope connection device described in the present invention includes at least one processor, at least one memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method described in any one of claims 1 to 7 is implemented.
[0012] The computer-readable storage medium of the present invention stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
[0013] The advantage of the present invention is that it can automatically change the slope of the branch pipe, realize the rapid connection of the branch pipe and the main pipe, and has no requirements on the pipe type and material. The automatic slope connection of the pipe makes the cumbersome operation required for the connection of the sloped pipe efficient and flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The present invention is a schematic flow chart of a method for automatically connecting a drainage pipe with a slope based on Revit.
[0015] Figure 2 Schematic diagram of the sewer pipe not connected, drawn for the designer.
[0016] Figure 3 The present invention discloses a schematic diagram of a drainage pipe redrawn after calculation when a three-way connection is used.
[0017] Figure 4 It is a schematic diagram of a drainage pipe disclosed in the present invention which is redrawn to achieve a three-way connection. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] like Figure 1 As shown, the automatic slope connection method of smart factory pipelines based on Revit of the present invention comprises the following steps: S1, pick up pipes in the Revit pipeline model, one at a time, for a total of two. Specifically: S1.1, create a Revit pipe filter so that when picking model elements, only pipes can be picked.
[0020] S1.2, when picking up the second pipe, determine whether it is the same pipe. If it is the same pipe, prompt to continue picking up.
[0021] S2, calculates the intersection of the pipeline in space. Specifically, S2.1, respectively obtain the starting point and end point coordinates of the two pipeline center lines. The starting point and end point coordinates of the first pipeline center line are recorded as (P1_1, P1_2), and the starting point and end point coordinates of the second pipeline center line are recorded as (P2_1, P2_2).
[0022] S2.2, calculate the vectors V1 and V2 of the two pipes respectively.
[0023] S2.3, the result of the cross product of vectors V1 and V2 is vector X. If the length of vector X is 0, it means that the two pipes are parallel and cannot be connected; otherwise, the intersection of the two pipes in space is calculated. Calculating the intersection of the two pipes in space specifically includes: S2.3.1, calculate the intersection coordinates PT1 of the plane PL1 formed by the starting point P1_1 of the center line of the first pipeline, the vector V1 and the vector X, and the intersection coordinates PT1 of the starting point P2_1 of the center line of the second pipeline and the vector V2.
[0024] S2.3.2, calculate the plane PL2 formed by the starting point P2_1 of the center line of the second pipeline, the vector V2 and the vector X; and the coordinates PT2 of the intersection with the end point P1_2 of the center line of the first pipeline and the vector V1.
[0025] S3, judging the connection mode of the pipelines according to the location of the pipeline intersection, and determining the main pipeline and the branch pipeline. The specific method of judging the connection mode of the pipelines includes: S3.1, if the intersection coordinate PT1 is on the center line segment of the first pipeline, it means that the extension line of the second pipeline intersects with the center line segment of the first pipeline, then the connecting accessory of the two pipelines is a tee, and the first pipeline is the main pipeline, and the second pipeline is the branch pipeline; PT1 is the pipeline intersection point PI.
[0026] S3.2, if the intersection coordinate PT2 is on the center line segment of the second pipeline, it means that the extension line of the first pipeline intersects with the center line segment of the second pipeline, then the connection accessory of the two pipelines is still a tee, but the second pipeline is the main pipeline and the first pipeline is the branch pipeline; PT2 is the pipeline intersection point PI.
[0027] S3.3, if the distance between the pipe intersection point PI and the end point of the main pipe is less than 1.5 times the main pipe diameter, then after the two pipes are connected by a tee, the remaining pipe is too short or completely surrounded by the tee, so in this case, the two pipes are connected by an elbow.
[0028] S3.4, if the intersection point coordinate PT1 is outside the center line segment of the first pipeline, and PT2 is outside the center line segment of the second pipeline, the two pipelines are connected by an elbow.
[0029] S3.5, when using elbow connection, select the pipe with larger diameter as the main pipe and the pipe with smaller diameter as the branch pipe; if the diameters of the two pipes are the same, then you need to manually select one of the pipes as the main pipe. Determine the intersection point PI of the two pipes as the intersection coordinates that fall on the extension line of the center line segment of the main pipe. For example, when the first pipe is the main pipe, the intersection point PI of the two pipes is the intersection coordinate PT1. When the second pipe is the main pipe, the intersection point PI of the two pipes is the intersection coordinate PT2.
[0030] S4, redraw the Revit pipe model that meets the pipe connection requirements. Specifically, S4.1, when two pipes are connected by a tee, the main pipe is cut into two sections at the intersection PI, the point where the branch pipe is far away from the main pipe is identified as the starting point, the intersection PI is identified as the end point, and the center line of the branch pipe is redrawn using the API provided by Revit. If the second pipe is a branch pipe, P2_1 is far away from the main pipe, then the center line of the branch pipe is redrawn from P2_1 to the intersection PI.
[0031] S4.2, when two pipes are connected by elbows, take the centerline endpoints of the two pipes farthest from the intersection point PI as the starting point, and the intersection point PI as the end point, and use the API provided by Revit to redraw the centerlines of the main pipe and branch pipe.
[0032] S5, obtaining pipe connectors near the connection point between the main pipe and the branch pipe. Specifically, S5.1, use the API provided by Revit to obtain all the connectors contained in the main pipe and branch pipe.
[0033] S5.2, calculate the distance of all connectors from the intersection point PI. Connectors with a distance of 0 will be used to generate elbow connections or tee connections.
[0034] S5.3, according to step S3, when an elbow connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 2. When a tee connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 3.
[0035] S6, generating pipeline connection accessories according to the connection method in step S3 and the connection parts obtained in step S5.
[0036] like Figure 2 The figure shows two unconnected drainage pipes drawn by the designer. Taking these two unconnected drainage pipes as an example, the automatic slope connection method of the pipelines according to the present invention is described. Figure 2 The two pipes should be connected by a tee. After determining the intersection point PI, redraw the pipe model as shown in Figure 3 As shown, Figure 4 This is the final result of the three-way connection of the two pipes.
[0037] The present invention discloses an automatic slope connection device for smart factory pipelines based on Revit, comprising at least one processor, at least one memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the automatic slope connection method for smart factory pipelines based on Revit of the present invention is implemented.
[0038] The computer-readable storage medium described in the present invention stores computer program instructions thereon, and when the computer program instructions are executed by a processor, the automatic slope connection method for smart factory pipelines based on Revit described in the present invention is implemented.
Claims
1. A method for automatic slope connection of smart factory pipelines based on Revit, characterized in that: The following steps are involved: S1, pick up pipes in the Revit pipeline model, one at a time, for a total of two; S2, calculate the intersection of the pipeline in space; S3, judging the connection mode of the pipelines according to the positions of the intersection points of the pipelines, and determining the main pipelines and branch pipelines; S4, redraw the Revit pipe model that meets the pipe connection requirements; S5, obtaining pipe connectors near the connection points between the main pipe and the branch pipe; S6, generating pipeline connection accessories according to the connection method in step S3 and the connection parts obtained in step S5.
2. According to the Revit-based smart factory pipeline automatic slope connection method of claim 1, it is characterized by: Step S1 specifically includes: S1.1, create a Revit pipe filter and pick only pipes; S1.2, when picking up the second pipe, determine whether it is the same pipe. If it is the same pipe, prompt to continue picking up.
3. According to the Revit-based smart factory pipeline automatic slope connection method of claim 1, it is characterized by: Step S2 specifically includes: S2.1, respectively obtain the starting point and end point coordinates of the center lines of the two pipelines; S2.2, calculate the vectors V1 and V2 of the two pipes respectively; S2.3, the result of the cross product of vectors V1 and V2 is vector X. If the length of vector X is 0, it means that the two pipes are parallel and cannot be connected; otherwise, calculate the intersection of the two pipes in space.
4. According to claim 3, a method for automatically connecting pipelines in a smart factory based on Revit is characterized in that: Step S2.3 calculates the intersection of two pipes in space, including: S2.3.1, calculate the intersection coordinates PT1 of the plane PL1 formed by the starting point of the center line of the first pipeline, the vector V1 and the vector X, and the starting point of the center line of the second pipeline, the vector V2; S2.3.2, calculate the plane PL2 formed by the starting point of the center line of the second pipeline, vector V2 and vector X; and the intersection coordinates PT2 with the end point of the center line of the first pipeline and vector V1.
5. The method for automatically connecting pipelines in a smart factory based on Revit according to claim 1 is characterized in that: Step S3 specifically includes: S3.1, if the intersection coordinate PT1 is on the center line segment of the first pipeline, the connection accessory of the two pipelines is a tee, the first pipeline is the main pipeline, and the second pipeline is the branch pipeline; PT1 is the pipeline intersection point PI; S3.2, if the intersection coordinate PT2 is on the center line segment of the second pipeline, the connection accessory of the two pipelines is a tee, the second pipeline is the main pipeline, and the first pipeline is the branch pipeline; PT2 is the pipeline intersection point PI; S3.3, if the distance between the pipe intersection point PI and the end point of the main pipe is less than 1.5 times the diameter of the main pipe, the two pipes shall be connected by an elbow; S3.4, if the intersection point coordinate PT1 is outside the centerline segment of the first pipeline, and PT2 is outside the centerline segment of the second pipeline, the two pipelines are connected by an elbow; S3.5, when elbow connection is adopted, the pipe with larger diameter is the main pipe, and the pipe with smaller diameter is the branch pipe; the intersection point PI of the two pipes is determined as the intersection coordinate falling on the extension line of the center line segment of the main pipe.
6. The method for automatically connecting pipelines in a smart factory based on Revit according to claim 5 is characterized in that: Step S4 specifically includes: S4.1, when two pipes are connected by a tee, the main pipe is cut into two sections at the intersection PI, the point where the branch pipe is far away from the main pipe is identified as the starting point, the intersection PI is identified as the end point, and the Revit pipe model is redrawn; S4.2, when two pipes are connected by an elbow, redraw the Revit pipe model with the centerline endpoints of the two pipes farthest from the intersection point PI as the starting point and the intersection point PI as the end point.
7. The method for automatically connecting pipelines in a smart factory based on Revit according to claim 5 is characterized in that: Step S5 specifically includes: S5.1, use the API provided by Revit to obtain all the connectors contained in the main pipe and branch pipe; S5.2, calculate the length of all connectors from the intersection point PI; connectors with a distance of 0 will be used to generate elbow connections or tee connections; S5.3, according to step S3, when an elbow connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 2; when a tee connection is adopted, the number of connectors whose length from the intersection point PI is 0 is 3.
8. An automatic slope connection device for pipelines in smart factories based on Revit, characterized in that: The method comprises at least one processor, at least one memory and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
