You are on page 1of 7

Available online at www.sciencedirect.

com
Available online at www.sciencedirect.com

ScienceDirect
ScienceDirect
Available online at www.sciencedirect.com
Procedia Manufacturing 00 (2019) 000–000
ScienceDirect
Procedia Manufacturing 00 (2019) 000–000 www.elsevier.com/locate/procedia
www.elsevier.com/locate/procedia

Procedia Manufacturing 51 (2020) 1014–1020

30th International Conference on Flexible Automation and Intelligent Manufacturing (FAIM2021)


30th International Conference on Flexible
15-18 June Automation andGreece.
2021, Athens, Intelligent Manufacturing (FAIM2021)
15-18 June 2021, Athens, Greece.
Object-oriented approach to product design using extended NX Open API
Object-oriented approach to product design using extended NX Open API
Andrei Lobov*, Tuan Anh Tran
Andrei Lobov*, Tuan Anh Tran
Norwegian University of Science and Technology, Richard Birkelands Vei 2B, Trondheim 7034, Norway
Norwegian University of Science and Technology, Richard Birkelands Vei 2B, Trondheim 7034, Norway

* Corresponding author. Tel.: +47-45-913-455. E-mail address: andrei.lobov@ntnu.no


* Corresponding author. Tel.: +47-45-913-455. E-mail address: andrei.lobov@ntnu.no

Abstract
Abstract
Knowledge-based engineering (KBE) helps to automate the design of products and corresponding manufacturing systems. The automation is
Knowledge-based engineering
achieved via engineering (KBE)
knowledge helps to automate
representation the design of products
in computer-processable andi.e.
formats, corresponding
languages. Itmanufacturing
becomes possiblesystems. Theproduct
to capture automation is
design
achieved via engineering
and manufacturing knowledge
processes representation
knowledge in computer-processable
and let software formats,
applications to handle i.e. languages.
it suggesting better It becomes
options for possible
a producttoand/or
capturea product design
manufacturing
and manufacturing
system. processes
In this paper knowledge
we demonstrate an and let software
application applications to methodology
and corresponding handle it suggesting
to designbetter
andoptions forthe
evaluate a product and/orofa amanufacturing
performance product. The
system.
approachIncan
thisbepaper we demonstrate
extended to different an application
engineering and corresponding
problem domains savingmethodology to design
the time used and evaluate
for product design. the performance of a product. The
approach can be extended to different engineering problem domains saving the time used for product design.
© 2020 The Authors. Published by Elsevier Ltd.
©
© 2020
2020
This is an
The
The Authors.
Authors.
open
Published
accessPublished
by Elsevier
by Elsevier
article under Ltd. Ltd. license https://creativecommons.org/licenses/by-nc-nd/4.0/)
the CC BY-NC-ND
This
This is
is an
an open
open access
access article
article under
under the the
CC CC BY-NC-ND
BY-NC-ND license
Peer-review under responsibility of the scientific committee
license (https://creativecommons.org/licenses/by-nc-nd/4.0/)
https://creativecommons.org/licenses/by-nc-nd/4.0/)
of the FAIM 2020.
Peer-review underresponsibility
Peer-review under responsibilityofof
thethe scientific
scientific committee
committee of FAIM
of the the FAIM 2021.
2020.
Keywords: knowledge-based engineering; product design; CAD.
Keywords: knowledge-based engineering; product design; CAD.

1. Introduction tools. It becomes possible to integrate and turn these tools into
1. Introduction tools. It becomesThe
KBE platforms. possible to integrate
mainstream and turn these
programming tools give
languages into
Object-oriented programming languages started to emerge KBE platforms. The mainstream programming languages
a potential of many software libraries, modules and easy-to-use give
in Object-oriented
1970s as a convenientprogramming languages
organization started
of the to emerge
computational aplatforms.
potential For
of many software
example, a new libraries,
Pythonmodules and easy-to-use
library could be almost
in 1970s letting
problem as a convenient organization
software objects to interactof the
withcomputational
each other to platforms. For example,
instantly added a new Python
to the computer usinglibrary could<library>
pip install be almost
problem letting software
solve a problem. objects
One of the to interact
reasons could bewith
seeneach otherit to
is that is instantly
command. added to the computer using pip install <library>
solve
easier to define interaction protocol, i.e. interface / methodsit to
a problem. One of the reasons could be seen is that is command.
The transformation of software engineering and
easier to define
be called interaction
and situations when protocol, i.e. interface
these should be called / methods
rather than to The transformation
development of ICT give of new software
prospects engineering
for rapid product and
be called
trying to and situations all
comprehend when thethese should
possible be calledand
scenarios rather than
encode development of ICT give new prospects for rapid
modelling and analysis delivering results, if needed, to remote product
trying to comprehend all the possible
them into some common and single execution thread. scenarios and encode modelling
and multiple and locations
analysis delivering
for betterresults, if needed,
discussions and todecision
remote
them into some
Active common and
development of single execution thread.
knowledge-based engineering and multiple locations for better discussions
making. A simple API for application development is and decision
Active
(KBE) development
solutions began in theof 1980s.
knowledge-based
Object-oriented engineering
languages making.
important Aforsimple
adoptionAPIandforuseapplication
of KBE tools. development
This paper is
(KBE) solutions began in the 1980s. Object-oriented
were also proposed to express key concepts for parametric languages important for adoption and use of KBE tools.
proposes an extension of NX Open API to simplify product This paper
were also proposed to express key concepts
product representation using geometry shapes. These are for parametric proposes
developmentan extension
and analysis.of NX Open API to simplify product
product representation
mostly Lisp-inspired using geometry shapes.
knowledge-representation Thesesuch
languages are development and analysis. do exist for object-oriented design.
Different methodologies
mostly Lisp-inspired knowledge-representation
as, for example, General-purpose Declarative Language languages such OneDifferent methodologies
of the prominent do exist Process
is the Unified for object-oriented
methodology design.
[17].
as,
(GDL),for Adaptive
example,Modelling
General-purpose
LanguageDeclarative Language
(AML) or Knowledge One
The methodology can be seen as a tringle having for[17].
of the prominent is the Unified Process methodology its
(GDL),
Fusion Adaptive
(KF) [16]. Modelling
GeneralLanguage
purpose (AML) or Knowledge
programmers or the The methodology
vertices: models, toolscan and
be seen as a tringle
techniques. Ideally,having for its
right models
Fusion
graduates(KF) [16]. General
in software engineeringpurpose
most programmers
probably haveornever the vertices:
capturingmodels,
relevanttools andoftechniques.
aspects Ideally,
a problem help right models
to understand or
graduates in software engineering most probably
heard of those. With the time, “mainstream” programing have never capturing relevant aspects of a problem help
solve it by using right (software) tools following right to understand or
heard
languagesof those.
that areWith the time,
typically found“mainstream”
in curricular of programing
software solve it by using right (software) tools following
techniques or engineering steps. These elements should support right
languages
engineers also thatfound
are typically
their APIfound in curricular
implementation for of software
engineering techniques
each other.or engineering steps. These elements
Powerful, easy-to-use tools areshould support
meaningless
engineers also found their API implementation for engineering each other. Powerful, easy-to-use tools are meaningless
2351-9789 ©©2020
2351-9789 2020TheThe Authors.
Authors. Published
Published by Ltd.
by Elsevier Elsevier Ltd.
2351-9789
This
This isisanan©open
2020
open Thearticle
Authors.
access
access Published
article
under under
the by
theElsevier
CC BY-NC-ND Ltd.
CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0/)
license https://creativecommons.org/licenses/by-nc-nd/4.0/)
This is an open
Peer-review
Peer-review access
under
under article under
of the scientific
responsibility
responsibility CC BY-NC-ND
of the license
scientific
committee https://creativecommons.org/licenses/by-nc-nd/4.0/)
committee
of the FAIMof the FAIM 2021.
2020.
Peer-review under responsibility of the scientific committee of the FAIM 2020.
10.1016/j.promfg.2020.10.142
Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020 1015
2 Author name / Procedia Manufacturing 00 (2019) 000–000

