Hallo
hier ein Dok aus dem jahr 2007............ viel Spass
NX Automation
Vision
Following the "Open by Design" philosophy, NX provides a comprehensive set of toolkits that allow you to capture and preserve domain knowledge over the lifetime of a product.
The open automation vision centers around the ability to offer flexible solutions to capture workflow knowledge, automate, and customize a user's interaction with the NX environment.
UGS is committed to providing solutions that work well in heterogeneous networked environments, and endeavors to support a wide range of languages, platforms, and new technologies as they emerge.
Ranging from simple customization utilities to advanced programming toolkits, the NX Open suite of products provides an extensive and flexible environment for automating and customizing NX.
Overview
NX Open is a collection of Application Programming Interface (API) toolkits that allow for the flexible integration of ancillary software applications with NX through an open architecture.
The intent is for the integrated applications, along with third party and NX applications, to share data on different computer platforms, from different locations (heterogeneous network),
and even across the Internet. The NX Open APIs, by design, provide an open architecture which can be utilized by third parties, customers, and in-house users for integrating and/or
creating custom software applications; thus allowing geographically diverse locations and multi-disciplinary teams to collaborate more effectively on designing, developing,
and manufacturing their products.
The NX Open APIs provide the applications and tools that enable customers to:
• Interface with the NX Object Model through NX Open C/C++ API, NX Open for .NET API, NX Open for Java, or GRIP (Graphics Interactive Programming).
• Select the programming language they prefer to work with since NX delivers the same automation capabilities in multiple languages.
• Create and manipulate User Defined Objects (also referred to as Custom Objects) including managing their associativity with other NX objects and providing methods for updating and displaying the User Defined Objects.
• Configure NX as a service, since the object-oriented structure of the Common API allows users to take advantage of the standard remote facilities provided by the .NET and Java platforms.
• Customize the NX graphics interface to tailor their NX environment to best meet their specific workflow needs, and also allows users and third-party developers to create custom menus for their own applications in an integrated, seamless manner.
• Take advantage of related products such as, Teamcenter Integration ITK, and Parasolid.
• Utilize and integrate new NX Open API technologies as they become available.
Available toolkits
NX provides an automation architecture that serves as the foundation for all NX APIs as well as a new journaling utility. Called the Common API, this foundation combines the power of journaling and automation with the freedom of a language-neutral platform. From this single-point foundation, UGS offers the following automation toolkits for NX:
NX Open C++ — A new Open C++ object oriented library derived from the Common API. This new Open C++ library is 100% compatible with the existing Open C and Open C++ APIs, and is the product through which users can enhance their existing Open C++ programs with calls to new NX functionality.
Open C — The Open C API (a.k.a. User Function) is a direct programming interface to NX that allows users to create custom applications using the popular C programming language. It is used by NX developers, customers, and alliance partners to produce unique applications to augment NX or to act as completely separate utilities. Open C also provides a fully extensible data model, allowing customers to define new types of objects that can be treated just like standard NX objects and stored persistently in NX part files.
Open C++ — Open C++ is an object–oriented interface to NX. Written in C++, this API takes full advantage of object–oriented features including inheritance, encapsulation and polymorphism. Open C++ provides complete access to its class hierarchy, allowing customers to override methods, derive their own classes, and create entirely new, persistent objects in NX. Open C++ is fully compatible with the existing Open C API.
NX Open for .NET — A new API for use with Microsoft's .NET framework. Built on the Common API, this interface provides programmatic access to NX core application functionality, making it possible to create advanced automation programs using any of the .NET-compliant languages, including Visual Basic.NET and C#. Because the API is built on the .NET framework, users can take full advantage of all the benefits provided by that framework, including native dialog development tools (Winforms).
NX Open for Java — A new API derived from the Common API and built for use with the Java platform. NX Open for Java is designed for users who want to write advanced NX Open automation programs while taking advantage of the benefits of the Java platform.
Journaling — The Journal utility is a rapid automation tool that records, edits, and replays interactive NX sessions. Built from the Common API and based on the programming language Visual Basic .NET, it produces a scripted file from an interactive session of NX which can be run at a later time to replay the session. These sessions can be edited and enhanced with simple programming constructs and user interface components to produce a rapidly-generated customized program. All enhancements are provided through the Common API. As a consequence, these enhancements are available to all libraries derived from the Common API. By providing a single automation framework for all of our automation interfaces, our automation strategy is consolidated into one common, consistent and stable approach for providing customization tools for our users.
In addition to the Common API toolkits provided above, UGS provides the following automation tools:
NX Open GRIP — GRIP (Graphics Interactive Programming) is an intermediate scripting language for automating CAD/CAM/CAE tasks. Users can create applications to automate Numerical Control (NC) operations, create geometric and drafting objects, control system parameters, perform file management functions and modify existing geometry. By using a vocabulary of English-like words, it is similar in many ways to interpretive BASIC or FORTRAN. In some cases, GRIP can perform advanced, customized operations, in a more efficient manner than using interactive NX. You can perform almost
any operation using GRIP that you can perform interactively. GRIP is a legacy API which is maintained but not actively enhanced.
NX Open User Interface Styler — User Interface Styler is a visual user interface builder that makes it possible to interactively design portable NX–style dialogs. Used both internally by UGS developers and externally by users and third–party developers, User Interface Styler provides the application module, dialog builder, objects, libraries and documentation necessary to interactively create production ready dialogs. The User Interface Styler is compatible with MenuScript and can be associated with an action in a MenuScript ".men" file. Thus, User Interface Styler dialogs can be launched from a MenuScript menubar.
MenuScript — MenuScript is a tool that allows end users and third–party developers to use ASCII files to edit NX menus, and create custom menus for their own applications in an integrated, seamless manner. Menu files support custom tailoring of the main menu bar and the Quick View Popup menu. Customers can create specialized menus and user interface dialogs, exposing and augmenting only the NX functions required in the custom workflow process.
Modes of Operation
All NX Open API programs can run in three different operational modes, depending upon the language and on which libraries are used.
Interactive (a.k.a. Internal)
Interactive programs are meant to be executed from inside of an NX session and are loaded into the NX process space. The results of an interactive program are visible in the graphics window of an NX session and give the user the opportunity to see the impact the program has on displayable objects in the object model. One advantage of an interactive program is that, in general, the executables are much smaller and link much faster. Once an interactive program is loaded into memory, it stays resident for the remainder of the NX session unless you utilize the facilities within the API to unload it.
Batch (a.k.a. External)
These programs are stand alone programs which run without NX user interaction or NX display, and can execute from the operating system, from a process outside of NX, or as a child process spawned from NX. Although batch programs do not have a graphics display, the API provides functions that allow plotting and the creation of CGM files.
Remote
The remoting mode allows an NX user to execute an automation program in a separate process from the NX session. You can either connect to an NX session running on the same machine, or via the network to a remote machine. Remoting makes use of the services provided by the .NET or Java frameworks. For this reason, it is not available in the C++ version of the NX Open API.
Licensing
Author Licenses
Regardless of which API you wish to program with, you must have the appropriate Author license in order to build custom applications against any of the NX APIs. At least one development license is required per site to install any of the NX Open API toolkits. For the .NET and Java APIs, the Author license is also required to properly "sign" an authored executable. Without this embedded signature, the program will fail to execute. More information about this signing procedure can be found in the specific Programmers Guide for each API.
Licensing for Common API Objects
In support of the new journaling and automation tools, and in conjunction with usability requirements for consistency in performance across applications, a new licensing mechanism has been implemented for the execution of all NX Open programs. This mechanism follows the same licensing paradigm used by the NX user interface, which provides execution permission on a per–application, licensed basis.
With this new licensing scheme, each property and method in a Common API object has a license specification that indicates what licenses, if any, are necessary to invoke a particular property or method. License checking occurs during the execution of a custom application or a journal. When invoking an object property or method from a journal or an automation program, NX will:
check for all required licenses
acquire them if they are not already held
hold onto the licenses for the duration of the execution of the program or journal
release the licenses when all programs are unload or when journal replay stops
Any user attempting to run a journal or a custom program built using any of the Common API's (.NET, C++, Java) must have all the necessary application licenses associated with each API call, or the journal or program will not successfully complete. In the case of a licensing failure, an NXException error message will be presented.
User programs can have fine control of licenses used by their programs with three methods available in the LicenseManager Class available in C++, Java, and Visual Basic. These methods are documented in the appropriate NX Open language Reference Guides under NXOpenLicenseManager.
Licensing for Legacy API objects—Up to NX3
The Common API licensing mechanism is completely different from the licensing behavior for existing NX APIs (GRIP and Open C/Open C++). Execution of a custom program written with these APIs requires only a single Runtime (a.k.a. UG/Open Execute) license, no additional application licenses are reserved. Runtime licenses serve a single concurrent application program being run by a user. If the customer expects that multiple concurrent applications might need to be run, then multiple Runtime licenses are required. The Runtime license is consumed for the duration of the NX session unless the license is specifically unloaded (Open C only) or the NX session is terminated.
Licensing for Legacy API objects—NX 4 and Up
Beginning with NX 4, the Open C and Open C++ APIs will be converted to the new Common API licensing paradigm and each Open C/Open C++ routine will require at least one (NX) license to execute. Additional license requirements will be added to those functions that are specific to a given application. For example, the UF_DRF_create_hole_dim function would require the reservation of a Drafting license in addition to the Gateway license.
Although this new licensing scheme will be implemented with NX 4, the Runtime execution mechanism will continue to operate in order to support existing custom programs. Therefore, customers with existing Runtime licenses can maintain those licenses and their custom applications will continue to operate using the Runtime license only.
Note, however, that the Runtime license only works for legacy Open Cand Open C++ routines. Any property or method call made against new NX Open for C++ objects derived from the Common API will always require the appropriate feature license during execution.
Licensing for GRIP
Licensing for the GRIP library will continue to follow the old licensing paradigm. One author site license is required to author a GRIP program, and concurrent Runtime license(s) is/are required to execute the program.
Summary
Historically the recommended NX Open API was C. However, as of NX 3, NX now has a Common API which has language bindings for C++, .NET VB (and other .NET languages such as C++ and C#), and Java. This means that all of the languages have the same capabilities using the same set of objects and methods. All languages also have access to the methods in the legacy C API (User Function). So there is no longer a recommended language.
The one difference is that although all languages can be Journaled, only a .NET VB Journal can be replayed. But all Journals can be compiled, linked and then ran as a custom program. GRIP is a legacy API which is maintained but not actively enhanced.
------------------
Wer glaubt etwas zu sein, hat aufgehört etwas zu tun !
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP