The article presents practical techniques for programming the segmentation of cable support systems using the RevitAPI interface and the VisualStudioComunity programming environment. Segmentation is necessary for the correct layout of cable trays, assessment of their geometry and position in cable support systems.
Programming typical procedures for placing cable trays in the system allows you to quickly arrange the trays in the optimal position, taking into account the allowable standard distances between the trays. The placement of the mountings is also an important task in choosing the optimal layout for the cable support system.
The RevitAPI SDK contains many common examples for working with Revit objects, but most of these examples only demonstrate general programming capabilities with RevitAPI. As a result of the systematization of segmentation methods, programs were selected to select the optimal tracing of objects in cable support systems and automated selection of the configuration of trays in cable support systems.
Tray databases are located in the Revit project structure and are linked to the actual tray settings through a shared settings file that must be connected to Revit projects before you begin. The automated calculation of the layout of cable support systems is based on the use of plug-ins and add-ons to the Autodesk Revit software. Addins are tested in Revit 2021 to identify new APIs versus previous API versions.
The VisualStudioCommunity programming environment provides a wide range of methods for processing tray properties and parameters, providing the necessary performance in the process of processing data from Revit projects. This circumstance is important while opening large projects on medium-sized laptops, because such equipment is used at the designers' workplaces. Dynamic libraries that are connected to projects save laptop memory, because they are used in projects only at the moment of calling the necessary program processing methods.
The advantage of the Visual Studio programming environment over the SharpDevelop debugger and linker lies in the flexible ability to debug API methods, develop high-quality high-speed programs that can function both as separate applications and in conjunction with Revit applications.
Because Revit is designed to build a complete project model with relationships between databases, parameter files, and custom cable tray family IDs, it can be difficult for the end user to programmatically process data and calculate the layout of cable support systems. The developed programs in the C # programming language make it possible to formalize the algorithms for calculating the layouts of cable support systems with the ability to automate the creation of special families for cable trays and the development of typical parametric libraries for trays of different types. Software libraries for evaluating the geometric parameters of trays as they are developed increase the efficiency of calculating the layout of cable support systems and allow the designer not to perform segmentation of trays again every time, but to perform the specified procedure once for a certain standard size of the tray and use the calculation results in further projects to select the optimal layouts of cable support systems.