without relevant models or may be difficult to apply without technologies. Therefore, it is important to make KBE solutions
clear instructions (techniques). Models may capture relevant affordable for SMEs and organizations which may have
information, but be difficult to process without the tools, and challenges to get proper resources that may not seem having
so on. In the context of the KBE, product models are created direct link to their core business. For instance, the necessity for
using Computer-aided design (CAD) tools that create three- a manufacturing SME to hire a software engineer may not be
dimensional (3D) representation of a product. Furthermore, always evident.
modeling of physical properties and material of the product and As, for example, for ship blocks welding workshop, “block
its environment make it possible to simulate product behavior. scheduling is done manually, which is also the method used by
These models can be generated using KBE APIs and the above- shipyards at present time” [4]. A manufacturing of a large and
mentioned knowledge-representation languages. However, heavy product such as a ship, may take hundred kilometres of
their use and the use of the KBE solutions despite sometimes welding generally performed by human welders. Those sites
tremendous savings of going from man-weeks work to minutes can pose threats to human operators, as for example,
[18] is still not wide-spread. One reason could be claimed on shipbuilding industry is seen as “one of the most hazardous
the search for proper KBE methodology establishing links industries” [5]. Therefore, an automation of manufacturing for
between models, tools and techniques. This paper shows that large-in-size and heavy products requires new solutions to
extending NX Open API it is possible to raise the level of design, digitally validate, and guide manufacturing site fast
abstraction to more manageable and easier to use concepts for setup and reconfiguration. The use of smart mechatronic
the problem domain. This should hide some of the complexity systems is seen as a key to enable fast setup and reconfiguration
connected to the geometry modeling, which is the core of the of manufacturing sites.
CAD tools. Still the direct use of an API such as NX Open may The product design can be supported by knowledge-based
require hundreds of code lines to express “simple” operations engineering (KBE) methods. These are, for example, employed
a CAD engineer can do within a few second by directly in aerospace industry [6]. Such products could be seen as
manipulating 3D object on the canvas in the CAD tool. mission critical. The use of KBE requires great efforts meaning
Therefore, extensions of API are needed, which, as we show in that the affordable solution for easy uptake of KBE is still to be
the paper, can reduce amount of code lines to just a few. Such found. Use of web standards for integrating different elements
a reduction should make an approach more affordable for of KBE systems could be seen as one of the possible direction
engineers. towards common and universal engineering knowledge
The rest of the paper is organized as following. The next representation and integration language [15].
section describes state of the art for knowledge-based B. KBE and API support
engineering and APIs. The third section describes object-
As the API support become available for Computer-aided
oriented approach for product design that is followed by
Design (CAD) tools, different applications stated to be
application example in section four. Conclusions and future
developed. In [7], Siemens NX C++ extension is made using
work come in the fifth section. NX Open API to automate the search of necessary objects for
fillets by analyzing the angles or edges for a work piece. This
2. State of the art could be important information as it can mean connection
points between different bodies in the design.
A. KBE and manufacturing
Use of an API gives new possibilities in education. The
A manufacturing system can be defined as “a subset of the
Mechanical Design Virtual Laboratory [8] was created for
production system”, which function “is the arrangement and
dynamic axle assembly using Visual C++ and NX. That
operation of elements (machines, tools, materiel, people and
highlights a possibility to build customized solutions for using
information) to produce a value-added physical, informational
KBE tools. Both geometric and assemble parameters were
or service product whose success and cost is characterized by
represented via a component. That can be seen as a need to
the measurable parameters of the system design” [1]. In order
tackle different viewpoints – problem domain and graphical
to help that arrangement, different technologies were
representation.
employed. One of those is Computer-integrated Manufacturing
or CIM that integrates different information systems [2]. Such The parametric design can go with wide-spread easy to grasp
an integration aims at creating different digital models and and apply interface such as Excel tables. Part families are
manage those at different stages of life cycles for products and reported to be updated using Excel interface described in [9].
manufacturing systems. The goal is to reduce development
efforts when designing and planning manufacturing of a The car front and back windshield inspection gauge was
product. With the advent of Internet of Things (IoT) or designed using NX platform [10]. The resulting system could
Industrial Internet of Things (IIoT) [3], a manufacturing propose a set of inspection gauges automatically to match
workshop can be seen as a collection of integrated of cyber- windshield and clamp board specifications.
physical systems with the high level of situational awareness In [11], the use of the NX Open API is reported for “Irkutsk
and decision making capabilities. Despite different approaches, Aviation Plant” to implement a recognition algorithm that
architectures and technologies suggested, still the enterprises, clusters and recognizes geometric primitives. These can form a
especially SMEs require great efforts to uptake given pattern that could (in this case) help differentiating between
approaches and commit to the latest supportive ICT various/different aeronautical engineering products. Wing
1016 Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020
Author name / Procedia Manufacturing 00 (2019) 000–000 3

