The use of existing standard systems in the company creates, besides the undisputed advantages of the use of widespread software, a limitation of the own processes to possibilities provided by the software. This does not only apply to office applications, browsers or ERP systems, but also to CAx and PLM software.
The aforementioned restrictions can cause unwanted additional work here, for example through many clicks and extensive methods, or simply prevent desired processes.
The major manufacturers of widely used applications are well aware of this fact and therefore frequently offer programming interfaces for extensions.
Many companies rely on powerful CAx systems for their individual processes in the areas of design, construction and manufacturing. Leading systems such as CATIA V5, SolidEdge or Inventor offer interfaces to extend functionality. Such an interface is also offered and widely used for the Siemens NX CAx application.
The so-called NXOpen interface offers the possibility to create and use custom application extensions for NX in different programming languages.
The interface is based on an object-oriented class structure that provides the user with all required classes and structures with their functions. This class structure is available in the C/C++, Java programming languages and as wrapper, the C/C++ structure also for the .NET languages C# and VB.NET. SWMS uses the modern language variants C# and VB.NET to extend Siemens NX.
The easiest way to get started with NXOpen programming is to record and evaluate journals. These can be recorded in the desired language in the corresponding menu and then serve as a template for your own development.
Figure 1: NXOpen Singletons
Journals follow a fixed scheme, just as their own applications should. For example, this scheme specifies the important function names, which are then used by NX to jump into its own application. The best example of this is the Main function, which in most cases is the main entry. In this function, the first connection points to the current NX session are usually set in recorded journals. The most important connection is the session i.e. the current session. The assignment is done by a relatively seldom used singleton, here the "GetSession". Starting from this session object, all data types, the parts loaded within the session, etc., can be used. The Singleton implementation allows the developer to use this call multiple times in the application because the same object is always returned.
Recorded journals are an important starting point for your own development. They are used to gain an insight into the processes within Siemens NX and to record the appropriate use of the available objects and functions. However, this valuable tool also has its limitations. This is especially true in the area of user interaction. If a function is recorded in which the user has to make a manual entry - in our example the edge length of a cuboid - this is only recorded transparently in the recorded code. In the example shown below, in the case of edge lengths, you can see the numerical values entered ("100") without knowing their origin. Such and similar cases naturally present a small challenge on the way from the recorded journal to your own application. Cleverly substituted by custom input possibilities and can however quickly be further developed from such a journal.
Figure 2: NXOpen Journal
The output of simple information, such as the number of components in the assembly, article lists, weights, dimensions and many others, is also a very popular and widespread application. The import and export of geometries and metadata also plays an important role in the development of NXOpen extensions.
Many of these capabilities can even be automated without a costly additional license.
By using journals one loses some comfort in the development, but also saves license costs compared to fully trained applications, which have to be signed with a special license.
Based on basic examples such as the one shown above, it is possible to develop applications of any complexity and use them in everyday product design. This includes the possibility to use individually designed user interfaces with the help of common frameworks (Forms, WPF, etc.) or to compile an NX-custom interface from prefabricated components in the so-called Blockstyler, an additional application in Siemens NX.
Figure 3: Magic NX Wizzard
The NXOpen interface between the NX CAx platform and a self-created application offers various possibilities for the automation of the entire system. This opens up opportunities to simplify your own work. A typical example here is to automate frequently performed use cases, such as the export to an exchange format, so that instead of several clicks in the corresponding NX wizard, the export with the desired settings takes place with one click.
Even if many don't believe it at first: Such small aids save a lot of time and spare the nerves of the user.
They also provide a good introduction to an individually adapted environment. Design assistants, intelligent component adaptations and specific tests are further options for using the system more efficiently and reducing time-consuming routine work. Finding a way to work is initially difficult for some, but once a good basic framework has been created, the continuation of the work becomes increasingly easier. Small little helpers that are easy to implement and also convince some superiors to allocate time and capacities for corresponding activities.