The Last Renga API Review

The system for the design of buildings and structures of Renga is being actively developed, it has tools for architects, designers of KZh and KM, engineers of VK, OV, EO and ES. With each version, the system, which is now divided into Renga Architecture, Renga Structure and Renga MEP, and will soon become one, is expanding its functionality. Along with this, it grows and changes, becoming more and more popular API. Indeed, in Renga you can create an information model of a building, but you cannot (and do not plan) to get a beautiful render, an estimate for the construction or calculation of pipelines. Of course, you can export the model from Renga to such common formats as OBJ, IFC, STEP and many others, but in order to do without intermediaries and avoid possibly misinterpreting data during export / import, it is better to act through the API.

Renga MEP

Initially, when the question arose of creating the Renga API (after the release of the first version of Renga Architecture), we focused only on the C ++ API, based on the requirements that we had at that time.

As Renga developed, we began to receive questions from developers about whether it is possible to write in C # and other languages ​​under Renga and which versions of Visual Studio are supported.

Then, after analyzing the availability of the API for users, we thought about changing the technology.

The fact is that the C ++ API is pretty tough. It is highly dependent on the compiler, i.e. if the SDK is compiled by the Visual Studio compiler, then you probably cannot compile it using, for example, gcc, since name mangling is not standardized, there may be differences in the implementation of virtual tables, templates, etc. In Visual Studio itself, there may also be differences in compilation settings and support for the standard from version to version.

In general, one could live with this, for example, using virtual functions to a minimum (and as a consequence inheritance), without using templates and fixing the standard used and the development environment for a certain period of time.

In addition, we could create several versions of the API for different environments and / or versions of the system.
But still, we decided to look the other way. And after research, they chose COM.
This standard was developed back in 1993, that is, it is not just old, but superstar) But it allowed us to provide users with a single API, using which you can write plugins in C ++, C # or another COM-compatible language, in addition, you can use the COM API to access to Renga from third-party applications, including those written in languages ​​with dynamic typing, for example, in Python.

Renga API Help

I must say that the Renga API Help details how to get started, what and how to use it. But we still tell you what you need to write an extension for Renga.

So, to write an extension for Renga in any language you will need:

  1. Renga and understanding what exactly you want to automate when working with the system.
  2. Renga Software Development Kit.
  3. Microsoft Visual Studio. Any version younger than 2012.
  4. Knowledge of the basics of programming.

You can find out about the Renga system and its capabilities on the system’s website , in the help , in the developers’s blog , as well as in groups on VK and Facebook , announcements and recordings of webinars are posted there, you can also find real users of the system and chat with them. Therefore, we will omit the point of acquaintance with the system, but we will specify what requirements the API can now satisfy.

Using the Renga API, you can:

  • select objects in the model and handle the object selection event in Renga;
  • receive and change object parameters,
  • ;
  • ;
  • , , ..;
  • , ;
  • 3D ;
  • IFC;
  • DWG/DXF;
  • , , ,
  • , .
  • .

At the moment, you cannot create a new object from the API, this is in the plans, but not for the next release.

It should be noted that the Renga API is expanding at the request of users, and if you did not see the automation capabilities that you need in this list, contact us and we will discuss your idea.

If we continued to work only on the C ++ API, the set of features would most likely be the same, but we are almost sure that not all Renga extensions would be born. By the way, you can see the list of extensions known to us on the site .

Now let's see what in the end we offer our users in terms of API. To get the Renga SDK, you just need to download it. And to use it you can study and use the examples that are in the archive.

image

There are examples in the SDK for writing extensions in C ++ and C #, as well as examples of connecting to Renga in Python. The Renga API Help in How To sections lists examples that use the techniques from this section.

Examples of C ++ and C # plugins demonstrate almost all the API features, in Python examples you will find how to use it to create a custom property in Renga from a third-party application, as well as how to automate opening, saving and closing a Renga project using a script.

Currently, Renga can load plugins from C ++ binary DLLs and .NET assemblies, and using dynamically typed languages ​​such as Python, VBScript, 1C and others, you can access Renga API from third-party programs to obtain the necessary data.
In general, we are pleased with the transition to the COM API and the opportunities that it has opened for our users.

Any Renga extension that is called from Renga must consist of a binary file for the plugin and an .xml file with the extension .rndesc, with the following contents:

<RengaPlugin>
   <!--   -->
   <Name>Best Plugin</Name>
   <!--   -->
   <Version>1.0</Version>
   <!--    -->
   <Copyright>Copyright text</Copyright>
   <!--   Renga API -->
   <RequiredAPIVersion>2.3</RequiredAPIVersion>
   <!--   cpp/net -->        
   <PluginType>Plugin type</PluginType>
   <!--    -->                     
   <PluginFilename>Best_Plugin.dll</PluginFilename> ->
   <Vendor>Renga</Vendor>                           
</RengaPlugin>

To connect the extension to Renga you need to install or copy it to the Renga \ Plugins installation folder. The information contained in the .rndesc file is displayed in the Extensions tab of the Renga Settings window.

We are confident that, armed with the knowledge gained, and our programming knowledge, any developer can write an extension for Renga. But if you have an idea of ​​expanding Renga, and there are problems with its implementation, write on the forum or register a request in ServiceDesk . We welcome questions!

All Articles