mass estimation approach and shape optimization with The method initForNX() initializes the block in the NX
NASTRAN Finite Element analysis that can be accessed via environment. The methods subtract(tool) and
Siemens NX was reported in [13]. subractFrom(target) are used to subtract blocks from one
another taking different perspectives of a tool (as one shapes is
Siemens NX API was used in [12] to implement toolpath
used as a tool cutting the material from another) and that of
planning module to define processing parts and assign suitable
target (the shape being cut). Basically, having these two
operations and the processing strategy. NX postprocessor was
methods can be seen redundant as just one of those may
implemented in [14] to integrate the toolpath with the robot to
implement the subtraction following one selected perspective.
perform it.
However, such a redundancy may make the life of a designer
As a summary, KBE solutions are used for mission critical easier as one may naturally take and switch between the
complex products such as that of shipbuilding or aeronautic perspectives during implementation time.
industries. Also, some education is conducted and educational
The Analyzer class is put into the util package signifying a
environments for KBE are being created. Still, to make KBE
supportive tool for the product designer. As design eventually
more affordable and still to provide more than parametric
is stored in a file, the class has corresponding attributes for file
design with Excel, one should make a use of APIs. These APIs
name and path. Bodies in general correspond to the shapes but
should be therefore easy to learn and apply.
in the language of analyzer, as the bodies get physical
Siemens NX is extensively used to implement different ad properties that must be interplayed to check product
hoc solutions. In the following section we exemplify object- performance. Therefore, bodies attribute is defined at the
oriented approach to abstract Open NX API details, giving end Analyzer class to serve its methods.
users a possibility to stay closer to the concepts used in the
problem domain significantly reducing amount of code needed
for using the API.

3. Approach

Traditionally, a product designer may have a CAD tool to


build and analyze the performance of the product. The tool
allows manipulation and instant feedback to the designer via a
graphical interface. The manipulation is performed using basic
geometric shapes (2D and 3D), such as lines, circles rectangles,
…, spheres, cylinders, blocks, etc. The shapes can be united
and subtracted from one another to derive desired outlook for
the product. Furthermore, mathematical functions and patterns
can be imposed on these building blocks to at even a higher
geometrical complexity if desired.
The shapes provide problem domain language for product
design automation. These are the classes to consider for
product construction. The performance analysis requires other
concepts such as, for example, force, torque, vector and point /
region (of their application) as well as constrains that could be
translational or rotational for selected bodies and/or their faces.
Corresponding concepts should also be represented in the code
for design automation.
NX Open API has support for Python programming
language, which was used in this work for implementation. A
partial class diagram is shown in Fig. 1. The classes are
organized into two packages – shapes and util. The shapes
package in the figure contains 3 classes – Block, Cylinder and
Sphere. Each class has some attributes with the same names
among the classes, such as x, y, z that are used for point and
geometry origin definitions, in addition to other things such as
vectors. Furthermore, classes such as Cylinder and Sphere also
share similarly named attributes with respect to their origin and
diameter. Basic methods shown in the diagram for the shapes
are initForNX(), getVolume(), subtract(tool) and
subractFrom(target). This is a minimal set of methods that can Fig. 1. Partial class diagram for shapes and Analyzer class.
be used to demonstrate the product design process through
modification of 3D shapes to get a desired compound shape. The methods of the Analyzer class are listed in order of
Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020 1017
4 Author name / Procedia Manufacturing 00 (2019) 000–000

calling them in normal execution order to evaluate product 4. Example


