Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Real-time net height query function of Mechanical and Electrical Pipeline by Revit

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces Revit how to achieve electromechanical pipeline real-time net height query related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that after reading this Revit how to achieve electromechanical pipeline real-time net height query function article will have a harvest, let's take a look.

I. Preface

1. It can be judged by clicking on the pipe and by the elevation at the top and bottom in the property bar on the left (see figure 1).

Figure 1

However, this method has great defects (as shown in figure 2). Because the surface plate is below ±0 and the elevation is calculated from ±0, reading the bottom elevation directly will cause the error of the pipe ensemble. When the electromechanical bimer is very familiar with the elevation, the corrected net height can be calculated manually. However, it is very convenient to use a dockable window to display the net height in real time.

Figure 2

two。 The net height is measured by making a profile.

This method is the most accurate but also the most efficient way, and it can be used for pipe integration optimization in areas where pipelines are more complex and dense. However, if this method is used only in the case of fewer pipelines, it will seriously affect the efficiency, not to mention that there are more lifting plates in some areas, and the amount of profiles to be done will be greatly increased.

3. Use the plug-in 3D to take the net height.

At present, there are more plug-ins have three-dimensional volume to take the net height function, but the operation is more complicated (as shown in figure 3) need to click the function panel button, and then pick up the required net height of the pipeline to show the net height.

Figure 3

Second, the idea source of showing the net height in the dockable window

Recently, when I was doing the comprehensive optimization of the pipeline, I found it difficult to control the net height, and I thought of some practical tools of the former employer, so I imitated some of the ideas of the former employer for technical development.

It is hereby declared that the content of this article can only be used for technical research and academic discussion, not for commercial purposes, such as commercial disputes have nothing to do with the author, and the author reserves the right to pursue the plagiarist.

Third, the process and method of displaying net height in dockable window

1. Idle event

If you want to select a widget in Revit and then display some information in a dockable window, you need to use idle events to do so.

As the name implies, this event is triggered when the user does not operate on Revit, the definition of RevitAPI (figure 4). Another condition triggered by this event is that the API program can safely access the current document in this state, and the event will not be triggered if other transactions have not been completed.

Figure 4

There are two modes for idle events, default mode and non-default mode.

In the default mode, an idle event is raised each time the Revit starts to be idle. Note that when the user is active in the Revit user interface, the idle event starts and continues to be triggered whenever the mouse stops for a while or the command completes. However, if the user is not active in the user interface, Revit will not call these idle events for a long time. This means that when the user is completely away from the computer for a period of time, no idle events will be triggered during this period of time, and your plug-in cannot use that time to complete the calculation.

In non-default mode, the program forces Revit to keep idle events open and calls idle events repeatedly. In this mode, Revit will always make the application even if the user has stopped operating on the computer. Doing so can always take advantage of idle time for calculation, but this may result in performance degradation of the system running Revit, because CPU is always at full load during the idle time of the Revit application.

You can set idle events to a non-default mode by calling IdlingEventArgs.SetRaiseWithoutDelay (). If this method must be called in each idle event, Revit will revert to the default idle event.

Because idle events are triggered between user interface operations, if the method handled by the program takes a lot of time to do operations, it will cause Revit to become stuttered, which will greatly affect the user experience, so it is not recommended to use it in idle events.

The creation of idle events is very simple, as follows:

Application.Idling + = method

2. External events

External events are similar to idle events, except that they need to be triggered by the user themselves, while idle events are triggered automatically. The handling interface that inherits and implements external events is IExternalEventHandeler.

If we want to quickly realize the real-time display of net height of dockable windows, we should use idle events, while external events can call commands continuously.

3. Create a dockable window

As shown in figure 5, you need to create a new user control, the WFP form.

Figure 5

The parent class of the dockable window in revit is the page class, which also inherits the IDockablePaneProvider interface.

First, we need to modify the parent class of the form. In the XAML page, change UserControl to Page, as shown below:

You need to modify the parent class in the red box and add a control label to the page.

Idle events are implemented through the IDockablePaneProvider interface. And call the net height algorithm application.Idling + = method by creating idle events. Initialize the location of the dockable window through the function SetupDockablePane. As shown in figure 6

Figure 6

Register a dockable window in Revit.

Add a button in ribbon to open a dockable window, and then add a dockable window through RegisterDockablePane. To give the window a unique Guid code, the code can modify the original code or generate a new code, but it must be a unique Guid code.

5. Add the command to execute the button in IExternalCommand, where the G ui d code should be consistent with the G ui d code of the dockable window.

6. The algorithm of net height query can be realized by the idle event of docking window.

Use the intersection of the solid and the curve to calculate the distance from the pipeline to the plate, and eliminate the influence of other plates, and only seek the distance from the pipeline to the surface layer, that is, the true net height of the pipeline. The real-time 3D net height display of pipelines can be realized by using this algorithm.

The above is the method to realize the real-time query of pipeline height in dockable window.

The effect is as follows:

This is the end of the article on "how to realize the real-time net height query function of mechanical and electrical pipelines by Revit". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to achieve the real-time net height query function of mechanical and electrical pipelines by Revit". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report