Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
72 views

What Is Application Programming Interfaces

An API is a set of subroutine definitions and protocols that allow software components to communicate with each other. APIs specify how clients should interact with software components to solve problems. Common examples of APIs include those for operating systems, programming languages, and online systems. The NX Open API allows programmers to customize and extend the NX CAD software by creating applications that can automate tasks and capture design processes. NX Open provides functions for creating geometry, assemblies, drawings, and other CAD objects.

Uploaded by

asdw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

What Is Application Programming Interfaces

An API is a set of subroutine definitions and protocols that allow software components to communicate with each other. APIs specify how clients should interact with software components to solve problems. Common examples of APIs include those for operating systems, programming languages, and online systems. The NX Open API allows programmers to customize and extend the NX CAD software by creating applications that can automate tasks and capture design processes. NX Open provides functions for creating geometry, assemblies, drawings, and other CAD objects.

Uploaded by

asdw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

2.

1 What is Application Programming Interfaces (APIs)

In computer programming, an application programming interface (API) is a set of


subroutine definitions, protocols, and tools for building application software. In general
terms, it is a set of clearly defined methods of communication between various software
components. A good API makes it easier to develop a computer program by providing all
the building blocks, which are then put together by the programmer. An API may be for
a web-based system, operating system, database system, computer hardware or software
library. An API specification can take many forms, but often includes specifications for
routines, data structures, object classes, variables or remote calls. POSIX, Microsoft
Windows API, the C++ Standard Template Library and Java APIs are examples of
different forms of APIs. [2]
Graphics programming language are generally interpreted or pseudo-interpreted
code that comprises calls to the main program procedure, their execution speed is
generally fairly slow. Also, because they are not widely used, the implementation of the
language may be less robust than their more celebrated sibling, such as Pascal, C or C++.
They have limitation in that they cannot make use of function and procedure libraries for
numerical analysis and for graphics and they often have a relatively limited range of core
programming features. API normally comprises a library of procedures that may be used
for variety of system function such as:
 Access the data values for model entities
 Add, modify and delete geometric entities
 Manage part and other files
 Access and set system values such as line-style and color
 Create view
 Interact with the operator
 Output non-graphical data to the graphics screen
 Dimension drawing

An Application Programming Interface (API) provides an abstraction for a problem


and specifies how clients should interact with software components that implement a
solution to that problem.
The components themselves are typically distributed as a software library, allowing
them to be used in multiple applications. In essence, APIs define reusable building blocks
that allow modular pieces of functionality to be incorporated into end-user applications.
An API can be written for yourself, for other engineers in your organization, or for the
development community at large. It can be as small as a single function or involve hundreds
of classes, methods, free functions, data types, enumerations, and constants. Its
implementation can be proprietary or open source. The important underlying concept is that
an API is a well-defined interface that provides a specific service to other pieces of
software.
Screen 1:- Basic stricture of APIs [2]
2.2.1 Analogy

As an analogy, consider the task of building your own home. If you were to build a
house entirely on your own, you would need to possess a thorough understanding of
architecture, plumbing, electronics, carpentry, masonry, and many other trades. You would
also need to perform every task yourself and keep track of the minutest of details for every
aspect of the project, such as whether you have enough wood for your floorboards or
whether you have the right fasteners to fit the screws that you’ve bought. Finally, because
you are the only person working on the project, you can only perform a single task at any
point in time and hence the total time to complete the project could be very large.
Screen 2:- Contractor and building house [2]
An alternative strategy is to hire professional contractors to perform key tasks for
you (Fig. 2). You could hire an architect to design the plans for the house, a carpenter for
all of your wood work needs, a plumber to install the water pipes and sewage system for
your house, and an electrician to set up the power systems. Taking this approach, you
negotiate a contract with each of your contractors telling them what work you want done
and agreeing upon a price they then perform that work for you. If you’re lucky, maybe you
even have a good friend who is a contractor and he offers you his services for free. With
this strategy, you are freed from the need to know everything about all aspects of building
a house and instead you can take a higher-level supervisory role to select the best
contractors for your purpose and ensure that the work of each individual contractor is
assembled together to produce the vision of your ideal home. [2]
The analogy to APIs is probably obvious: the house that you’re building equates to
a software program that you want to write, and the contractors provide APIs that abstract
each of the tasks you need to perform and hide the implementation details of the
work involved. Your task then resolves to selecting the appropriate APIs for your
application and integrating them into your software.
The analogy of having skilled friends who provide contracting services for free is
meant to represent the use of freely available open source libraries in contrast to commercial
libraries that require a licensing fee to use in your software. The analogy could even be
extended by having some of the contractors employing subcontractors, which corresponds
to certain APIs depending on other APIs to perform their task.