performance. First, getSolidBodies() method is called to
retrieve the bodies from the design. Then, createFEM() method A. Use case
with corresponding meshing and material parameters is called
to generate Finite Element Model (FEM) of the body or bodies.
Simulation parameters are setup via defineSim(). It is important
to fix constrains and define loads. These operations are done
via assignConstrain(body, face) and assignForce(force, body,
face, direction) methods. For these operations, particular
bodies, their faces and then also force and the direction of its
application have to be specified. For instance, the body can be
constrained by its base, e.g. that of a cylinder, and the load can
be applied on top of the cylinder by the direction along the
length of cylinder. It is also possible to set the direction of an
acting force, as for cylinder’s case it could be pressing the
cylinder it or stretching it out. Code exemplifying the use of the
methods is shown in the next section.
Designer class in the middle is a place holder for the
application integrating product creation and its analysis. The
class is joined with the rest of the classes in the figure by
composite relationship having multiple cardinality (*) at the
end of packaged classes. It means that a product can be (a) (b)
constructed from many basic shapes, where each shape is
initialized as many times and with the corresponding values of
the attributes as needed. Also, several analyzers can be
instantiated each focusing on different aspects (e.g. bodies) and
their performance. This can also give a possibility for parallel
execution of analyzers, which can be important for designing
complex products.
The Designer class in the middle (Fig.1 and in Listing 1) is
a place holder for the application integrating product creation
and its analysis. The class is joined with the rest of the classes
in the figure by composites relationship, having multiple
cardinality (*) at the end of packaged classes. This means that
a product can be constructed from many basic shapes, where
each shape is initialized as many times and with the
corresponding values of the attributes as needed. Also, several
analyzers can be instantiated each focusing on different aspects
(e.g. bodies) and their performance. This can also give a
possibility for parallel execution of analyzers, which can be (d)
important for complex products.
Using general-purpose programming language gives a
freedom to define most suitable hierarchy and relationship of (c)
problem domain classes. One of the purposes of such languages Fig. 2. A simple product representation at different phases (a) 3D modeling
is to let product designers to focus on the problem domain and outlook; (b) meshing / meshed pole; (c) constrains and load application
language, catch and reflect its interdependences in a code. In points highlighted; (d) displacement analysis of the pole under the load.
principle, other levels of hierarchy can be built on top of the
classes shown in Fig. 1. A more complex shape can be A pole with a cup on top made of 5086 aluminum alloy* can
expressed as a collection of given basic shapes. It is important be depicted as shown in Fig. 2 (a). If a product designer is to
that once the product designer gets detached from the CAD make such a structure, s/he could i) create a rectangle / square;
specific API, s/he can focus on product design. ii) extrude it for the length of the pole to form the pole; iii) put
a sphere on top of the pole; iv) subtract a cylinder from the
sphere to form the opening of the cup. If done with the CAD
corresponding geometric shapes have to be manipulated with

*
https://www.aluminum.org/resources/industry- standards/aluminum-alloys-101
1018 Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020
Author name / Procedia Manufacturing 00 (2019) 000–000 5

the right parameters assigned. Requirements for the parameters s1 = Sphere(10, 10, 50, 25, "BLUE", "Aluminum_5086")
and the structure outlook should in general be known in s1.initForNX() # Initialize the sphere in NX
advance. A change of design later is difficult unless it was done
as parametric design with some Excel file storing key #Substract c1 from s1
#s1.subtract(c1) # one of the ways - just an illustration
parameters that can be used to update the outlook of a product.
c1.subtractFrom(s1)
However, even with the basic parametric design certain
extensions as with introduction of new parameters or functions if analyze:
is challenging. At that point, the extended API can be used to # Lets start the Analyzer
give more freedom for design reconfiguration. a = Analyzer("example", "C:\\<The path is here>\\")
a.getSolidBodies()
The force is applied on the top of the pole downwards along a.createFEM("8.79", "0.879", "Aluminum_5086")
the pole. The base of the pole is fixed. It is requested to estimate a.defineSim()
displacement in the pole. a.assignConstrain(1, 3)
# Reverse the assigned force by Z axis, i.e. [0,0,-1]
B. Results a.assignLoad(50000, 1, 4, [0,0,-1])
Listing 1 below shows Python code for the design file that a.solveSim()
puts together instances of the classes shown in Fig. 1. As in The Analyzer object, once created, is used to call methods
many (object-oriented) programming languages, first comes in the specified order to get first bodies that can be analyzed
imports of necessary classes, which are in this case the classes (the pole and the sphere). The FEM model is generated, so that
from shapes and util packages. The Boolean flag analyze is set end user can see the pole split into elements as shown in Fig. 2
true to tell that analysis should be performed. Then, until the (b). The constrain is shown to be assigned to the first body (the
use of the flag in the if statement, comes creation of the basic pole) and its bottom (face 3). One may see dedicated marks in
shapes – block, cylinder and sphere. Comments in the listing Fig 2 (c) on the perimeter of the pole as the constrain get
can give additional details on the parameters passed for highlighted in a graphical interface. The load is seen applied to
creating instance of the class. After the instances created the the top of the pole (arrows pointing downwards in Fig. 2(c)) as
cylinder is subtracted from the sphere to form the opening of specified in the code ([0,0,-1] – reversed for base Z axis) for
the cup. the first body (the pole) and the phase 4 (the top of the pole).
Finally, as the simulation runs for the created model, results are
Listing 1 Design file to create the product and analyze it
generated and can be visualized as shown in Fig. 2 (d).
(in Python)
""" Listing 2 Excerpt from the Sphere class (in Python)
design1.py - Creates a product out of (basic) shapes and makes #/shapes/Sphere.py
analaysis of the product. import math
""" import NXOpen
from shapes.Block import Block import NXOpen.Annotations
from shapes.Cylinder import Cylinder import NXOpen.Features
import NXOpen.GeometricUtilities
from shapes.Sphere import Sphere
import NXOpen.Preferences
from util.Analyzer import Analyzer class Sphere:

# Make product analysis after construction def getVolume(self):


analyze = True return 4/3 * 3.14 * (self.diameter/2)**3

""" def __init__(self, x, y, z, diameter, color, material):


Do a block at the origin with corresponding length (20), width self.diameter = diameter
self.x = x
(20), self.y = y
height (50), color (RED) and material (Aluminum_5086) self.z = z
""" self.color = color
b1 = Block(0.0, 0.0, 0.0, 20, 20, 50, "RED", "Aluminum_5086") self.material = material
b1.initForNX() # Initialize the block in NX self.body = None

"""
Do a cylinder having its origin at (10, 10, 50) with corresponding def initForNX(self):
theSession = NXOpen.Session.GetSession()
diameter (20), workPart = theSession.Parts.Work
height (30), direction ([0, 0, 1]), color (RED) and material
(Aluminum_5086) spherebuilder1=
""" workPart.Features.CreateSphereBuilder(NXOpen.Features.Sphere.Null)
c1 =Cylinder(10,10,50,20,30,[0,0,1],"RED", "Aluminum_5086") …
c1.initForNX() # Initialize the cylinder in NX
def subtract(self, tool):
""" theSession = NXOpen.Session.GetSession()
workPart = theSession.Parts.Work
Do a sphere having its origin at (10, 10, 50) with corresponding
diameter (50), # Subtraction
color (BLUE) and material (Aluminum_5086) subtractfeaturebuilder1=
""" workPart.Features.CreateBooleanBuilder(NXOpen.Features.BooleanFeatu
Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020 1019
6 Author name / Procedia Manufacturing 00 (2019) 000–000

re.Null) conventional way (an engineer directly manipulating 3D


objects or with minimal automation) or ii) to be dealing in
subtractfeaturebuilder1.Target = self.body # From where to
subtract hundreds and thousands of lines of code. The very basic shapes
subtractfeaturebuilder1.Tool = tool.body # What to subtract and operations used for demonstration here are also basic
subtractfeaturebuilder1.Operation= primitives available to CAD engineers doing "direct"
NXOpen.Features.FeatureBooleanType.Subtract manipulation of 3D objects on canvas of the CAD tool. More
subtractfeaturebuilder1.Commit() complex shapes (e.g. curves, polylines) can be expressed with
subtractfeaturebuilder1.Destroy() a corresponding software class that can be initiated with one
Listing 1 has shown sequential creation and use of object for line similarly to Cylinder or Sphere shown in Listing 1. For
given example. To get some impression on the code inside of instance, XMLReader class, which is not discussed in this
the classes, Listing 2 shows an excerpt from the Sphere class. paper, was implemented to read shapes information from an
There are 4 methods highlighted in the code, the part of XML file. The use of the class means two lines, in which one
initForNX() is omitted and replaced by “…” for brevity. It is first initializes the object and then passed the link to the XML
important to see that in comparison to the Listing 1, which it is file to the object. It allows relying on generic data
possible to say, operates in pure problem domain, e.g. representation formats such as XML that can support
expressed via classes Block, Cylinder, Sphere and Analyzer, adaptation and integration of the KBE systems, as one does not
the Sphere imports NX Open API classes to generate results for have to learn Python programming language, but rather could
Siemens NX engineering tools. The basic classes connecting to configure solutions via that general-purpose markup language.
the NX Open API should be created once. As these are done,
engineers can deal with the designs and analysis in more 5. Conclusions
friendly manner as shown in Listing 1. They do not have to
bother about tool specific concepts such as, for example, The product design automation can be simplified by
Session, workPart or BooleanFeature that could be of the type providing an extended API to focus on problem domain
Subtract. concepts rather than that of engineering tools. An approach was
demonstrated providing basic shape classes that can be used for
The Analyzer class is in total about 415 lines long. As the
product 3D representation along with the Analyzer class
same highlighted with Listing 2, some of these rows can take
embedding main steps to check product performance under
many ‘columns’. Listing 3 shows an excerpt for setting the
different loads and constrains. These classes can be applied
force direction. As can be probably seen again, direct using of
instead of direct use of NX Open API. Additional classes can
NX Open API could be challenging due to many nesting levels
be considered to integrate the solution to other tools and
and the need to find the ‘right’ level. For better readability the
frameworks.
lines are marked with the dedicated labels L1..L3.
As future work, the API can be further extended and
Listing 3 Three lines from the Analyzer class to set force
integrated into the closed loop with the intended users of
application direction (in Python)
designed products to collect and routinely integrate
L1: origin1 = NXOpen.Point3d(0.0, 0.0, 0.0)
L2:vector1=NXOpen.Vector3d(float(direction[0]), requirements into design phase giving a possibility to provide
float(direction[1]), float(direction[2])) engineers and customers with instant feedback.
L3:direction1=workSimPart.Directions.CreateDirection(origin1,
vector1, NXOpen.SmartObject.UpdateOption.AfterModeling) References
Simple comparison of Listings 1, 2 and 3 may suggest that
the first one could be seen as more intuitive and user friendlier [1] N. P.Suh, D. S.Cochran, P. C.Lima, “Manufacturing System Design”,
to work with. The direct use of NX classes and corresponding CIRP Annals, Elseiver, Volume 47, Issue 2, 1998, Pages 627-639
[2] H. Morihisa, R. Oshita, H. Furukawa and J. Kanda, "A system
libraries (the import example for those comes at the beginning planning method based on templates for large scale manufacturing
of Listing 2) could be a tedious task in our experience. One information systems," 1997 IEEE 6th International Conference on
block or cylinder creation directly in NX Open API classes Emerging Technologies and Factory Automation Proceedings, EFTA
takes about 10 lines of code some of which are shown in the '97, Los Angeles, CA, USA, 1997, pp. 149-153. doi:
10.1109/ETFA.1997.616260
Listing 2 for initForNX() method. It is a big saving to replace [3] J. Leng et al., "ManuChain: Combining Permissioned Blockchain
these lines with one method having more cleaner code With a Holistic Optimization Model as Bi-Level Intelligence for
especially if and as a complex product should be constructed Smart Manufacturing," in IEEE Transactions on Systems, Man, and
composed of many shapes. The savings are more noticeable in Cybernetics: Systems, vol. 50, no. 1, pp. 182-192, Jan. 2020, doi:
10.1109/TSMC.2019.2930418.
case of the Analyzer class. More than 400 lines of code at the [4] J. W. Du, J. J. Wang and X. M. Fan, "A Simulation-based Dynamic
lower level are replaced with just 7 lines that are shown at the Spatial Scheduling Method of Block Assembly in Shipbuilding," 2019
end of Listing 1. IEEE International Conference on Industrial Engineering and
Engineering Management (IEEM), Macao, Macao, 2019, pp. 1491-
As new features may be required these can be implemented 1495. doi: 10.1109/IEEM44572.2019.8978760
by extending existing classes or creating the new ones in the [5] Y. Choi, J. Park and B. Jang, "A Risk Estimation Approach based on
right packages. New composite classes aggregating the classes Deep Learning in Shipbuilding Industry," 2019 International
Conference on Information and Communication Technology
shown in Fig. 1 can be created to represent more complex Convergence (ICTC), Jeju Island, Korea (South), 2019, pp. 1438-
concepts, i.e. that of entire product. 1441. doi: 10.1109/ICTC46691.2019.8939725
[6] La Rocca, G., & van Tooren, M. J. L. (2010). Knowledge-based
The alternative to suggested approach is i) to do CAD in a engineering to support aircraft multidisciplinary design and
1020 Andrei Lobov et al. / Procedia Manufacturing 51 (2020) 1014–1020
Author name / Procedia Manufacturing 00 (2019) 000–000 7