2.3 Types of API

2.3.1 System dependent API: The programming language that comes along with particular
CAD/CAM package is called as a system dependent API [1]
e.g. AutoLISP for AutoCAD, GRIP for Unigraphics, Pro-Programming for
Pro/Engineer, etc.
2.3.2 General purpose API: The widely used programming languages that are common to
every CAD/CAM software, are called general purpose API
e.g. C, C++, Visual BASIC, Visual C++, etc.

Screen 3:- UG/NX Common API

2.4 NX Open

NX Open is an Application Programming Interface (API) that lets us to write


programs for customize or extend NX. The benefit is that applications created this way can
often speed up repetitive tasks and capture important design process knowledge. [9]
There is a broad range of NX Open functions which provide capabilities like
i. Creating part geometry, assemblies, drawings, CAE and CAM objects.

ii. Cycling through the objects in a part file, reading information or performing
various operations on them.

iii. Creating custom user interfaces that allow users to select objects and enter data.
Applications
i. Creating part geometry or drawings according to your local standards.
ii. Importing data from other sources or outside of NX.

iii. Reading data from objects in a part file and writing it out in some form of report.

iv. Building custom applications to make processes faster or easier to understand

Benefits

i. Ability to customize NX to meet your specific industry and process needs

ii. Decreased time to market by automating complex and repetitive tasks

iii. Reduce rework by capturing and reusing company and industry best practices

iv. Maintain NX look and feel to reduce user training time

2.4.1 NX Open by Siemens


NX Open is a collection of Application Programming Interface (API) toolkits that
allow for the flexible integration of custom software applications with NX through an open
architecture. The intention is to automate complex and repetitive tasks. Also to allow for
the integration of diverse applications, along with third party and NX applications, to share
data on different computer platforms, from different locations using heterogeneous
networks, and even across the Internet. The NX Open APIs provide an open architecture
which can be utilized by third parties, customers, and in-house users for creating and
integrating custom software applications.

The NX Open APIs provide the applications and tools that enable customers to:

Access the NX Object Model

Create and edit objects in the NX Object Model

Select the preferred programming language

Create and manipulate User Defined Objects (UDOs)

Manage associations between UDOs and other NX objects

Configure NX as a service, using standard facilities to create remote applications

Customize the NX interface to tailor the NX environment to best meet their specific
workflow needs
Create integrated custom menus with third party developers for their applications

Take advantage of related product APIs such as, Teamcenter Engineering ITK, and
Parasolid

Features

A uniform object model across all languages, included Knowledge Fusion

Popular bindings to modern programming languages

Journal record and playback for all languages and platforms

Full journaling and automation coverage

Integration with high end development environments

Journals and programs managed by Teamcenter

2.4.2 Types of executable


Programs using functions from Open C and C++ can be written in two different
modes: Internal and External.
 Shared library (Internal)
 Standalone executable (External).

Internal
An internal Open API program is a shared library whose symbols get resolved at
run time which occurs interactively within a NX session. When an internal Open C and
C++ API program runs interactively it gives the user the opportunity to visibly see the
results that a program has on displayable objects in the Object Model. Programs can be
developed to access and create geometry, analyze geometry, create and edit features, create
and edit expressions, and manage data. Routines to interact with users using standard NX
Motif widgets are provided. Access to general Motif calls is supported within the Open
API. However, no macro support is possible with these dialogs.

External

An external Open API program is a standalone executable image that is linked


against the same shared libraries as NX but its symbols are resolved at link time rather than
run time. An external program runs without NX user interaction or NX display. External
programs tend to be more for data management than for geometry manipulation.
An external program can construct and edit models if no model display is necessary.
Both plotting and CGM file creation are possible from external mode also.

You might also like