optimization. Proceedings of the Institution of Mechanical Engineers, on System Integration (SII), Taipei, 2017, pp. 236-240. doi:
Part G: Journal of Aerospace Engineering, 224(9), 1041–1055. 10.1109/SII.2017.8279218
https://doi.org/10.1243/09544100JAERO592 [13] A. Benaouali and S. Kachel, "Structural wing sizing and planform
[7] V. A. Tikhomirov, "The Method of Automatic Determination of the shape optimization using multidisciplinary CAD-CAE integration
Types of Spatial Angles in 3D Models of CAD Systems," 2019 process," 2017 8th International Conference on Mechanical and
International Science and Technology Conference "EastConf", Aerospace Engineering (ICMAE), Prague, 2017, pp. 478-483. doi:
Vladivostok, Russia, 2019, pp. 1-4. doi: 10.1109/ICMAE.2017.8038692
10.1109/EastConf.2019.8725312 [14] J. Andres, L. Gracia, H. Marti and J. Tornero, "Toolpath
[8] W. Chao and H. Wang, "Scheme design of Mechanical Design Virtual postprocessing for three axes milling in redundant robotic workcells
Laboratory based on component," 2012 2nd International Conference by means of fuzzy integration in a cam platform," 2009 IEEE
on Consumer Electronics, Communications and Networks (CECNet), International Conference on Mechatronics, Malaga, 2009, pp. 1-6.
Yichang, 2012, pp. 2061-2064. doi: 10.1109/CECNet.2012.6201667 doi: 10.1109/ICMECH.2009.4957209
[9] W. Kuang, "Development of parametric Part Family system based on [15] Lobov, A.., Martikkala, A., Biswas, P. “Towards a Web-based
UG and Excel parameter form," 2009 IEEE 10th International Framework for Computer-aided Manufacturing”, The International
Conference on Computer-Aided Industrial Design & Conceptual Forum on Instrumentation Engineering, Electronics and
Design, Wenzhou, 2009, pp. 758-761. doi: Telecommunications, Izhevsk, Russia, 2019, pp. 59-65.
10.1109/CAIDCD.2009.5375103 [16] Sobieszczanski-Sobieski, Morris and van Tooren, “Multidisciplinary
[10] B. Wang, D. Liu, N. Zhou and L. Zhou, "Research on Knowledge- Design Optimization Supported by Knowledge Based Engineering”,
Reuse-Based Windshield Inspection Gauge Design System," 2009 Wiley, ISBN 9781118492123, 2015
International Conference on Measuring Technology and [17] J. W. Satzinger, R. B. Jackson and S. D. Burd, Object-Oriented
Mechatronics Automation, Zhangjiajie, Hunan, 2009, pp. 117-120. Analysis and Design with Unified Process, Thomson, 2005, ISBN 0-
doi: 10.1109/ICMTMA.2009.286 619-21643-3
[11] M. V. Lavrentyeva and P. Y. Chimitov, "Implementation of [18] W. J. C. Verhagen, P. Bermell-Garcia, R. E.C.van Dijkc and R.
recognition algorithm with NXOpen API in siemens NX," 2017 Curran, “A critical review of Knowledge-Based Engineering: An
International Conference on Industrial Engineering, Applications and identification of research challenges”, Advanced Engineering
Manufacturing (ICIEAM), St. Petersburg, 2017, pp. 1-4. doi: Informatics Volume 26, Issue 1, Elsevier, Jan. 2012, Pages 5-15.
10.1109/ICIEAM.2017.8076193
[12] C. Chung and T. Ma, "Implementation of CAM programming with
machinability database," 2017 IEEE/SICE International Symposium

You might also like