You are on page 1of 233

Machining Knowledge Editor Training

Machining Knowledge Editor Training 8.5

Proprietary and restricted rights notice This software and related documentation are proprietary to Siemens Product Lifecycle Management Software Inc. 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. All trademarks belong to their respective holders.

ii

Machining Knowledge Editor Training 8.5

CHAPTER 1

Whats new
New in NX 8.0.1

1
2
2

External functions 2 Operation Parameters in Add-ons Feature Recognition 2

New in NX 8.0.2 New in NX 8.5 4

3
3

Function IT_Class_Iso (nominal, _upper, _lower) MKE User Interface Enhancements 4 Installed default Machining Rule Library 7 Migration of existing pre-NX 85 Machining Rule Library 8 Feature Recognition improvements 8

CHAPTER 2

Machining Knowledge Editor Concepts 13


Best machining practice definition. 14 Machining Rule concept 16 RuleLibrary 17 18 21 20 Starting the Machining Knowledge Editor Loading the Rule Library Tree View 23

The Machining Knowledge Editor User Interface


Selecting nodes 23 Activating nodes 24 Renaming nodes 25 Ordering nodes 25 Copying nodes 25 Undo 26 Deleting nodes 26

Table View

27

Selecting nodes in Table View 27 Commands in Table View 27 Table View Toolbar 27 Sorting cells 29 Editing cells 29

Machining Knowledge Editor Training

Rule View

31

Conditions Tab 32 Constants Tab 33 Materials Tab 33 Machines Tab 33 Explanations Tab 33 Image Tab 33 Add-on Tab 34

Conditions concept

36

Application Criteria 36 Tool Attributes 39 Less Worked Feature Attributes 40 Operation Attributes 41

Expression syntax | Functions


Functions 44

43

Constants concept

46

Scope of a Constant 47 Constant Command Icons 47 Using Constants in Expressions 47

Finding Rules based on criteria

48

Find in all Rule Conditions 48 Using TableView autofilter 48 Using TableView Filter Column 49

Testing the Rules 50


Check Validity 50 Testing in NX with Create Feature Process 50 Reading the Information window and the MSAnalysis.lis 50

Rules for multiple More Worked Features

52

CHAPTER 3

How Operation Selection works


Machining Knowledge Editor and NX 54 Examples of operation sequences 56
STEP1HOLE and STEP1HOLE_THREAD in 4 operations. 56

53

Finding a solution using elementary rules


Information Window 62

58

II

Machining Knowledge Editor Training

CHAPTER 4

MKE Exercises: Hole Making


Creating a new RuleLibrary file 66
Copying an existing RuleLibrary file 66 Creating a new RuleLibrary file. 67

65

Creating a first Rule 69


What this example intends to explain 69 Explanatory picture 70 Conditions 72 Constants 76 Materials and Machines 76 Testing the MachiningRule 77 Detailing the MachiningRule with Add-ons 79

Creating a second MachiningRule 84


What this example intends to explain 84 85

Creating a third MachiningRule

85

What this example intends to explain Explanatory picture 85 Conditions 85 Constants 86 Materials and Machines 86 Explanation 86 What this example intends to explain Explanatory picture 89 Conditions 89 Constants 90 Materials and Machines 90 Explanation 90

Defining a competing MachiningRule 88


88

Working with in-process geometry


What this example intends to explain Explanatory picture 92 Conditions 92 Constants 93 Materials and Machines 93 Explanation 93

92
92

Hole Milling

94
94

What this example intends to explain Explanatory picture 95 Conditions 95

Machining Knowledge Editor Training

III

Thread Milling Using functions

96 96

What this example intends to explain 96 Explanatory picture 97 Conditions 97 Constants 98 Materials and Machines 98 Explanation 98 Explanatory picture 99 Conditions 99 Constants 100 Materials and Machines 100 Explanation 100

Using TableView to query the MachiningRuleLibrary 100


What this example intends to explain 100

Using Find and Replace functions Additional stuff 102

101

What this example intends to explain 102

CHAPTER 5

Machining Features from opposite directions 105


When both sides of a hole need chamfering
What this example intends to explain 105 Creating a rule for the bottom chamfer 106 Defining the conditions 106 Testing the rule 107

105

Drilling a deep hole from opposite directions 109


Adding a face attribute prior to Find Features... Testing the value of a Feature Attribute 110 Adding MACHINE_TWO_SIDED to the customization 111 Creating a rule to split a feature 113 109

Using Knowledge Fusion for post create features 114


Automating 2-sided machining using KF functions 114

Checking for tool availability

118

IV

Machining Knowledge Editor Training

Summarizing three different ways to machine from opposite directions 119

CHAPTER 6

External Functions using TCL

121

External Function declaration in the Machining Knowledge Editor 121 External Function TCL body definition 124
MOM__boot {} and MOM__halt {} 124 TCL code 126

Testing external function calls 127


Using TCL functions in the MachiningRule condition 127

More TCL System Functions 128


GetPartAttribValue 128 GetExprValue 128 GetProgRootAttribValue 128

Calling an external application 129


Example interface to Microsoft Excel from TCL 129

Limitations 130

CHAPTER 7

MKEditor Exercises: Turning


Feature Based Turning 134
Feature Recognition 134 Operation Selection 136 Machining Knowledge Editor

133

137

CHAPTER 8

Wire EDM

141
142

Recognition of WEDM Features


PDW feature creation 143 PDW feature identification 144

Defining rules for WEDM features in the MKE 144


Rule Add-on 144 WEDM resource (tool) 145 WEDM operation types 145

Machining Knowledge Editor Training

CHAPTER 9

Feature Mapping

147
148 150

Using Feature Mapping -case 1 148 Using Feature Mapping -case 2 Example 148

Mapping to Hole or Pocket feature types?


Creating a mapping rule 152 Conditions 152

Identification or Recognition 153


Feature Identification 153 Feature Recognition 154

CHAPTER 10

Feature Teaching

155

What is Feature Teaching ? 156 When to teach a Feature Type 156 How to teach a Feature Type 157
PMI Support in Feature Teaching 157 Use case 1: Create a new feature type and a new recognition rule 158 Use case 2: Create a new recognition rule for an existing feature type 158 Use case 3: Modify an existing recognition rule for existing feature type 159 Defining the features position and orientation 159

Starting Machining Knowledge Editor in admin mode 159

CHAPTER 11

Operation Rule Teaching


What is Operation Rule Teaching ? When to teach an Operation Rule ? How to teach an Operation Rule.

161
162 162 162

CHAPTER 12

Color and Attribute Features


Face color and attribute recognition 164

163

VI

Machining Knowledge Editor Training

Defining a Recognition Rule for the new Feature Type 167 Face attribute value 171 Machining Direction of C&A Features 171

Machining Rules for a Color & Attribute feature 172


Cut Levels 173

CHAPTER 13

Customization View
Customization view 176

175

Default Customization 177 CAM Configuration dependent customization 178 Tools, Machines,Part Materials, UDEs 178 Operation Types 179 Features 179 Additional Customization 179 NX Version upgrades 180 Set as Cutter Diameter, Set as Cutter Length 180

CHAPTER 14

TCIN for FBM


Configuration 184

183

Teamcenter Integration for NX Compatibility 184 Mixed mode configurations 185 Commands Load Local... and Save Local... in managed mode 186

Configuring the Teamcenter data

187

The FBM OOTB content kit: 187 Machining Knowledge structure in Teamcenter 188

Managing templates from multiple NX versions in one TC database 190


MKE customization 190 Teamcenter Preferences 190 CAM template import 193

Machining Knowledge Editor Training

VII

CHAPTER 15

Machining Knowledge Customization Project 195


OOTB content 196
196

An explanation of the OOTB Rules 196


What do all these achievable... constants mean? Discussion of some other constants... 199

Modify the OOTB or Start from Scratch? Workflow in a customization project 200 Analyze your products for manufacturing features 201

200

What comes OOTB 201 How to add features that are not standard. 202

Analyze your operation sequences 205 Analyze your tool libraries 205

202

What comes OOTB. 205 How to add tools that are not standard.

205

Implement Knowledge 206 Maintain Knowledge 207 Using Knowledge Fusion (KF) in Feature Based Machining 207

CHAPTER 16

Appendices

209
210

A: Glossary of Terms

B: Naming conventions for Manufacturing Features 210 C: Definition of the standard STEPPED features 211 D: Definition of the standard non-STEPPED features 214 E: Tips and Tricks 222
Choosing priority for the MACHINING_RULE 222 How to use the MACHINING_RULE conditions 222

VIII

Machining Knowledge Editor Training

CHAPTER 1

Whats new

This chapter contains references and explanations of new Feature Based Manufacturing functionality.

New in NX 8.0.1

New in NX 8.0.1
External functions
See Functions on page 44.

Operation Parameters in Add-ons


For details, please see Operation Attributes on page 41.

Feature Recognition
Feature recognition has been improved such that for all recognized features found in a single run (the new features found after you press the Find Features button) the feature directions are aligned as much as possible. This means that if a feature has multiple directions the main direction of a feature is aligned with other features which may not have an alternative direction. So if you have 2 STEP1HOLE features (which can be machined from 2 sides) and a single STEP1POCKET feature the main direction of the hole features will by aligned with the direction of the pocket feature. Prior to NX8 this was not always the case. This behavior is also implemented in NX755.

Whats new

New in NX 8.0.2

New in NX 8.0.2
Function IT_Class_Iso (nominal, _upper, _lower)
This function has been changed slightly in NX 8.0.2: when the 2nd and 3rd parameters are equal, the function returns value undefined. For instance: IT _Class_ISO (10,0,0) will now return undefined instead of an integer value. Consequently the rule will not be rejected. This change enables us to select a tool with a specific diameter with no tolerance. The tool diameter selection query generally has this form: tool.Diameter >= mwf.Diameter + mwf.Diameter_lower tool.Diameter <= mwf.Diameter + mwf.Diameter_upper and generally we will have an application condition to ensure the tolerance can be achieved with this rule, for instance: IT_Class_ISO(mwf.Diameter, mwf.Diameter_upper, mwf.Diameter_lower) >= 9 Now when both the _upper and _lower are defined to be 0, the IT_Class_ISO function will not reject the rule (as it did before), and the desired tool is selected. This behaviour is needed, for instance, for the pre-drill operation for tapping, when the thread feature has attribute THREAD_TAPPED_DRILL_SIZE defined. In the tapping rule we can specify the Less Worked Feature diameter as follows: lwf.Diameter = mwf.THREAD_TAPPED_DRILL_SIZE lwf.Diameter_lower = 0.0 lwf.Diameter_upper = 0.0

Whats new

New in NX 8.5

New in NX 8.5
Ofcourse your first reference is the NX 8.5 Help. Paragraphs below are supplementary about the MKE.

MKE User Interface Enhancements

Improved Menu and Toolbar

New entry Open and Update...

. This will read a source file and will update its customization against a selected cam configuration. It replaces the previous marker in the View > Options dialog where Update upon Load is taken out.

New command Toggle Label,

only active when the Customization Tree is active. (See New tab controls on page 5.) It toggles between database name and display name of classes and attributes. This is especially necessary when working with the new Manufacturing Resource Library (MRL) which has coded database names without any meaning for the user, and where we rather work with the display names. An example screenshot where you can see the Display Names (left) and the corresponding Database Name (right) is below:

Whats new

New in NX 8.5

New tab controls

New tab control for Customization Tree view which replaces the previous command View > Customization.

Whats new

New in NX 8.5

New tab control for Functions


Tree view.

Note that we added new system functions for String querying.

Note also important when doing


FBM using the new VolumeBased25D operation is function WorkpieceHas3dBlank which returns TRUE or FALSE. It is used in all rules using FLOOR_WALL machining in the NX85 machining_knowledge.xml.

Starting Machining Knowledge Editor in admin mode


You can modify the shortcut starting the MKE as depicted below.

This will unlock the possibility to show and edit the generated Feature Recognition Rules source code for the features that were taught. (Not for the standard features.)

Whats new

New in NX 8.5

Large tool database support


Instead of the long flat lists
we can now select a rules tool class and operation class from a tree structure.

You can select any level in


the tree, which opens the possibility to create a single Machining Rule using multiple tool classes.

Commands Set as Cutter


Diameter and Set as Cutter Length can be issued on any level in the tree. The value will be inherited by the lower levels.

Full pathname in the title


When MkEditor.exe is started with option -admin the full path to the loaded source file is in the dialog title.

Installed default Machining Rule Library


The installed machining_knowledge.xml which has the definition of the out-of-thebox machining rules is reworked and uses the new VolumeBased 2.5 D operations in cases where previously Face_Mill_Area or Planar_Mill was used. The new operation templates that are used are in the machining_knowledge.prt template and the name is FLOOR_WALL.

Whats new

New in NX 8.5

Migration of existing pre-NX 85 Machining Rule Library


Rules using machining_knowledge.FACE_MILL_AREA are migrated to machining_knowledge.FLOOR_WALL if this exists in the operation template set.

Feature Recognition improvements

Alternative Directions
A feature can have an alternative direction from which it optionally could be machined. There are several new rules which determine if a feature has an alternative direction:
1.

Customization: it the feature is a customization feature (known in the customization) then the user can specify in the customization if the feature has an alternative direction or not. If the parametric recognizer finds multiple alternatives then the feature has an alternative direction (unless the customization says otherwise) If the feature is a through feature but blocked from both sides then the user should decide how to machine the feature and thus the feature has an alternative direction. The main direction is the direction with the largest distance between the feature and the blocking geometry.

2. 3.

4.

If the feature is a through feature but blocked from just a single side then the feature has no alternative direction . The feature should be machined from the

Whats new

New in NX 8.5

free direction.

5. 6. 7.

If the feature is a tapered thread feature then the feature has no alternative direction. If the feature is a full thread then the feature has an alternative direction. If the feature is not a full thread feature but the thread depth is greater than or equals to the feature depth then we consider the thread a full thread and thus the feature has an alternative direction.

Machining Access Direction


Although with the alignment of the feature directions the feature recognition results are improving already (and reducing the need to recognize features in multiple runs) there are still situations where you need to recognize features from a certain direction. Therefor in NX85 the Machining Access Directions functionality is extended.

In NX85 this functionality is extended to allow more advanced feature filtering based on machining access direction. In addition to a single vector the following types are now also supported:

Whats new

New in NX 8.5

Specify Vector. Allows feature filtering based on multiple access direction vectors. All features that match one of these vectors are returned.

Towards Point / Away from Point. Allows feature filtering based on a point.
Only features with a direction towards or away from the specified point will be returned.

Towards Axis / Away from Axis. Allows feature filtering based on an axis. Only
if the feature direction is perpendicular to this axes the feature are returned.

10

Whats new

New in NX 8.5

Selection Intent
NX85 has full support for selection intent. This allows the user to select the appropriate geometry using the standard NX selection intent controls. Main reason for this (small) change is that by doing so the geometry selection is more in line with the rest of NX (since NX75 the user was already able to select multiple faces/edges/ curves/points with the Select Geometry UI component)

Feature Recognition progress bar support


Feature Recognition uses the standard NX progress bar which gives an indication of how far the recognition/identifation has progressed.

Whats new

11

New in NX 8.5

12

Whats new

CHAPTER 2

Machining Knowledge Editor Concepts

The first chapter explains the concepts behind the Machining Knowledge Editor.

Machining Knowledge Editor Training V8.5- Concepts

13

Best machining practice definition.

Best machining practice definition.


There are many ways to machine, for instance, a counter bore hole. You can choose a different process depending on the features diameters, its depths, the ratio depth/diameter, the quality of the cylindrical surface, the tolerance of the diameters, and more. Three different approaches for a counter bore hole with their pros and cons are summarized in this picture.

The choice for a machining process will generally also be influenced by:

different workpiece material different machine tool

14

Machining Knowledge Editor Training- Concepts

Best machining practice definition.

blind hole instead of a through hole


And consider what you would do if

you did not have the preferred tooling or... you had to machine 10.000 of these holes per month.
This is only one feature type. What applies to counter bore holes, also applies to most other features: generally there will be alternative ways to have them manufactured. It is the process planners task to select machining operations that are both economical and produce a part that meets the tolerances. A companys best machining practice defines their methodology of machining certain manufacturing features. It defines, for a set of machining features, which operations should be used, which tools should be used, and in which order these should be applied. The best practice is defined by sets of Machining Rules. In addition to the day-to-day advantage of generating fast, reliable and reproducible solutions, having a best practice also serves as a vehicle for standardization. The Machining Knowledge Editor, in short MKE, is the authoring tool in which you can define your companys best machining practise.

Machining Knowledge Editor Training V8.5- Concepts

15

Machining Rule concept

Machining Rule concept


A Machining Rule defines how a manufacturing feature (More Worked Feature) can be machined starting from another feature (Less Worked Feature) using a tool of a certain class.

In general, a Machining Rule corresponds with a single manufacturing operation (e.g. drilling a hole or milling a pocket) and will describe:

when this operation is allowed what result can be achieved (which shape is created, which tolerances can be
achieved)

which tool is necessary (which type is required, what dimensions are required) which start shape needs to be there.
For brevity, in this chapter, when we talk about a Rule we actually mean a Machining Rule. The command Create Feature Process... in NX will start reasoning backward, using Rules, from the final feature (More Worked Feature) to the blank feature (Less Worked Feature). This is the most import thing to keep in mind when implementing your companys machining knowledge in the MKE.

16

Machining Knowledge Editor Training- Concepts

RuleLibrary

RuleLibrary
Rules are always grouped in a RuleLibrary. Three different RuleLibraries, with different purposes, are used in NX:
1.

The Machining Knowledge library, which is used by the Create Feature Process... command. This RuleLibrary defines the best practice to manufacture features. The Feature Mapping library, which is used by the Find Features... command. This RuleLibrary defines how a feature of one type can be changed (mapped, transformed) into a feature of another or the same type. This functionality can be used to transform external or modeling features (User Defined Features) into manufacturing features and vice versa. Frequently this functionality is used to interprete the color of a feature. For instance when a yellow color means that a feature is threaded. See Feature Mapping on page 147. Feature Recognition library, which is used by the Find Features... command to find the features in the part models. Starting with NX 8 admin users will be able to interactively define their recognition rules. For now, these are outside the scope of this tutorial.

2.

3.

In the Machining Knowledge Editor you will see 3 different Tabs for the 3 different families of Rules you can define. The names of the Tabs are fixed.

Machining Knowledge Editor Training V8.5- Concepts

17

Starting the Machining Knowledge Editor

In addition to the 3 RuleLibraries, there is a


4.

Functions tab with the available FunctionLibraries. It has a pre-configured FunctionLibrary called System Functions. The default installation also has a pre-configured FunctionLibrary Sample Functions. All functions in these libraries are based on TCL command language. See External Functions using TCL on page 121. Customization tab is new here since NX 8.5. It displays all the customization objects as defined in the currently loaded machining_knowledge source file.(Previously this was accessed using View -> Customization.)

5.

Editing machining and mapping rules does not require any knowledge or skills in a particular programming language like C or C++. The Machining Rules are used by the inference engine which is dedicated to searching a solution to machine manufacturing features. Machining Rules are the elementary process steps and the application of a Machining Rule will generally result in a single NX operation object. The inference engine will be discussed in How Operation Selection works on page 53.

Starting the Machining Knowledge Editor


Every user can view and edit the Rules. Protection can be arranged by setting special file permissions on the relevant files/directories or are handled by Teamcenter when you are working in managed mode. The Machining Knowledge Editor is opened from the start menu Programs > UGS NX Version > Manufacturing Tools > Machining Knowledge Editor.

Activity: Open the Machining Knowledge Editor


Start the application From the menu bar, choose View > Options Inspect tab Exchange Adapter Inspect tab TCIN. When you work in managed mode, you must check active Use Teamcenter Integration. In managed mode, the 2-tier or 4-tier connection parameters must be set. Further details can be found in TCIN for FBM on

18

Machining Knowledge Editor Training- Concepts

Starting the Machining Knowledge Editor

page 183. When not in managed mode, you will be reading and writing to the file system which is the default mode of operation.

Cancel the Settings dialogue.

Machining Knowledge Editor Training V8.5- Concepts

19

Loading the Rule Library

Loading the Rule Library


The first step is to load a RuleLibrary. Either use File > Open in the main menu, or click on the Open icon in the toolbar. This will open a dialog in which an .xml file can be selected and opened.

Note This screenshot is taken when working in native mode.


By default, the dialog will open in the directory defined by the environment variable UGII_CAM_MACHINING_KNOWLEDGE_DIR. You can open multiple .xml files in the Machining Knowledge Editor. This makes it easy to copy data between libraries.

Activity: Load a Machining Knowledge Library Open the machining_knowledge.xml which is the out of the box (ootb) library
with machining rules.

20

Machining Knowledge Editor Training- Concepts

The Machining Knowledge Editor User Interface

The Machining Knowledge Editor User Interface


The Machining Knowledge Editor User Interface consists of three sections:

1. The Tree View showing the RuleLibrary tree. The Tree View is mainly used
for finding and activating nodes, and for starting specific commands. The Tabs controls allow to switch between modes for Machining Rules and Feature Recognition Rules and Feature Mapping Rules.

2. The Table View showing only the activated nodes. Nodes are activated by
clicking the small rectangular in the Tree View. The Table View is mainly used for finding and filtering on Rules.

3. The Rule View showing the component data of a selected Rule.

This view is used to define a MachiningRule.

Machining Knowledge Editor Training V8.5- Concepts

21

The Machining Knowledge Editor User Interface

The display of the Tree View and Table View can be toggled from the pull-down menu View. From the sub menu select the name of the view. This will toggle the display of the view. When checked active, it is displayed.

Activity: Change the visibility of the views Toggle the visibility of the views with the View entry in the main menu. Display all views again.
Generally you will need both the Tree View and the Table View when working with the Machining Knowledge Editor, so keep these settings checked.

22

Machining Knowledge Editor Training- Concepts

Tree View

Tree View
The Tree View lists the Rules in a tree format. The Tree View is mainly used for finding and activating nodes, and for starting specific commands.

Activity: Navigating the tree move through the tree use the arrow-up, arrow- down, Home, End, Page Up,
and Page Down keys.

Sections of the tree can be expanded or collapsed by clicking with the left mouse
button on the +/- sign shown in front of the node name.

Sections of the tree can be expanded or collapsed by using the left and the right
arrow keys on the keyboard.

Selecting nodes
Most commands are executed on one or more nodes in the Tree View or Table View. If a command is started from the Tree View, only the selected nodes will be used as input for the commands.

Machining Knowledge Editor Training V8.5- Concepts

23

Tree View

In the Tree View all nodes of the project can be selected. In the Table View only the activated nodes can be selected (as these are the only nodes which are displayed in the Table View). Selected nodes will be highlighted in the views where the nodes are visible. Nodes, which are (de)selected in one view (e.g. Tree View), are also (de)selected in the other view (Table View).

Activity: Selecting Nodes in the Tree View click MB1 on a node (active or not active) for single select. Control + click MB1 to modify the selection. The node will be added or removed
from the current selection.

Shift+MB1 allows multiple selection. All nodes starting from the previously
selected node will be added to the current selection.

Shift+Up or Shift+Down allows multiple selection. A new selection will be


started from the first node where the shift was pressed.

Activating nodes
Only activated nodes are visible in the Table View. The status (activated/deactivated) is shown with the check box in front of the node.

Activity: Activating Nodes in the Tree View Click with the left mouse button on the check box in the Tree View to toggle the
status of the node. If the node is part of a selection, all other nodes will be set to the same activation status regardless of their current status.

Press the space bar to inverse the status of the node. If the node is part of a
selection, the status of all other nodes will also be inversed from their current status.

All children of a node can be activated from the Tree View popup menu by executing the Activate Children command.

24

Machining Knowledge Editor Training- Concepts

Tree View

All nodes can be deactivated from the Tree View popup menu by executing the
Deactivate All command.

Renaming nodes
In the Tree View a node can be renamed by first selecting it, followed by another mouse click on the name of the node or by pressing F2. This will start the editing mode indicated by the box around the name. The changes can be cancelled by pressing the Esc button. The editing mode will be closed when clicking outside the editing box.

Activity: Rename a node Rename the MillDrill node into DrillMill. Ordering nodes
In the Tree View nodes can be moved by making a selection, dragging this selection with MB1 pressed within the Tree View on one of the other nodes, and releasing MB1. This will move all selected nodes to a position below the node that the selection was dragged on.

Activity: Moving nodes within the Tree View Move some of the nodes within the Tree View. Copying nodes
In the Tree View, nodes can be copied by making a selection in the Tree View, dragging this selection with MB1 pressed on the RuleLibrary parent node, and releasing MB1. This will copy all selected nodes and add them at the end of the tree. All data related to a node will be copied to the new node. This enables to quickly create a new Rule from an existing Rule.

Activity: Copy a node Copy some of the nodes within the Tree View. Rename these nodes.

Machining Knowledge Editor Training V8.5- Concepts

25

Tree View

Undo
All commands can be undone by Ctrl+Z or by Edit > Undo.

Deleting nodes
In the Tree View nodes can be deleted by making a selection, and pressing the Delete button or by selecting Delete from the popup menu. This will delete all selected nodes.

Activity: Delete a node Delete the nodes that were created in the previous exercise.

26

Machining Knowledge Editor Training- Concepts

Table View

Table View
The Table View shows the data of activated nodes in an Excel style tabular representation. The Table View is mainly used for finding and filtering nodes.

Selecting nodes in Table View


Nodes in the Table View can be selected in one of the following ways:

MB1 on the beginning of a row is single select. If the mouse is moved while the
MB1 is pressed (and you should see an arrow cursor), multiple lines will be selected.

Control + MB1 on the beginning of a not-selected row modifies the selection.


The node will be added to the current selection.

Control + MB1 on the beginning of a selected row modifies the selection. The
node will be removed from the current selection.

Shift+MB1 on the beginning of a row allows multi selection. All nodes from the
previous selected node will be added to the current selection.

MB1 on the top left Cell will select all rows in the Table View. Commands in Table View
Node specific commands can be started from the popup menu of the Table View. This popup menu only appears when using MB3 on the beginning of the row.

Table View Toolbar


The Table View toolbar contains the following settings and commands for the Table View:

Machining Knowledge Editor Training V8.5- Concepts

27

Table View

Page Setup of Table View: Pops up the Page Setup window for the Table View.
In this window the setup of the Table View can be changed.

Export Table View to Microsoft Excel: Saves the content of the Table View to
an MS Excel file format.

Zoom in Table View by 20%: does what it says. Zoom out Table View by 20%: does what it says. Reset Zoom: Resets the zoom of the content of the Table View to 100% Replace: Searches the column for entries containing the search string and replaces the search string with the replacement string. The search string does not support wildcards. in the selected column. To display all rows again, the filter button has to be pressed again. If a cell is selected instead of a column, then the data of this cell is used to preset the search string for filtering the column containing the cell. The search string supports wildcards: * replacing zero or more characters ? replacing exactly one character ; separating elements of a vector

Filter: Hides all rows that do not have data matching the search string

28

Machining Knowledge Editor Training- Concepts

Table View

Autofilter: Activating the AutoFilter adds a new row to the TableView


just below the top row with the column names. Clicking with the mouse in one of the fields in this AutoFilter row shows a menu with all different values in the column. Selecting one of the values will show only the rows with that value and filter out all rows with other values. Upon deactivating the AutoFilter the AutoFilter row is removed and the filters are reset, i.e. all rows are shown again.

Toggle Freeze rows/ Toggle Freeze columns: moves the selected rows/
columns to the first positions, where they will remain visible when scrolling through the Table View. Pressing the button again will restore the normal display of the rows/columns.

Hide rows / Unhide rows: Will hide the selected rows. Unhide rows
will show all hidden rows again.

Hide columns / Unhide columns: Will hide the selected columns.


Unhide columns will show all hidden columns again.

Activity: Using some Table View commands Activate all Rules. In the name column find the nodes starting with Tap by using the filter
Tap*

Use the filter wildcards command on the name column to display all rows that
have S1H at the beginning, at the end, or somewhere in the string.

Use the freeze/hide commands. Use the Autofilter command to filter on the OperationClass and the OutputFeatures column values.

Sorting cells
In the Table View the rows can be sorted by attribute by clicking on the name of the column.

Editing cells
In the Table View the attributes of nodes can be edited. Cells are:

white, if the value in the cell can be edited,

Machining Knowledge Editor Training V8.5- Concepts

29

Table View

light gray, if the value in the cell is read-only, dark gray, if the attribute does not exist for the node.
The Table View displays both single value attributes (for example the name attribute), and vector attributes (for example the OutputFeatures and the ProductMaterials attribute). Several cells, either single value or vector values, in one column can be set to the same value by:

select one Cell having the value you want to copy, 10 in the example screenshot. select a corner of that Cell such that the cursor shape changes to a small rectangular.

drag that corner of the Cell over the other Cells

Several single value cells, not necessarily in one column, can be set to the same value by:

Select several cells Ctrl-click in one of the fields that you want to change Edit the value of the last selected cell and press Enter; the values of all selected
cells are changed to the new value.

Activity: Editing Cells Activate all Rules. In the Table View click on the name column to order the data. Change the priority of all the TAPPING operations to 10 using the two
described methods.

30

Machining Knowledge Editor Training- Concepts

Rule View

Rule View
The Rule View shows the data of a selected Rule. This is shown in a set of tabs, which are described later, and six Rule Definition Components. These are:

Name. Contains the name of the Rule. OperationClass (oper.). Contains the class of the operation that is to be generated based on this Rule. Pressing the F8 key in the field will pop-up the hierarchy with operation classes. Select one item from the list, type the value manually, or use a copy/paste sequence. The operation class and its parameters determine the motions of the tool during the operation. The display color will change when a valid OperationClass is defined. This also applies for the feature classes and the tool classes. The classes and related information are defined in the customization belonging to the RuleLibrary. There is a special class DummyOperation that can be used to change one feature type into another feature type. Rules of this class have no tool class. Priority. Contains a numerical value which determines the relative priority of the Rule, compared to other Rules producing the same More Worked Feature. The priority defines which Rule will be tried first, when there are more Rules that can machine the same feature. Generally, we give Rules that correspond to cheap operations (like drill operations) a higher priority than Rules that correspond to expensive operations (like reaming operations). This way we can be sure the system will try cheap Rules first and when these can not be applied, try the next more expensive Rule etcetera. OutputFeatures (mwf.). Contains the class of the Output Feature that is produced by the operation when the Rule is applied. This corresponds to the shape of the feature at the end of the operation. Pressing the F8 key in the field will pop-up a scrollable list with feature classes. Select one item from the list, type the value manually, or use a copy/paste sequence. When the Rule produces multiple features, they are separated by commas.

Machining Knowledge Editor Training V8.5- Concepts

31

Rule View

InputFeatures (lwf.). Contains the class of the Input Feature that is expected by the operation before the Rule is applied. This corresponds to the shape of the feature at the beginning of the operation. Pressing the F8 key in the field will pop-up a scrollable list with feature classes. Select one item from the list, type the value manually, or use a copy/paste sequence. When the Rule consumes multiple features, they are separated by commas. Resources (tool.). Contains the class of the tool that is used by the operation when the Rule is applied. Pressing the F8 key in the field will pop-up a scrollable list with tool classes. Select one item from the list, type the value manually, or use a copy/ paste sequence. When you locate the mouse pointer in any of the above fields you get a short help text. In addition to the six Rule Definition Components, there are seven Tabs containing more detailed aspects of the Rule Definition. These are described in the following sections.

Conditions Tab
This tab shows the conditions pertaining to the Rule. Conditions are used to describe specifics of the Rule, like when a Rule can be applied, which specific tool should be selected, operation parameters etc. All conditions are interpreted as logical expressions and must be true. If one or more conditions are false, the Rule will be rejected. The conditions are described in an easy, Visual Basic style, text based editing environment. This allows for free text editing (manual typing, delete, insert, copy, paste, etc.) with support for standard windows shortcuts:
TABLE 1. Shortcuts

for condition editing Select all text. Cut selected item. Copy selected item. Paste Goes to beginning of current line. Goes to beginning of document

Ctrl + A Ctrl + X Ctrl + C Ctrl + V Home Ctrl + Home

32

Machining Knowledge Editor Training- Concepts

Rule View

TABLE 1. Shortcuts

for condition editing Goes to end of current line. Goes to end of document. Highlights from current position to beginning of line Highlights from current position to end of line Moves one word to the left at a time Moves one word to the right at a time.

End Ctrl + End Shift + Home Shift + End Ctrl + Left arrow Ctrl + Right arrow

For more details please refer to Conditions concept on page 36.

Constants Tab
This tab shows the constants that can be used within conditions to improve consistency and readability. Constants can be used instead of hard-coded values in expressions. See Constants concept on page 46.

Materials Tab
This tab shows the list of materials that are defined as part materials within NX. A Rule can be made valid for selected materials. By checking the All Materials check box, a Rule will be valid for any material, also for materials that will be added in the future.

Machines Tab
This tab shows the list of machines that are defined within NX. A Rule can be made valid for selected machines. By checking the All Machines check box, a Rule will be valid for any machine, also for those that will be added in the future.

Explanations Tab
Contains a free textual explanation of the Rule.

Image Tab
You can add a picture to the Rule. The image can have as format .jpeg or .jpg. Use the command Add Image... that is available in the popup menu of the Image tab.

Machining Knowledge Editor Training V8.5- Concepts

33

Rule View

The picture appears in the Image Tab.

Add-on Tab
This Tab enables the creation and editing of what we have called Rule Add-ons. Depending on the Rules Operation Class, different types of Rule Add-ons can be defined. Examples of Add-on Object Types for a Drill Rule are:

Cycle - enables definition of the cycle type and its specific parameters Start of Path Events - like Approach Markers, opstop and many more End of Path Events Knowledge Fusion (KF) - all parameters of the Rules Operation Class can be defined via KF if desired. If you have quotes inside the kf expression like in this example, use a backslash so the expression will pass the Check Validity command:

kf.Maximum_Depth_Distance = "ug_oper_askfeatureattributevalue(\"HOLE_DEPTH\", NUMBER)"

Example of Add-on-Types for a Groove_OD Rule for turning is:

Geometry Parent, class Containment (is mandatory)


Example of Add-on-Types for an Internal_Trim Rule for Wire EDM is:

Geometry Parent, class Wedm_Geom (is mandatory)


Examples of Add-on-Types for a Cavity_Mill Rule are:

Geometry Parent, class Mill_Area

34

Machining Knowledge Editor Training- Concepts

Rule View

CutLevel, class ZlevelBase NcmLocalEngage, class EngageRetract_Default


Examples of Add-on-Types for a Thread_Milling Rule are:

Geometry Parent, class Hole_Boss

Machining Knowledge Editor Training V8.5- Concepts

35

Conditions concept

Conditions concept
A condition is a logical expression which can evaluate to TRUE or FALSE. We distinguish four categories of Conditions:

Application Criteria see page 36. Tool Attributes see page 39. Less Worked Feature Attributes see page 40. Operation Attributes see page 41.

Although NX does not know these categories, it is good to keep them in mind and organize the condition in these four categories.

Application Criteria
Application criteria state when a Rule may be applied. In general, application criteria are related to the size and quality of the More Worked Feature. Examples are:

The roughnesses that can be achieved: e.g. drilling is only allowed until a certain roughness, otherwise reaming/boring should be used.

The size tolerances that can be achieved: e.g. drilling is only allowed until a certain diameter tolerance, otherwise boring or reaming should be used.

The shape of the feature: e.g. drilling with a straight drill will finish the shape
only when there are no chamfers.

The size of the feature: e.g. drilling is only allowed when the feature is not too
deep or too large, otherwise another operation type should be used. A Rule can only be applied to a feature when all its application criteria are TRUE. When the expression evaluates to FALSE, evidently the Rule may NOT be applied. An example of an application criterion for using a twist drill is :

36

Machining Knowledge Editor Training- Concepts

Conditions concept

REM Application Criteria mwf.DEPTH / mwf.DIAMETER_1 < 6 $$ Feature is too deep for DRILL cycle

Each line in this example has a different function. The first line starting with REM is considered as remark and does not have any effect on the behavior of the program. The programmer can use remarks to include short explanations or observations. It is advised to add remarks so others can understand the behavior of the Rule and the reason for the conditions. There can be several lines of remarks following each other, but each line needs to start with REM . The second line mwf.DEPTH / mwf.DIAMETER_1 < 6 is the actual condition. In this case defining that the DEPTH attribute of the mwf (More Worked Feature) should be smaller than 6 times the DIAMETER_1 of the mwf. When applied to a manufacturing feature, with its actual parameter values for DEPTH and DIAMETER, this condition is false, the Rule will be rejected and the system will continue evaluating the next Rule. The third line starting with $$ defines the message that will be output when the condition is false and thus the rule is rejected. This message is part of the messages that users will see if they want to analyze why a certain solution was found. As a consequence, these messages should be clear enough for the users to be able to understand why a Rule was not used. When the Rule is denied because of this condition, the text prefixed with $$ will be printed in the Information window (if displayed) and to the MSAnalysis.lis file on the $TEMP directory. In the above examples, DEPTH and DIAMETER_1 are attributes of STEP1HOLE. In order to obtain a complete list of attributes you can use in expressions, type mwf followed by a dot . and select one from the list. When the editor recognizes valid entries, it will display them in a different color. These colors are defined in the Preferences.xml that can be found in the MACH\machining_knowledge_editor directory. Another example of an application criterion is:

Machining Knowledge Editor Training V8.5- Concepts

37

Conditions concept

IT_class_ISO(mwf.DIAMETER_1, mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= 11 $$ Feature's tolerance class cannot be achieved with this Rule

In the IT-class system for tolerancing dimensions, a low value denotes a tighter tolerance than a high value. So if the IT class of an actual feature is 7, it is too tightly toleranced to be drilled. Then this application criterion will evaluate to FALSE and the Rule will not be applied. In the above example, IT_Class_ISO( ) is a function delivering an integer number as result. When placing the mouse over the function text, a tool tip will appear explaining the function, see left. The default values for _upper and _lower bandwidths of dimensional parameters like the DIAMETER are in file mach\resource\feature\metric | english\feature_tolerances.xml. When _upper and _lower bandwidth have the same value, i.e. the tolerance is zero, then the function returns undefined. The rule will not be rejected on this test. In order to obtain a complete list of functions you can use in expressions, press F8 and select one from the list. Some other examples of rather common Application Criteria are:

mwf.SIDE_ROUGHNESS_1 > 12.5 $$ Features side roughness cannot be achieved mwf.DIAMETER_1 < 63 $$ Feature's diameter is too large mwf.DEPTH_TOP_CHAMFER > 0.01 $$ Feature must have a top chamfer

38

Machining Knowledge Editor Training- Concepts

Conditions concept

Tool Attributes
The Tool Query defines the size of the tool that will be used for the operation. Examples are:

The diameter of the tool should be corresponding to the diameter of the mwf:
e.g. the drill diameter should be smaller than the maximum toleranced size of the mwf diameter but should be larger than the minimum toleranced size.

The tool should be long enough: e.g. the length of the drill should be larger than
the depth of the hole. A Rule will have one or more expressions to specify tool attributes like:
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + 0.5*(mwf.DIAMETER_1_UPPER + mwf.DIAMETER_1_LOWER) tool.FluteLength > mwf.DEPTH

The expressions above were entered using copy and paste, see screenshot below.

In the above example, Diameter, and FluteLength are attributes of TWIST_DRILL. In order to obtain a complete list of attributes you can use in expressions, type tool followed by a dot . and select one from the list. The text printed, when one of these conditions evaluates to FALSE, says Conflict in one of the tool size specifications. That would happen, for instance, if we had mistakenly entered something conflicting like:
tool.POINT_ANGLE = 120 AND tool.POINT_ANGLE = 118

Note The operator AND is equivalent to putting the expressions on separate lines.
A Rule should not be rejected based on conditions defining tool Attributes. When the cutting tool of the class is not available, the Rule will not be applied and NX will try the next Rule. In that case, the $$text will not be displayed. NX will try to use the tool with the biggest Cutter Diameter that is still smaller than the maximum as specified by the expressions. As a consequence, the lower limit only needs to be defined when it is essential for a correct tool selection, like for drill

Machining Knowledge Editor Training V8.5- Concepts

39

Conditions concept

type operations. For milling operations a lower limit is most of the times not necessary. For this to function, NX must know which attribute holds the size of the Cutter Diameter. This is a trivial issue, but since the tool classification is free, it is necessary to appoint one of the tools attributes to be the Cutter Diameter. This is done in the Customization View with command Set as Cutter Diameter...See Set as Cutter Diameter, Set as Cutter Length on page 180. Tool Sort Order Generally, more than one tool of the desired class satisfies the tool query. It is important to avoid choosing a too long and therefore unstable tool. Tools are ordered by their length. For this to function, NX must know which attribute holds the size of the Cutter Length. This is a trivial issue, but since the tool classification is free, it is necessary to appoint one of the tools attributes to be the Length. This is done in the Customization View with command Set as Cutter Length.

Less Worked Feature Attributes

When defining Less Worked Feature attribute values we define the in-process geometry. The screenshot above shows the drill point that exists before drilling the hole. If no Less Worked Feature is required, the class BLANK is used. This means the operation does not need a defined starting geometry.

Note In general, there should be at least one operation with BLANK as LWF
for every MWF feature type. Otherwise there will be no complete solution found for a specific feature type. In order to calculate the dimensions we need to be familiar with the feature classes and their attributes. To specify the dimensions of the drill point (class POCKET_ROUND_TAPERED) we need following expressions:

40

Machining Knowledge Editor Training- Concepts

Conditions concept

lwf.DIAMETER_1 = mwf.DIAMETER_1 * 0.5 lwf.DIAMETER_2 = 0 lwf.DEPTH = lwf.DIAMETER_1/2

In the above example, DIAMETER_1, DIAMETER_2 and DEPTH are attributes of Less Worked Feature POCKET_ROUND_TAPERED. In order to obtain a complete list of attributes you can use in expressions, type lwf followed by a dot . and select one from the list. When there is no expression for the LWF attribute, NX copies the corresponding value from the MWF. This works only if the attribute names match exactly. So, if the DEPTH of the feature does not change, you do not need to enter the expression:
lwf.DEPTH = mwf.DEPTH

Also, you do not need to enter expressions like:


lwf.X_POSITION = mwf.X_POSITION lwf.Y_POSITION = mwf.Y_POSITION lwf.Z_POSITION = mwf.Z_POSITION

When the LWF is of class BLANK, we do not care about the LWF class and hence do not need to specify any LWF attributes. For readability, it is good practice to have lwf attributes on the left side of the equation.

Operation Attributes
The last category of conditions specifies attributes of the Rules operation. Examples are:

The operation should go deep enough What is the control point on the tool

Machining Knowledge Editor Training V8.5- Concepts

41

Conditions concept

Above a screenshot with some examples of assignments to operation attributes. In order to obtain a complete list of attributes you can use in expressions, type oper followed by a dot . and select one from the list. In MKE 8.0.1 you can use the + operator to concatenate any number of strings. Examples are depicted below:

New in MKE 8.0.1 is the possibility to define operation parameters in Add-ons. It was already possible to define operation parameters in the rule's conditions with the prefix oper.. If the same operation parameter is defined both in the condition tab and in an Add-on and the values are conflicting then the Add-on will be rejected. The main reason for having operation parameter assignments in an Add-on, rather than in the condition tab, is the timing of the assignment. This is a little bit complicated but it's sufficient to know that expressions in the Add-on are evaluated at the very end of Create Feature Process, when the operation is selected and a tool is selected. Whereas the expressions in the Conditions tab are continuously re-evaluated during the operation and tool selection process. This behavior may lead to unexpected and undesirable results in situations where feature parameter ranges and tool parameters are used to set operation attributes such as the operation name. It is recommended to define the operation parameters in the Rules Add-ons, rather than in the Rules Condition tab. This ensures that operation parameter assignments will not influence the operation selection itself. In other words: a rule will never be rejected due to an operation parameter assignment when the assignment is done in the Rules Add-on.

42

Machining Knowledge Editor Training- Concepts

Expression syntax | Functions

Expression syntax | Functions


This section gives a short overview of the expression syntax including the operators and functions that can be used within the expressions.

Table 2Operators
Operator Explanation

= < <= > >= <> + * / ^ AND OR NOT ( )

equal smaller than smaller than or equal greater than greater than or equal not equal addition(numbers or char strings) subtraction multiplication division power logical logical logical left parenthesis right parenthesis

IF THEN ELSE conditional expression Note a - b + c is evaluated as (a - b) + c . It is advised to use brackets for clarity
and correct evaluation.

Machining Knowledge Editor Training V8.5- Concepts

43

Expression syntax | Functions

Functions
Press F8 while in the Conditions Tab to obtain a list of functions:
TABLE 3. Functions

to be used in expressions
explanation returns the arc cosine. returns the arc sine. returns the arc tangent. returns the cosine. returns the sine. returns the tangent. returns the smallest integer >= input value. The input value can be a range, bound single or double sided. IF (a<=number<=b) THEN CEIL((a+b)/2) Otherwise same as CEIL(number)

output [degrees] [degrees] [degrees] [number] [number] [number] [integer] [integer]

function(argument) ACOS (number) ASIN (number) ATAN (number) COS (degrees) SIN (degrees) TAN (degrees) CEIL (number) CEIL_RANGE (number)

[integer] [integer] [boolean]

FLOOR (number) FLOOR_RANGE (number) is_defined(arg)

returns the largest integer <= input value. Similar to CEIL_RANGE returns TRUE if arg is defined; FALSE otherwise. returns FALSE if arg does not exist; arg can be of type real, integer or string; Example: IT_class(20,0.021,0) = 7 Note: returns undefined if 2nd param = 3rd. returns the roughness value of an attribute returns true if the two features are on the same axis returns the distance between two features converts a number in string format to real New in 8.0.1

[integer]

IT_class_ISO(number , number,number) roughness_value(string) on_same_axis(mwf1 , mwf2) distance(mwf1 , mwf2) ToReal(string)

[double] [boolean] [double] [real]

44

Machining Knowledge Editor Training- Concepts

Expression syntax | Functions

TABLE 3. Functions

to be used in expressions
explanation converts a whole number in string format to real New in 8.0.1 converts a real to a char string with (int) decimals shown. More decimals are truncated. New in 8.0.1

output [integer]

function(argument) ToInt(string)

[string]

ToString(param,int)

In addition to the functions above which are hard-coded, see the system functions defined in the Functions tab.

Machining Knowledge Editor Training V8.5- Concepts

45

Constants concept

Constants concept
Constants are objects with a name, a type and a value. We use them in conditions instead of hard-coded values, for instance:
oper.Depth = mwf.DEPTH + constant.DEPTH_EXTEND

instead of
oper.Depth = mwf.DEPTH + 2

Using constants instead of hard-coded values eases the readability and maintainability of expressions. Another advantage of using constants is the possibility to vary the values for any combination of machine / material. If there is no value specified then the default is used.

Above screenshot shows a constant.Pre_Drill_Limit with a different value for material ALUMINIUM. A constant can be of datatype double, integer, or string. Different constant values can be defined for metric and inch part files. Based on the units used in the part file, NX will automatically select the correct values of the constants.

If you define a constant value in metric (mm) only then NX will calculate the
english (inch) value by division by 25.4.

If you define a constant value in english (inch) only then NX will calculate the
metric (mm) value by multiplication with 25.4.

If you define a value for both english (inch) and metric (mm) unit systems then
-however- these values will be used by NX.

46

Machining Knowledge Editor Training- Concepts

Constants concept

Scope of a Constant
Preferably we declare a Constant globally, that is on the RuleLibrary level, with its default value and if applicable its values per machine / material combination. We use the Constant locally in a Rules Conditions and when the value should be different from the global value we can define the Constant locally at Rule level.

Constant Command Icons


Opens a dialog window to declare a new Constant and its default value. Cuts selected Constant and saves it on the clipboard. Copies selected Constant and saves it on the clipboard. Paste from the Clipboard Delete selected Constant Edit selected Constant (alternative for double click)

These commands are also available in the pop-up menu of the list of constants.

Using Constants in Expressions


In order to obtain a complete list of Constants you can use in expressions, type constant followed by a dot . and select one from the list. It is possible to use a constant even before it is declared. However, the Check Validity command will stumble over this and you can declare afterwards.

Machining Knowledge Editor Training V8.5- Concepts

47

Finding Rules based on criteria

Finding Rules based on criteria


There are several ways of finding and searching within the Machining Knowledge Editor. These options are described in the following section.

Find in all Rule Conditions


Use command Find in all Rule Conditions in the condition Tab or on the RuleLibrary, to activate (so theyre displayed in Table View) all Rules having the search string.

Find/Replace
To search for any text in the conditions and replace that text. When at the end of the Rules condition, the command asks if it should continue to search in the next Rule unless the Wrap around search is checked active.

Using TableView autofilter Use Table View to filter the RuleLibrary on any criteria, like Rules for machining a feature of class STEP1HOLE.

48

Machining Knowledge Editor Training- Concepts

Finding Rules based on criteria

Using TableView Filter Column You can search a selected column using the Wildcard search. For instance you
can find all activated Rules whos name starts with Chamfer:

Activity: Searching the Rules Use the table view to find all Rules with the TAPPING OperationClass. Find all Rules that use the condition tool.Diameter < mwf.DIAMETER_1

Machining Knowledge Editor Training V8.5- Concepts

49

Testing the Rules

Testing the Rules


Check Validity
Once a Rule is complete, the Rule can be checked by compiling the Rule or some of the conditions. Compilation of the Rule conditions can be done on different levels. Typically this is done to test conditions on validity on the fly.

Select one or more lines in the conditions Tab and execute Check Validity
(selection) from the pop-up menu.

Select the Rule node in the RuleLibrary and execute Check Validity from the
pop-up menu. If the compiler discovers mistakes these are indicated by bookmarks. Locate these bookmarks and correct the mistakes with the help of the compilers error message.

Activity: Check Validity Select a Rule and check the validity of some of the conditions. Select several Rules and check the validity of the Rules. Testing in NX with Create Feature Process
Once a library has been saved, the Create Feature Process command in NX can be used to test the Rules. This can be done by selecting features in the NX Manufacturing Feature Navigator and starting the Create Feature Process from the popup menu.

Reading the Information window and the MSAnalysis.lis


After each execution of Create Feature Process there will be a report in the Information window and in the MSAnalysis.lis file on the %TEMP% directory. At the beginning of the file, the used source file is mentioned, for instance:
Knowledge library: C:\Program Files\UGS\NX 7.5\mach\resource\machining_knowledge\machining_knowledge.xml

When a Rule is denied because of a condition which evaluated to False, the $$text after that condition will be printed. For instance:

50

Machining Knowledge Editor Training- Concepts

Testing the Rules

mwf.Diameter_1 >= 10.0


$$ Rule denied because Diameter_1 of the feature is < 10.

Activity: Testing the RuleLibrary


Load a test model in NX Switch to Manufacturing. In the Feature Navigator, recognize features with the Find Features command Start the Create Feature Process command on a feature.

Machining Knowledge Editor Training V8.5- Concepts

51

Rules for multiple More Worked Features

Rules for multiple More Worked Features


It is allowed, for feature mapping rules only, to have multiple mwfs separated by commas. Attribute Rule.type [direct,composed,indirect] determines the applicability of the Rule.

direct
mwf OR mwf OR mwf Attributes in conditions are prefixed with mwf. Since only attributes can be used that are in all mwf classes there can be no confusion.

composed
mwf AND mwf AND mwf Attributes in conditions must be pre-fixed with mwf_1, mwf_2 etcetera. This is not yet supported in for operation selection rules. It is supported in NX6 for feature mapping rules.

indirect
Rule will be filtered out in any case during Create Feature Process... command.

52

Machining Knowledge Editor Training- Concepts

CHAPTER 3

How Operation Selection works

This chapter deals with the Operation Selection that was introduced in NX6. It gives some background on how things work. NX CAM programmers do not necessarily have to be aware of this. What is Operation Selection? Rulebased operation selection is a proven technology seamlessly integrated into NX that helps you automatically create operations such as milling, drilling and tapping from a generic template. Rulebased operation selection is also applicable to Turning and Wire EDM operations. It lets you select features such as holes, slots, and pockets from any source, including features that are user defined, identified, recognized or tagged. It applies best practice machining rules on the features while taking into account any defined PMI. Benefits of feature based Operation Selection are:

Standardize on best practice machining knowledge. The software finds the best
solution for a machining task within a companys environment.

Save time with process automation.

Machining Knowledge Editor Training V8.5- How it works

53

Machining Knowledge Editor and NX

Machining Knowledge Editor and NX

There is a clear separation between the tool of the Subject Matter Expert, the Machining Knowledge Editor (above the dashed line) and the NX Programmer.

54

Machining Knowledge Editor Training V8.5- How it works

Machining Knowledge Editor and NX

The Machining Knowledge Source is created using the MKE. NX can be configured to use this source file. See CAM Configuration dependent customization on page 178.

Machining Knowledge Editor Training V8.5- How it works

55

Examples of operation sequences

Examples of operation sequences


STEP1HOLE and STEP1HOLE_THREAD in 4 operations.

The command Create Feature Process... in NX will start reasoning backward, using Rules, from the final feature (Output Feature) to the blank feature (Input Fea-

56

Machining Knowledge Editor Training V8.5- How it works

Examples of operation sequences

ture). This is the most import thing to keep in mind when implementing your companys machining knowledge in the MKE. Observe that Spot_Drill and Drill_S1H and Chamfer_S1H are three elemental operations that appear in the solution for both features. This is an essential concept: elementary rules are defined only once and are applied whenever appropriate. This sets aside the NX FBM solution to other systems or custom made solutions which find solutions by definining the complete set of operations for every case that needs to be automated. In NX FBM, a modification to a Rule will have effect in all instances where the rule will be applied.

Machining Knowledge Editor Training V8.5- How it works

57

Finding a solution using elementary rules

Finding a solution using elementary rules


In this example we will follow the reasoning process that is followed when searching for a solution for a feature of type STEP1HOLE with a diameter 12H7.

First the candidate rules will be selected. These are the rules that produce a feature of type STEP1HOLE. By filtering the Table View on STEP1HOLE we can create that list in the MKE. NX Operation Selection will create the same list internally. Operation Selection will first try the candiate Rule with highest priority. We have given the rules priorities such that the least expensive has the highest priority. In the example this means that Drill_S1H is tried first. It cannot be applied because a diameter tolerance of H7 is not achievable when using a twist drill. That is one of the Rules application criteria. This road ends which is denoted by:

58

Machining Knowledge Editor Training V8.5- How it works

Finding a solution using elementary rules

Then the next expensive Rule, Drill_in_center_S1H is tried. Also this Rule will fail for the same reason as Drill_S1H : a tolerance of H7 cannot be achieved with a twist drill.

Machining Knowledge Editor Training V8.5- How it works

59

Finding a solution using elementary rules

We skip a few candiate Rules that are rejected and arrive at Ream_S1H. For this Rule all conditions are true, and it is really applied which is denoted by a new node:

60

Machining Knowledge Editor Training V8.5- How it works

Finding a solution using elementary rules

The new node is an in-process feature of, again, type STEP1HOLE. The Ream_S1H conditions will have loosened the tolerance on its diameter. The in-process STEP1HOLE is the new target for the Operation Selection. And what we have seen before happens again: the candidate list with Rules is tried in order of priority, highest first. We see that Drill_S1H is rejected because of a general application settings that rejects drilling directly without centering first. The second Rule is Drill_in_center_S1H. For this Rule all conditions are true, and it is really applied which is denoted by a new node:

Machining Knowledge Editor Training V8.5- How it works

61

Finding a solution using elementary rules

The new node is an in-process feature of type POCKET_ROUND_TAPERED. The in-process POCKET_ROUND_TAPERED is the new target for the Operation Selection. And what we have seen before happens again: the candidate list with Rules is tried in order of priority, highest first. The applied Rule is Spot_Drill. For this Rule all conditions are true, and it is really applied which is denoted by a new node: The input feature of Spot_Drill is of type BLANK. The Operation Selection has successfully found a suitable set of rules to completely machine this feature. The resulting process in this simplified example is : Spot_Drill => Drill => Ream. NX will now create the operations in the Operation Navigator. As you have surely noticed, the result is found in the reversed order, reasoning backward from the final feature to the blank feature. Please take a few moments to consider the human approach in finding such a solution. Do we solve this sort of problems much different ?

Information Window
On your %temp% directory you will find a file MSAnalysis.lis. It has the analysis of the reasoning process including candidate Rules that were rejected. For a full understanding of how the solution came about, this file is essential.

62

Machining Knowledge Editor Training V8.5- How it works

Finding a solution using elementary rules

With File > Utilities > Customer Defaults...you can activate the check box Display Information...etc to have the file popping up after each Create Feature Process...

Machining Knowledge Editor Training V8.5- How it works

63

Finding a solution using elementary rules

64

Machining Knowledge Editor Training V8.5- How it works

CHAPTER 4

MKE Exercises: Hole Making

Before proceeding, please make sure you have completed reading Machining Knowledge Editor Concepts. In this chapter you find exercises to create a number of example MachiningRules:

Drill Tap Ream Drill-up Thread Mill (to be done)

After completing these exercises you are well equiped to translate your companys best manufacturing practices into MachiningRules that can be used by NX. The exercises provide detailed instructions. It should be possible to follow this training off-line, self-paced.

Machining Knowledge Editor Training

65

Creating a new RuleLibrary file

Creating a new RuleLibrary file


The Rule Library file is an xml source file containing

MachiningRules (tab Machining Knowledge) FeatureRecognitionRules (tab Feature Recognition) MappingRules (tab Feature Mapping) a FunctionLibrary (tab Functions) the Customization

We will focus on MachiningRules in this part of the Tutorial. There are two options when creating a new RuleLibrary file:
1.

Copy an existing RuleLibrary file. Advised when your new MachiningRuleLibrary will have a lot in common with the old MachiningRuleLibrary. This is for example when you are going to add extra MachiningRules to an existing MachiningRuleLibrary. Create a new RuleLibrary file and start from scratch. You will still have the possibility to import rules from other libraries, using the commands MB3 > Export/Import .

2.

Copying an existing RuleLibrary file


This can be done in the following steps:

Go to the UGII_CAM_MACHINING_KNOWLEDGE_DIR directory. Copy the file machining_knowledge.dat. Rename the copy to train_machining_knowledge.dat. Edit train_machining_knowledge.dat and assign a new library name to the MACHINING_KNOWLEDGE_LIBRARY entry. UGII_CAM_CONFIG_DIR directory or the UGII_CAM_CUSTOM_DIR directory.

Go to the configuration directory. Depending on the installation this is either the

66

Machining Knowledge Editor Training

Creating a new RuleLibrary file

Copy the configuration file that is linked to the existing RuleLibrary. Rename the copy to, for instance, train_feature_machining.dat Edit the copy of the configuration file. Change the
MACHINING_KNOWLEDGE entry to point to the new train_machining_knowledge.dat file that was created in the UGII_CAM_MACHINING_KNOWLEDGE_DIR configuration directory.

Start the Machining Knowledge Editor. Open the existing RuleLibrary file using command Open and Update. When
the NX Configuration Files dialog appears, select the .dat file that you created and press the OK button.

Save the file with the new library name using the File > Save As command. Creating a new RuleLibrary file.
This requires the following steps:

Go to the UGII_CAM_MACHINING_KNOWLEDGE_DIR configuration


directory.

Copy an existing file, like machining_knowledge.dat. Rename the copy to, for instance, train_machining_knowledge.dat Edit the copy of the configuration file. Assign a new library name to the
MACHINING_KNOWLEDGE_LIBRARY entry.

Go to the configuration directory. Depending on the installation this is either the


UGII_CAM_CONFIG_DIR directory or the UGII_CAM_CUSTOM_DIR directory.

Copy the configuration file that pointed to the original file in the
UGII_CAM_MACHINING_KNOWLEDGE_DIR.

Rename the copy to, for instance, train_feature_machining.dat Edit the copy of the configuration file. The MACHINING_KNOWLEDGE
entry must point to the new file that was created in the UGII_CAM_MACHINING_KNOWLEDGE_DIR configuration directory, say train_machining_knowledge.dat.

Start the Machining Knowledge Editor. Choose File >New. In the NX Configuration Files dialog box, from the Configuration Folders list,
select the location for the configuration file:

Machining Knowledge Editor Training

67

Creating a new RuleLibrary file

- If you use a standard NX configuration, select UGII_CAM_CONFIG_DIR. - If you have custom configurations, select UGII_CAM_CUSTOM_DIR. - Or you can use Browse to select a configuration file from anywhere on the file system.

From the Configuration Files list, select the file you copied and renamed, like
train_feature_machining.dat.

Select the unit system and click OK. Save the file with a new name using the File > Save As command. The name
must be as defined in train_machining_knowledge.dat. As we will start from scratch we need to create a new RuleLibrary file.

Activity: Creating a new RuleLibrary file Create a file my_feature_machining.dat on the UGII_CAM_CONFIG_DIR
with a MACHINING_KNOWLEDGE entry pointing to MyRules.dat.

Create a file MyRules.dat on the


UGII_CAM_MACHINING_KNOWLEDGE_DIR with a MACHINING_KNOWLEDGE_LIBRARY entry pointing to MyRules.

Launch the MKE from the Start menu > Siemens NX 8.5 > Manufacturing Tools
> Machining Knowledge Editor.

Create a new RuleLibrary with File > New. Use my_feature_machining.dat from the UGII_CAM_CONFIG_DIR. Save the initial source file as MyRules.xml Activity: Setting the Cutter Diameter and Cutter Length
Since we are working on a new source file, we must appoint one of each tools attributes to be the Cutter Diameter.

Open the Customization View by pressing the Customization tab. Expand the Drilling tree in the Tools tree. Select node Drilling Right-click Diameter attribute in the attributes list and select Set as Cutter Diameter ....

68

Machining Knowledge Editor Training

Creating a first Rule

The Diameter attribute in inherited by all Drilling tools and is now used by the software as the Cutter Diameter.

Select node Twist Drill Right-click FluteLength attribute in the attributes list and select Set as Cutter
Length.... The Flute Length attribute is specific for the Twist Drill and is not further inherited. It is now used by NX as the Cutter Length.

Do the same for classes TAP and CHUCKING_REAMER. Press Save to file your edits.

Creating a first Rule


What this example intends to explain The basics of creating a single MachiningRule How to test the MachiningRule
All conditions for this MachiningRule are presented here. Please keep in mind that these are just examples, as is the MachiningRule itself. Especially conditions of category Application Criteria are always customer specific.

Machining Knowledge Editor Training

69

Creating a first Rule

Explanatory picture

We start by defining a MachiningRule which describes how to drill a straight hole in full material using a twist drill. When creating a new MachiningRule, we have to define the following items:

The More Worked Feature class, describing the shape of the end geometry. The Less Worked Feature class, describing the shape of the starting geometry. The cutting tool class. The operation class describing the machining strategy.

In our example, this maps to the following:

More Worked Feature: a straight through hole corresponds to the feature class
STEP1HOLE.

Less Worked Feature: when starting from full material this corresponds to the
feature class BLANK.

Tool: the twist drill corresponds to the TWIST_DRILL cutting tool class. Operation: the drill motion is defined by the DRILLING strategy. Activity: Create a MachiningRuleLibrary Press the Machining Knowledge tab in the TreeView. Move the mouse over MachiningKnowledge, right-click and choose New...
from the menu.

Check class MachiningRuleLibrary and leave the amount to 1. Press OK to create a new empty library. Rename MachiningRuleLibrary* to TrainingRules.

70

Machining Knowledge Editor Training

Creating a first Rule

You now have created this:

Activity: Create a MachiningRule for Drilling a Step1Hole Move the mouse over node TrainingRules, right-click and choose New... from
the menu.

Check class MachiningRule and leave the amount to 1. Expand TrainingRules by clicking the + sign and select MachiningRule*. Rename MachiningRule* to Drill_STEP1HOLE_Direct.
You now have created this:

Press F8 in the OperationClass field and select DRILLING in the operation


class tree.

Press F8 in the More Worked Features field and select STEP1HOLE from the
list.

Machining Knowledge Editor Training

71

Creating a first Rule

Click in the Less Worked Features field and enter the class name BLANK .(You
can select from the list as well.)

Press F8 in the Tool field and select TWIST_DRILL in the tool class tree. Set the Priority = 3. Conditions
By creating the MachiningRule, we only defined that you can drill a straight hole with a drill. But we did not yet define any such detail conditions as:

when we want to use this MachiningRule, what size of tool do we want to use, or how deep we want to drill.
Without these conditions, the system will use this operation for any hole independent of size or quality, and will select any drill without regard of the size. In order to create a useful MachiningRule, this information needs to be added. This is done by defining conditions for the MachiningRule. In general, the conditions can be grouped into 4 categories:

(1) Application Criteria describing when the MachiningRule is allowed. (2) Tool attributes describing the details of the tool. (3) Less Worked Feature attributes describing the details of the starting geometry.

(4) Operation Attributes describing the details of the operation.


The next sections will detail these conditions.

(1) Application Criteria


Application criteria define when a MachiningRule is allowed. In general, these conditions are related to the size and quality of the More Worked Feature. Examples are:

The roughnesses that can be achieved: e.g. drilling is only allowed until a certain roughness, otherwise reaming/boring should be used.

The size tolerances that can be achieved: e.g. drilling is only allowed until a certain diameter tolerance, otherwise boring or reaming should be used.

72

Machining Knowledge Editor Training

Creating a first Rule

The shape of the feature: e.g. drilling with a straight drill will finish the shape
only when there are no chamfers.

The size of the feature: e.g. drilling is only allowed when the feature is not too
deep or too large, otherwise another operation type should be used. Conditions are defined as text in the Conditions tab of the Machining Knowledge Editor. An example of a condition is the following group of lines:
REM This condition checks for the achievable side roughness roughness_value( mwf.SIDE_ROUGHNESS_1 ) >= 1.6 $$$$ Cannot achieve roughness on side surface

Each line in this example has a different function. The first line starting with REM is considered as remark and do not have any effect on the behavior of the program. You can use remarks to include short explanations or observations. It is advised to add remarks so others can understand the behavior of the MachiningRule and the reason for the conditions. There can be several lines of remarks following each other, but each line needs to start with REM . The second line
roughness_value(mwf.SIDE_ROUGHNESS_1) >= 1.6

is the actual condition defining in this case that the SIDE_ROUGHNESS_1 attribute of the mwf (More Worked Feature) should be larger or equal than 1.6. The MachiningRule is allowed if the condition is true. In this example, the MachiningRule will be allowed if the SIDE_ROUGHNESS_1 = 1.6 or larger but will not be allowed if SIDE_ROUGHNESS_1 is smaller. If a condition is false, the whole MachiningRule will be rejected and the system will continue with evaluating the next MachiningRule. The third line starting with $$ defines the message that will be displayed when the previous condition is false. This message is part of the messages that users will see if they want to analyze why a certain solution was found. Therefore these messages should be clear enough for the users to understand why a MachiningRule was not used. Another good example of an application criteria condition is: IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= 10

Machining Knowledge Editor Training

73

Creating a first Rule

$$ IT class Diameter_1 cannot be achieved. Another good example of an application criteria condition is: mwf.DIAMETER_1 <= 25 $$ Diameter_1 is too big to drill at once

(2) Tool attributes


Tool attributes criteria define the shape of the tool that will be used for the operation. In NX this is this is the Tool Query. Examples are:

The diameter of the tool should be corresponding to the diameter of the mwf:
e.g. the drill diameter should be smaller than the maximum toleranced size of the mwf diameter but should be larger than the minimum toleranced size.

The tool should be long enough: e.g. the length of the drill should be larger than
the depth of the hole. This corresponds to criteria like:
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + mwf.DIAMETER_1_UPPER tool.FluteLength > mwf.DEPTH + constant.Thru_Hole_Clearance

(3) Less Worked Feature attributes


When defining Less Worked Feature attribute values we define the in-process geometry. Since we start drilling from blank, which means we do not bother about the starting geometry, nothing needs to be specified here for this rule.

(4) Operation Attributes


The last category of conditions specifies attributes of the MachiningRules operation. Examples are:

The operation should be deep enough: e.g. the depth of the drill motion should
be equal to the depth of the mwf feature, or in case of a through hole should be larger than the depth of the hole.

The tool diameter can be larger than the modeled diameter, as long as it stays
within the tolerance range.

74

Machining Knowledge Editor Training

Creating a first Rule

oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Through_Clearance = constant.Thru_Hole_Clearance oper.Allow_Oversize_Tool = "true" oper.Oversize_Tool_Percent = 100.0 * mwf.DIAMETER_1_UPPER / mwf.DIAMETER_1

Special remark on Output Load Tool. When you activate this option, the system outputs a LOAD or TURRET command in the CLSF file, even if the tool has not changed. This option can be defined as an operation parameter.
oper.Output_load_tool_Status ="true"

Activity: Define Conditions for Drilling a Step1Hole Click the Conditions Tab of MachiningRule Drill_STEP1HOLE_Direct Create or Copy the conditions from the previous sections into the conditions
area. Add the REM in front of the remarks. You can copy from a PDF document if you choose Tools > Basic > Select in the Adobe Reader.

Move the mouse into the conditions area, click MB3 and choose Check Validity
(selection)

The result should look as depicted above. The lines containing an undefined
Constant are bookmarked.

Machining Knowledge Editor Training

75

Creating a first Rule

Constants
The only constant used in the Conditions, Thru_Hole_Clearance, should be declared and have a default value. It is good practice to declare a constant on the MachiningRuleLibrary level, so its default value is shared by all MachiningRules in the MachiningRuleLibrary.

Activity: Defining a Constant Select TrainingRules and Press the Constants Tab. Define a new constant, either by clicking MB3 > New in the constant area or by
clicking the New icon.

Define as Name = Thru_Hole_Clearance and as Default Value = 3 mm. Select the inch to mm factor = 25.4. OK in the Options Dialog window. In the Machine/Material matrix, define a value = 4 mm for when the product material is CARBON_STEEL. This overrides the value 3 mm for all machines when the workpiece material is CARBON_STELL. tions and choose Check Validity (selection).

In the tree, select node Drill_STEP1HOLE_Direct, right-click in the Condi There should be no more compiler errors now. Materials and Machines Activity: Select for which Materials and Machines the MachiningRule is valid
Select Drill_STEP1HOLE_Direct and click the Materials tab. Unselect All Materials and select only ALUMINIUM. Click on the Machines tab. Unselect All Machines and mark only some of them. Undo your previous changes by checking All Materials as well as All Machines.

76

Machining Knowledge Editor Training

Creating a first Rule

Activity: Learn to use the explanation field Click the Explanation tab of rule Drill_STEP1HOLE_Direct Enter a clear textual explanation of this MachiningRule. Be sure it will be
understandable for another person.

Ask your tutor to review your explanation. Activity: Adding an Image file to a MachiningRule
Save the picture on page 70 to a file named Drill_STEP1HOLE_Direct.JPG Click the Image tab From the popup menu select Add Image.... Locate file Drill_STEP1HOLE_Direct.JPG and press OK.

Testing the MachiningRule


In order to test the MachiningRule we must have feature instances. In real MachiningRuleLibrary development projects its crucial to collect families of feature instances in one reference product. For testing the MachiningRuleLibrary we use cam_sample_fbm_1_mm.prt which comes in the samples folder in MACH. This sample model already has manufacturing features and FBM operations defined. Before proceding, we will clean this up to have a clear visibility on our own job.

Activity: Remove existing operations


Load cam_sample_fbm_1_mm.prt in NX. Save the model as my_cam_sample_fbm_1_mm.prt Choose Preferences > Manufacturing Under Configuration File, choose my_feature_machining.dat and press OK. Go to the Operation Navigator Go to Geometry View Delete all Feature Geometry Groups (under the MCSs) Delete all Tools in the Machine Tool View Go to the Machining Feature Navigator

Machining Knowledge Editor Training

77

Creating a first Rule

Delete all features. Save the model. Activity: Testing the MachiningRule
Before we can test the rule, we must have at least one feature of type step1hole. Since we deleted all features in the previous activity we first have to recognize the features again.

Switch to the Feature Navigator. Start the Find Features... command. Recognize only the STEPS feature
types.

Use the a face of the product to


define the Machining Access Direction with Method = Specifiy Vector..

Press the Find Features command icon. A large number of stepped hole features is recognized.

Select all recognized features of type step1hole and execute Create Feature
Process...

Select the checkbox for TrainingRules.

Leave the allocation to Geometry


objects at Automatic.

Press OK

78

Machining Knowledge Editor Training

Creating a first Rule

The rule is applied on the step1hole features. Two Feature Geometry Groups were created automatically. One of them contains all the 9.5 mm step1holes.

Check the selected tools, 2 different drills are used.


You will find that a drill 9.7 mm was used for the 9.5 hole diameter and a drill 10.2 mm for the 10 mm hole. This is correct within the tolerance zone of +/- 0.2 mm specified by the values of diameter_1_upper and diameter_1_lower. The software always tries to select the library tools with the biggest diameter that still fits within the tolerance zone.

Note If we had not previously deleted the 9.5 mm drill and the 10 mm drill in
the Machine Tool View, these tools would have been selected since they take precedence over library tools not yet in the part file, and they satify the tool query conditions of our MachiningRule.

Note The default values for _upper and _lower bandwidths of dimensional
parameters like the DIAMETER are in file mach\resource\feature\metric | english\feature_tolerances.xml. Only when PMI is defined you will see deviating values for the diameter_1_upper diameter_1_lower. In cam_sample_fbm_1_mm.prt you can see PMI in the Feature Navigator for feature step1hole_14, among others, as depicted below:

Generate the toolpaths for the operations. Verify the tool path of the operations. Detailing the MachiningRule with Add-ons
In these activities we will further

Machining Knowledge Editor Training

79

Creating a first Rule

(1)Define the Cycle Type and Parameters This is done by creating an Add-on
to the rule.

(2) Define a Start/End UDE. (3) Define Markers Activity: (1)Define the Cycle Type and Parameters Click the Add-ons Tab Click New Add-on You can choose any
name for the object, like dd in this example.

The Type of the Add-on object is Cycle. Choose the class of Cycle, like Drill_Deep in this example.

80

Machining Knowledge Editor Training

Creating a first Rule

In the expression area you can enter expressions by typing the name of the object followed by a dot. You get a list of attributes that can be used in your expressions.

In your expressions you can use more worked feature attributes (mwf.) and tool attributes (tool.) to calculate the values of the cycle attributes. Also you can use conditional constructions with IF THEN ELSE. Use of less worked features attributes (lwf.) and operation attributes (oper.) is allowed but this seems not very likely in practice.

Define expressions for dd as in screenshot above.

Machining Knowledge Editor Training

81

Creating a first Rule

On a single MachiningRule you can define multiple Cycle Add-on objects as shown below.

The system will create the first Cycle object of which all conditions are True. In this example the criterion is the depth/diameter ratio of 3.

Create a second Add-on named bc with expressions as in screenshot above. Activity: (2) Define a Start/End UDE.
If you define multiple UDEs, the system will create all UDE objects of which all conditions are True. This is different from Cycle type objects where only one object will be created. To create a User Defined Event (UDE) you first create an Add-on object of type UDE_Start_of_Path or UDE_End_of_Path. Choose a name and the class, like ude1 below.

In the expression area you type the name of the Add-on Object followed by a dot. Then you can choose from the list of available attributes.

82

Machining Knowledge Editor Training

Creating a first Rule

UDEs can be conditional using IF THEN ELSE constructs in the expression.

The sequence of the UDEs in the 'Defined list' is the order in the list of Add-ons. UDEs can be moved up and down using the arrow buttons.

Create an Add-on like ude1 with expressions as in screenshots above. Activity: (3) Define Markers
Markers will generally not have any conditions. Markers serve to tell the system where to output an event. For instance, the Tool Change Marker allows you to specify where you want the system to output the tool change event. When you insert this marker into the list of Add-ons, the system writes the commands above the marker to the CLSF before the LOAD or TURRET command, and it writes the commands below the marker to the CLSF after the LOAD or TURRET command.

Create a few markers like in this screenshot:

In NX remove the current operations on the sample model

Machining Knowledge Editor Training

83

Creating a second MachiningRule

Execute Create Feature Process... again on the step1holes.


What is the selected Cycle Type, Break Chip or Deep ? Inspect the Drilling dialogue. What about the End of Path Event, Operator Message, is it Operator: check tool or Operator: go ahead ? Inspect the Machine Control block in the Drilling diallogue.

Creating a second MachiningRule


What this example intends to explain
The first MachiningRule operates on features of type step1hole which is a through hole. We will learn how easy it is to copy the first rule and adapt it where necessary to let it solve blind holes, which is feature type step1pocket.

Activity: Copy the first rule and make changes In the TreeView, select Drill_STEP1HOLE_Direct and drag this rule onto its
parent node TrainingRules. Then release MB1.

Select the copied rule and make the following changes: - change OutputFeatures to STEP1POCKET
- change Name to Drill_STEP1POCK_Direct - change the Conditions since the tool should go to the bottom and not thru:

oper.Control_Point_Type ="Tool_Shoulder" oper.Maximum_Depth_Distance = mwf.DEPTH_1 oper.Blind_Hole_Stock = 0

In NX, test the second rule by executing command Create Feature Process... on one or more features of type STEP1POCKET.

84

Machining Knowledge Editor Training

Creating a third MachiningRule

Creating a third MachiningRule


What this example intends to explain
We will create a MachiningRule to tap a STEP1POCKET_THREAD by cutting the thread. This will help to explain two important things:
1. 2.

In addition to the previous example, you learn the basics of in-process geometry by specifying Less Worked Feature attribute values. Tapping a feature will rarely be the only operation. There will usually be a drillling operation before. And we will see that Drill_STEP1POCK_Direct, which we defined earlier, can do that job too. We only need to define the Tapping MachiningRule.

Note The instructions for defining the MachiningRule will be less detailed now. Explanatory picture

Conditions Application Criteria


For now we do not define any Application Criteria. We always want to use this MachiningRule whenever a thread has been defined in the model.

Tool attributes

Machining Knowledge Editor Training

85

Creating a third MachiningRule

Since machine taps are usually standard tools from a catalogue, it is enough we specify just the selection criteria to select the correct tool. Most importantly these are the diameter, pitch and length.
tool.Diameter = mwf.THREAD_MAJOR_DIAMETER tool.Pitch = mwf.THREAD_PITCH

Less Worked Feature attributes


We need to define the diameter of the less worked feature to match the core of the threaded pocket. This is done with the following conditions: REMARK The core diameter is usually calculated according to a simple formula:
lwf.DIAMETER_1 = mwf.THREAD_TAPPED_DRILL_SIZE lwf.DIAMETER_1_UPPER = 0 lwf.DIAMETER_1_LOWER = mwf.DIAMETER_1_LOWER

Operation Attributes
REMARK the tapping tool should go as deep as the thread length.
oper.Maximum_Depth_Distance = mwf.THREAD_LENGTH

Constants
We do not make use of a constant parameter in this MachiningRule.

Materials and Machines


We will make the MachiningRule valid for Alloy Steel only. We make the MachiningRule valid for all machine tool type names.

Explanation
Tapping by cutting is done whenever a thread feature has been defined.

Activity: Create rule Tap_STEP1POCKET_THREAD Create the MachiningRule and change the name to
Tap_STEP1POCKET_THREAD.

86

Machining Knowledge Editor Training

Creating a third MachiningRule

Define the MachiningRule definition components to match the explanatory picture on page 85.

Create or Copy the above conditions into the conditions area. In the Materials tab, select ALLOY STEEL. Provide an Explanation in your own words. Add an Image to the MachiningRule. Create one yourself if you have time. Store the image on page 85 as a JPG and attach it to the rule.

Activity: Test the tapping Rule Save the machining knowledge source file. Test the MachiningRules with Create Feature Process on all features of type STEP1POCKET_THREAD. Check the selected tools and operations Generate Tool Path Verify Tool Path
At this point it is important to understand that Rule Drill_STEP1POCK_Direct is used for machining a feature that is a final manufacturing feature, as well as for an in-process feature. The MachiningRule is the same in both cases. Below you see two different Feature Geometry Groups. In the second group the rule Drill_STEP1POCK_Direct is applied to create the pre-drilled hole.

Note Collisions will be detected during tool path creation because the tools are not
sticking out long enough to avoid the walls in this part. A longer tool must be selected manually to avoid the collisions.

Machining Knowledge Editor Training

87

Defining a competing MachiningRule

Defining a competing MachiningRule


What this example intends to explain
We will define a MachiningRule for reaming a STEP1HOLE. In addition to the previous examples, you learn the basics of competition between two or more MachiningRules having the same More Worked Feature class. The Reaming Rule you are going to create in this exercise is an alternative for Drilling and can be seen as a competitor for Drilling. The competition between MachiningRules is controlled using the MachiningRule.Priority together with the MachiningRules conditions. The MachiningRule.Priority is a numerical value which determines the relative priority of the MachiningRule, compared with other MachiningRules, producing the same More Worked Feature. The priority defines which MachiningRule will be tried first, when there are alternative MachiningRules to machine the same feature. Generally, we recommend to give cheaper MachiningRules a higher priority than expensive MachiningRules. This way we can be sure the system will try cheap MachiningRules first and only when these cannot be applied (because of Application Criteria) NX will try the next more expensive MachiningRule etc. etc.. See How Operation Selection works on page 53.

88

Machining Knowledge Editor Training

Defining a competing MachiningRule

Explanatory picture

Conditions Application Criteria


We will test on the side roughness of the STEP1HOLE, and on the diameter tolerance bandwidth.
REM Application Criteria roughness_value(mwf.SIDE_ROUGHNESS_1) >= 0.8 $$ Feature has a too smooth surface for reaming. IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER,mwf.DIAM ETER_1_LOWER) >= 6 $$ IT class Diameter_1 cannot be achieved.

Tool attributes
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + mwf.DIAMETER_1_UPPER

Less Worked Feature attributes


lwf.DIAMETER_1 >= mwf.DIAMETER_1constant.ALLOWANCE_REAM_MAX lwf.DIAMETER_1 <= mwf.DIAMETER_1constant.ALLOWANCE_REAM_MIN lwf.DIAMETER_1_UPPER = 0.2

Machining Knowledge Editor Training

89

Defining a competing MachiningRule

lwf.DIAMETER_1_LOWER = -0.2 lwf.SIDE_ROUGHNESS_1 = "12.5"

Operation Attributes
oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Through_Clearance = constant.Thru_Hole_Clearance

Constants
We introduced new constants in the Less Worked Feature Attributes conditions above.

Declare constant.ALLOWANCE_REAM_MAX with default value = 2 mm. Similarly, declare constant.ALLOWANCE_REAM_MIN with a default
value = 1 mm. Declare both constants on the TrainingRules library, better than on the reaming rule itself.

Materials and Machines


MachiningRule is valid for all Materials and all Machines.

Explanation
Enter an explanation text in your own words.

Activity: Reaming a Step1Hole Copy Rule Drill_STEP1HOLE_Direct by dragging it onto its parentMachiningRuleLibrary.

Change the MachiningRule definition components to match the explanatory picture.

Since Reaming is more expensive than Drilling we should give Reaming a lower
priority. Give this MachiningRule a priority = 1 and verify this is lower than the priority of Drill_STEP1HOLE_Direct.

Work on all Tabs, starting with Conditions, and enter the expressions provided
above.

90

Machining Knowledge Editor Training

Defining a competing MachiningRule

Replace the image and delete the Add-ons (all were copied). When finished, File > Save the library. In NX, test the rules on all step1hole features with Create Feature Process...(First delete all previously generated operations, tools and geometry groups.)

Note you will see that the results are not different from the previous run. In
order to trigger the reaming operation we must tighten the tolerances of a feature. Let us modify the side roughness of one of the step1holes. This is normally done using command PMI > Surface Finish and will then be picked up by the Feature Recognition. Alternatively, we can modify the feature attribute directly like this:

In the MFN, select a step1hole and modify the SIDE_ROUGHNESS_1


attribute value to 0.8.

Create Feature Process... on this step1hole. Locate file MSAnalysis.lis on your %TEMP% directory and try to understand
how the reasoning process found a solution for this feature. Observe that MachiningRule Drill_STEP1HOLE_Direct is rejected the first time because it cannot achieve the required surface roughness.

Machining Knowledge Editor Training

91

Working with in-process geometry

Then Ream_STEP1HOLE is the next in the priority list and it is applied. The inprocess geometry is then made by Drill_STEP1HOLE_Direct.

Working with in-process geometry


What this example intends to explain
We will define a MachiningRule Drill_STEP1HOLE_Big for drilling up a big STEP1HOLE with a Diameter larger than 25. Such STEP1HOLE needs to be pre-drilled. The size of the pre-drill has to be within a range with a lower- and upper boundary. In addition to the previous examples, you learn the basics of working with ranges for in-process geometry.

Explanatory picture

Conditions
Starting with a copy of Drill_STEP1HOLE_Direct, only a few conditions need to be changed, these are:

92

Machining Knowledge Editor Training

Working with in-process geometry

Application Criteria
mwf.DIAMETER_1 > 25 $$ Rejected because Diameter_1 is too small

Tool Attributes
No changes.

Less Worked Feature attributes


It is good practice for the in-process diameter to be within 20% and 40% of the feature diameter. So:
lwf.DIAMETER_1 >= 0.2 * mwf.DIAMETER_1 lwf.DIAMETER_1 <= 0.4 * mwf.DIAMETER_1 lwf.DIAMETER_1_UPPER = 0.2 lwf.DIAMETER_1_LOWER = -0.2

Note Instead of hard-coded numerical values, you can also use constants here. Operation Attributes
No changes.

Constants
No new constant used here. But if you want you can replace the 0.2 and 0.4 by Constants.

Materials and Machines


Valid for all.

Explanation
Please enter a text in your own words.

Machining Knowledge Editor Training

93

Hole Milling

The in-process diameter must be within 20% and 40% of the More Worked Feature diameter. For a mwf.DIAMETER_1 = 30 this means: 6 <= lwf.DIAMETER_1 <= 12

Activity: Create a MachiningRule for drilling a big hole Drag Drill_STEP1HOLE_Direct on its parentTrainingRules. This will create a copy.

Rename the copy to Drill_STEP1HOLE_Big. Change the Less Worked Feature to STEP1HOLE. Set the priority to 2 Work on all Tabs, starting with Conditions, and enter the expressions provided above. Replace the Image and delete the Add-ons that were copied. applied or not.

In NX, run Create Feature Process... on the biggest hole and see if this rule is

Hole Milling
What this example intends to explain
The hole with Diameter = 85 is too big for even the largest drill in the standard NX ascii tool database. This calls for a rule that uses an end mill that starts from a predrilled hole.

94

Machining Knowledge Editor Training

Hole Milling

Explanatory picture

Conditions Application Criteria


none

Tool Attributes
tool.Diameter < lwf.DIAMETER_1 tool.FluteLength > mwf.DEPTH + constant.Thru_Hole_Clearance

LWF
lwf.DIAMETER_1 >= mwf.DIAMETER_1*0.5 lwf.DIAMETER_1 <= mwf.DIAMETER_1 - 2.0 lwf.DIAMETER_1_LOWER = -0.2 lwf.DIAMETER_1_UPPER = 0.2

Operation Parameters
oper.Check_Collision = "true" oper.Region_Cut_Method = "Spiral"

Machining Knowledge Editor Training

95

Thread Milling

oper.Hole_Diameter = mwf.DIAMETER_1 + (mwf.DIAMETER_1_LOWER + mwf.DIAMETER_1_UPPER)/2 oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Predrill_Hole_Diameter = lwf.DIAMETER_1 oper.Cut_Level_Max_Depth = 0

Activity: Contour Milling of a step1hole


Create the Rule with the conditions as described above Give a priority = 1 Save the library In NX, test on the big hole with diameter = 85

Thread Milling
Thread Milling is new since NX 7.5. There are a few examples in the ootb machining rules using THREAD_MILLING. Note the Add-ons that are mandatory.

Using functions
What this example intends to explain
We will define two MachiningRules: Drill_chamfered_STEP1POCKET for drilling a step1pocket with a chamfer starting from a centerpoint, and Spot_drill for drilling the centerpoint. In addition to the previous examples, you learn to use some functions available in the Machining Knowledge Editor.

96

Machining Knowledge Editor Training

Using functions

Explanatory picture

We first will define a new MachiningRule Drill_chamfered_STEP1POCK. This rule can be started as copy from the existing Drill_STEP1POCK_Direct. The main changes will be in the less worked feature, which will be changed to a POCKET_ROUND_TAPERED and we will give the rule a higher priority.

Conditions
Starting with a copy of Drill_STEP1POCK_Direct, only a few conditions need to be changed, these are:

Application Criteria
We need to add 2 additional conditions to check for the existance of a top chamfer:
mwf.DEPTH_TOP_CHAMFER > 0 $$ There is no top chamfer defined. mwf.ANGLE_TOP_CHAMFER > 0 $$ Feature has no top chamfer angle.

Tool Attributes
No changes in the copied MachiningRule.

Machining Knowledge Editor Training

97

Using functions

Less Worked Feature attributes


We need to define the shape of the pocket_round_tapered. This shape depends on the top chamfer parameters and can be described with:
lwf.DIAMETER_1 = mwf.DIAMETER_1 + 2*mwf.DEPTH_TOP_CHAMFER*TAN(mwf.ANGLE_TOP_CHAMFER) lwf.DIAMETER_2 = 0 lwf.DEPTH=lwf.DIAMETER_1/2 * TAN(mwf.ANGLE_TOP_CHAMFER)

Operation Attributes
No changes.

Constants
No changes.

Materials and Machines


Valid for all.

Explanation
Please enter a text in your own words.

Activity: Create MachiningRule for drilling a chamfered hole


Drag Drill_STEP1POCK_Direct on TrainingRules. This will create a copy. Rename the copy to Drill_Chamfered_STEP1POCK. Change the Less Worked Feature to POCKET_ROUND_TAPERED. Set the priority to 4 Work on all Tabs, starting with Conditions, and enter the expressions provided above.

98

Machining Knowledge Editor Training

Using functions

Explanatory picture

Next we define a new MachiningRule SpotDrill for drilling the POCKET_ROUND_TAPERED. This requires a new MachiningRule with as more worked feature a POCKET_ROUND_TAPERED feature, a less worked feature BLANK, a tool SPOT_DRILL and an operation class SPOT_DRILLING.

Conditions
All conditions need to be defined since we are not copying an existing rule.

Application Criteria
We will not need any application criteria as the operation should be used whenever there is a POCKET_ROUND_TAPERED.

Tool Attributes
The tool should be large enough for the diameter and have the correct point angle. This is defined with: tool.Diameter > mwf.DIAMETER_1 tool.PointAngle = 2*ATAN(0.5*mwf.DIAMETER_1/mwf.DEPTH)

Less Worked Feature attributes


The less worked feature is the BLANK feature. We do not need to define any conditions.

Machining Knowledge Editor Training

99

Using TableView to query the MachiningRuleLibrary

Operation Attributes
No extra conditions, so we will use the template settings.

Constants
No constants needed.

Materials and Machines


Valid for all.

Explanation
Please enter a text in your own words.

Activity: Create MachiningRule for spot drilling Create a new Rule SpotDrill according to the description above. When finished, choose File > Save. Test the rules with Create Feature Process on the threaded pockets around the
large hole.

Using TableView to query the MachiningRuleLibrary


What this example intends to explain
We are able to search MachiningRules by filtering on the Rule Definition components.

Activity: Searching MachiningRules with MWF = STEP1HOLE Activate all Rules of your own Library with command Activate Children.

100

Machining Knowledge Editor Training

Using Find and Replace functions

Press TableView toolbar button Autofilter

Select STEP1HOLE from the drop down list.

Verify there are 3 MachiningRules with that output feature.

Using Find and Replace functions


Activity: Using Find in all Rule Conditions Deactivate all nodes using Deactivate All Press MB3 while the cursor is in the Conditions Tab of the first MachiningRule
of your Library.

Execute Find in all Rule Conditions... Enter something as search string, like DIAMETER_2 and press OK. Verify if the activated Rule(s) have a condition on DIAMETER_2. Activity: Using Find/Replace Replace REM by REMARK and find out that both compile OK.

Machining Knowledge Editor Training

101

Additional stuff

Additional stuff
What this example intends to explain
This exercise prepares us for knowledge acquisition that is part of each customization project and further elaborated in Machining Knowledge Customization Project on page 195. In case theres still time, create a set of Rules for machining a POCKET_RECTANGULAR_STRAIGHT feature. In general, defining a RuleLibrary requires:

identifying the feature types that should be covered defining possible operation sequences for each feature type defining the decision criteria to select between the sequences defining MachiningRules for each step in the sequence

This analysis always starts by questioning the experts on common work practices. During the process, iterations are often necessary as common work practices contain decision criteria or sequences that are not always clearly and consistently defined (I always do it that way) and sometimes implicitly (Of course, you never use the same tool for roughing and finishing). This normally calls for additional criteria to get the right sequences. The task of the knowledge engineer is to identify possible problem areas and to ask for additional information in these areas. An example of the definition of a set of sequences can be the following (based on the feature type POCKET_RECTANGULAR_STRAIGHT):

Finishing is only necessary if one of the surfaces has a roughness < 6.3 Only the surfaces with a roughness < 6.3 should be finished. This finishing
requires a stock of 0.5 mm.

Bottom and side surfaces can only be finished together if the depth <= 5 mm If roughing requires more than two passes along the side surfaces, then roughing should be split in to two operations: one with the largest possible mill removing the bulk of the material, followed by a second operation removing the remaining material in the corners.

102

Machining Knowledge Editor Training

Additional stuff

Activity: Create a set of MachiningRules for POCKET_RECTANGULAR_STRAIGHT features (1) Based on the description in the previous section, identify how many MachiningRules are necessary.

Analyze if the data is complete What should a test product look like?
In this specification there are already lots of unspecified items where additional information is necessary, like:

What operation types should be used? Which tool classes should be used? Can the same tool be used for roughing and finishing? If not: what is the difference between a roughing tool and a finishing tool?

Are the specified limits general or specific for a certain material? When only a section of the feature is finished, what is the required distance to
the other surfaces that are not going to be finished in the operation?

When the operation is manufacturing the corners: can the tool diameter be equal
to the corner radius of the feature or should the tool diameter be smaller?

When does roughing require more than two passes? Activity: Create a set of MachiningRules for POCKET_RECTANGULAR_STRAIGHT features (2) Define the MachiningRules. Use OperationClass=CAVITY_MILL for roughing operations and OperationClass=FACE_MILLING_AREA for finishing operations. Use as Resources=END_MILL_NON_INDEXABLE.

Test the MachiningRules on a product covering all situations.

Machining Knowledge Editor Training

103

Additional stuff

104

Machining Knowledge Editor Training

CHAPTER 5

Machining Features from opposite directions

When both sides of a hole need chamfering


What this example intends to explain
Estimated 60 minutes. It can be necessary to machine a feature from opposite directions, for instance when chamfering both sides of a through hole. That requires an operation chamfering the top of the feature and an operation chamfering the bottom of the feature. These operations can come from opposite directions.

105

Machining Features from opposite directions

Creating a rule for the bottom chamfer


This section explains the definition of a MachiningRule which machines the bottom chamfer of a STEP1HOLE.

The MachiningRule has the following definition components (see screenshot below):

OutputFeatures: the complete original feature. In this example the hole with chamfers on both sides is recognized as a STEP1HOLE. InputFeatures: the same STEP1HOLE but without a bottom_chamfer. Resources: COUNTER_SINKING tool. Priority: If this rule should be tried first then the priority must be higher than other rules creating a STEP1HOLE. Operation Class: as in picture above. Name is free. However: do stick to your own naming convention scheme. Defining the conditions
The decision when to use this MachiningRule is at first sight simple: there has to be a bottom chamfer, otherwise it is not necessary to chamfer from the back side of the feature. This can be defined with the following Application Criteria conditions: mwf.DEPTH_BOTTOM_CHAMFER_1 > 0 $$ This feature does not have a chamfer on the back side.

106

When both sides of a hole need chamfering

mwf.ANGLE_BOTTOM_CHAMFER_1 > 0 $$ This feature does not have an angled bottom chamfer. The Less Worked Feature does not have a bottom chamfer because thats whats being machined by this rule. Not having a bottom chamfer is defined by: REM remove the bottom chamfer from the lwf top feature lwf.ANGLE_BOTTOM_CHAMFER_1 = 0 lwf.DEPTH_BOTTOM_CHAMFER_1 = 0 lwf.RADIUS_BOTTOM_CHAMFER_1 = 0 REM the tools diameter must be bigger than the hole diameter: tool.Diameter > mwf.DIAMETER_1 REM the machining direction is in the opposite direction of the feature: oper.Hole_Axis_IJK[1] = mwf.X_ORIENTATION_D oper.Hole_Axis_IJK[2] = mwf.Y_ORIENTATION_D oper.Hole_Axis_IJK[3] = mwf.Z_ORIENTATION_D In some cases (depending on MCS.Tool_Axis_Type) it is necessary to define the operation vector: oper.X_ORIENTATION_D = -mwf.X_ORIENTATION_D oper.Y_ORIENTATION_D = -mwf.Y_ORIENTATION_D oper.Z_ORIENTATION_D = -mwf.Z_ORIENTATION_D

Activity: Creating a MachiningRule for machining the back chamfer of a STEP1HOLE feature Create a MachiningRule with Rule definition components as described above. Use the conditions provided above File > Save when youre ready. Testing the rule
You can design your own model for testing this rule. A simple block with a thru hole that is chamfered on both ends will do. Create a manufacturing setup for this part and perform Find Features...

107

Machining Features from opposite directions

Create an MCS with Tool Axis = All Axes. In case the dialog on the MCS does not show the Tool Axis box, you must use mb3 Object > Customize... on the MCS object and add ToolAxis to the dialog. Alternatively you can create 2 MCSs with opposite directions with Tool Axis = +Z of MCS.

Activity: Test the Rule for chamfering a STEP1HOLE feature with back chamfer Define the necessary MCS objects for the test model, as below.

Run Create Feature Process... In the Location box, choose Geometry = Automatic.
The Automatic allocation to Geometry moves the operations under an MCS if they match the MCS direction. The MCSs are tried in a top-down order. Operations that cannot be moved under the first MCS are subsequently tried under the next MCS etc. Since we have a first MCS where Tool Axis = All Axes we can expect that all operations are allocated there.

Press OK
The result for a feature with top and bottom chamfers looks like this:

108

Drilling a deep hole from opposite directions

If we have 2 MCSs with opposite directions with Tool Axis = +Z of MCS, the result looks like this:

Drilling a deep hole from opposite directions


Deep holes can be too deep to be drilled from a single direction. Generally, the tools FluteLength must be larger than the hole depth. A solution can be to drill from two directions. This section elaborates on this use case. We will test on the value of a face attribute to decide whether or not we have to drill from both directions. If so, the hole feature is split up in two halves coming from opposite directions.

Adding a face attribute prior to Find Features...


You can manually add an attribute to a model face. This attribute and its value will be picked up by command Find Features... and will appear as a feature attribute.

Choose selection class Face

109

Machining Features from opposite directions

Click MB3 on a model face and choose Properties.

Enter the Title MACHINE_TWO_SIDED and Value YES fields as shown above
and press Apply or OK.

Execute command Find Features


and find back the face attribute as a feature attribute.

We introduced a feature attribute MACHINE_TWO_SIDED, type String, with value YES or NO. This attribute and its value were assigned to a model face prior to command Find Features... It can also be added automatically using a Knowledge Fusion function. See Automating 2-sided machining using KF functions on page 114. Another convenient way of adding attributes to model faces and features is by feature tagging. See the NX help and command finder with keyword tag.

Testing the value of a Feature Attribute


The value of the attribute (YES or NO) can be tested by a dummy rule which splits the feature when YES. When NO, the rule will be rejected and there will be no splitting.

110

Drilling a deep hole from opposite directions

Adding MACHINE_TWO_SIDED to the customization


When we want to test the attribute value in the MKE, of course the attribute must be available. This is accomplished by adding it to the customization. (MACHINE_TWO_SIDED is not a standard attribute of the features. However, you will see it in the ootb customization as an example.)

Activity: Adding an Attribute to the Customization With MyRules.xml loaded in the MKE, choose View > Customization Drill down to STEP1HOLE

In the attributes window, click MB3 and choose Add...

111

Machining Features from opposite directions

Enter the Name and press OK.

You see the custom attribute underlined and in a different color.

Note that the attribute will be


inherited by all children of the STEP1HOLE

Save MyRules.xml

With the attribute available, we can use it in a MachiningRule.

112

Drilling a deep hole from opposite directions

Creating a rule to split a feature


This MachiningRule definition view is depicted here.

The lwf features are both of type STEP1HOLE. In the conditions we need to have the following: REM Application Criteria is_defined(mwf.MACHINE_TWO_SIDED) $$ Attribute MACHINE_TWO_SIDED has no value or does not exist on the feature mwf.MACHINE_TWO_SIDED = "YES" $$ Attribute MACHINE_TWO_SIDED exists with value other than YES. REM Less Worked Feature Attributes A few notes apply:

Both STEP1HOLE features need to keep the same diameter as the original. The position of lwf_2 will be at the bottom and its orientation reversed. The depths will be half the original mwf depth. The top chamfer attributes of lwf_2 are the bottom_chamfer attributes of the mwf. another round of splitting.

Both lwf_1 and lwf_2 must get MACHINE_TWO_SIDED = "NO " to prevent

113

Machining Features from opposite directions

Activity: Creating a rule to split a STEP1HOLE Create Split_S1H_into_2S1H. Work out the LWF assignments as outlined above. When in doubt you can import the MachiningRule Split_S1H_into_2S1H
from the machining_knowledge.xml into your source file. (Use the Export/ Import functions)

Activity: Testing a rule to split a STEP1HOLE You can use the same steps as described in Test the Rule for chamfering a
STEP1HOLE feature with back chamfer on page 108 The result for a feature that is split looks like right picture. (With operations generated.)

Note that the dummy operation


Split_back_Chamfer_S1H is not a real operation and will therefore not appear in the Operation Navigator.

Using Knowledge Fusion for post create features


Automating 2-sided machining using KF functions
The following KF functions were added for this purpose in NX 6.0.3: ug_cam_askOrderedMcsNamesAndToolAxes() [ug_cam_func.dfa]

This function retrieves an ordered list of pairs of MCS names and tool axes.
The tool axis of an MCS is based on the tool axis parameter, if the tool axis

114

Using Knowledge Fusion for post create features

parameter is All axes or when the tool axis parameter is not available, like in MCSs of turning or wireEDM, the vector (0,0,0) is returned.

Sample input:

Sample output:
{ {MCS_ALL_AXES,Vector(0,0,0) }, {MCS_SETUP11, Vector(0,0,-1) }, {MCS_SETUP12, Vector(0,0,1)}, {MCS_SETUP2, Vector(0,1,0) }, {MCS_WEDM,Vector(0,0,0) }, {MCS_SPINDLE_TURN,Vector(0,0,0) } ug_fbm_postCreateFeaturesCustomFunction_MachineFeatures FromTwoSides() [ug_cam_samples.dfa]

This postCreateFeatures sample function demonstrates how you could decide if


a feature has to be machined from two sides. The function sets a MACHINE_TWO_SIDES attribute, which can be used in the Machining Knowledge to create a process accordingly.

115

Machining Features from opposite directions

Choose Tools > Knowledge Fusion > DFA Manager and select file
ug_cam_samples.dfa.

The sample function uses the KF function


ug_cam_askOrderedMcsNamesAndToolAxes ( see 1). This sample only uses the tool axes information and the ordered MCS names are only printed (see d).

Note Make sure that this function is renamed to


ug_fbm_postCreateFeaturesCustomFunction(), so it will be called upon the OK button of the Find Features... dialog. The sample code ug_fbm_postCreateFeaturesCustomFunction is found in file UGII\dfa\examples\manufacturing\ug_cam_samples.dfa. The logic of ug_cam_askMachineFromTwoSides is also defined in ug_cam_samples.dfa. It states that the attribute MACHINE_TWO_SIDED is set to YES when the feature has an alternative machining direction and an MCS with that alternative machining direction appears in the ordered list of MCSs before the main orientation. This is just a convention, so you must create the ordered MCSs with this behaviour in mind.
Defun: ug_cam_askMachineFromTwoSides( Any $feature, List $tool_axes ) @{ # Context information $feat_name << ug_fbm_askFeatureName( $feature ); # Get the list of accessible feature vectors $feat_normals << ug_cam_askAccessibleVectorsOfNcFeature( $feature ); # This example only supports two alternative feature directions, default is no split $do_split << if length( $feat_normals ) = 2 then @{ $major_dir << First( $feat_normals ); $alt_dir << Last( $feat_normals ); printValue( $feat_name + "> Major direction - " + ug_vectorToString( $major_dir ) ); printValue( $feat_name + "> Alternative direction - " + ug_vectorToString( $alt_dir ) );

116

Using Knowledge Fusion for post create features

# First check if the alternative feature direction is available, if not do not split if member( $alt_dir, $tool_axes ) & member( $major_dir, $tool_axes ) then @{ $major_index << Position( $major_dir, $tool_axes ); $alt_index << Position( $alt_dir, $tool_axes ); # Check if the alternative feature direction is before the major feature direction, # if so split the feature otherwise do not split the feature if ( $alt_index < $major_index ) then true else false; } else false; } else false; # Function result printValue( $feat_name + "> Split feature = " + StringValue( $do_split ) ); $do_split; } Boolean;

117

Machining Features from opposite directions

Post_feature_recognition functions from the current online help:

Checking for tool availability


Another, perhaps more tricky, use of the DummyOperation type is when it can help us to decide if we can machine a very deep thru hole from both sides. When the hole is very deep we can split it up in 2 holes. This only makes sense when we know there is a tool long enough to machine at least half the depth. If no such tool exists we do not need to split up, since we will not find a good solution anyway.

118

Summarizing three different ways to machine from opposite directions

For this purpose we can create a DummyOperation with a tool. When there is a drill with a diameter equal to the feature diameter and a length greater than half the feature depth, the rule will set lwf.machine_two_sided to YES. So, the actual splitting of the mwf into 2 lwfs is not done by this rule, it merely sets the lwf attribute which means I can be split up in two.

Summarizing three different ways to machine from opposite directions


We have practised three strategies when machining holes in opposite directions:
1. 2.

Use oper.Hole_Axis_IJK[1,2,3] with one MCS with Tool Axis = All Axes. Alternatively set oper.XYZ_ORIENTATION_D = mwf.XYZ_ORIENTATION_D etc. if you use different MCSs for each direction with Tool Axis = +Z of MCS.

119

Machining Features from opposite directions

3.

Split a feature in two with different MCSs for each direction.

120

CHAPTER 6

External Functions using TCL

External Function declaration in the Machining Knowledge Editor


We can define our own functions and use them in expressions in the MachiningRule conditions and Add-ons. A few example functions are supplied with the installation in a folder called "System Functions". (They come with the customization_base.xml)

GetEnv is one of them. It does what it says: get the (string type) value of an environment variable.

121

External Functions using TCL

Here's how you would define a function yourself. In this example we will glue a string after a real number, just like the new + operator introduced in NX 8.0.1. The TCL function concat is used for that.

Use the MB3 New command to create a new FunctionLibrary, like MyFunctions.

Note Don't add your own functions to the "System Functions" library to avoid
future conflicts with additional OOTB functions.

In the FunctionLibrary, use the MB3 New command to create a new Function
and change the name to concatNumberString.

Right click node concatNumberString and choose MB3 Attributes to select


Type = "String" from the drop-down list and close the Attributes window again.

Use the MB3 New command to create 2 new FunctionParameters; They will
hold the names and types of the input parameters:

122

External Function declaration in the Machining Knowledge Editor

Rename the FunctionParameter nodes.

You can freely choose the parameter names, like R1 and Str1.

Right click the node Str1 and choose MB3 Attributes select Type = "String"
from the drop-down list.

Right click the node R1 and choose MB3 Attributes select Type = "Double"
from the drop-down list Press A in the attributes window to see All attributes.

Now you see the comment field, which can be used to enter a description of what the function does.

This completes the declaration of the example function. Upon pressing F8 in the Conditions area of a machining rule you now can select the function concatNumberString just like any other function.

When hovering the mouse over the function you see its output type and the number and type of the input parameter(s). Also the comment field value is displayed. Next we will define the function body in the TCL language.

123

External Functions using TCL

External Function TCL body definition


Select the Function to activate the TCL editor. Here's where you write the function body, in this case the code to concatenate the two input parameters:
set mke_string_result [concat [format "%10.2f" $mke_R1] $mke_Str1]

The following remarks apply:

Mandatory name must be used for the output parameter. Can be one and only
one of three: [mke_string_result, mke_integer_result, mke_double_result].

Mandatory prefix mke_ for the input parameters. The TCL Proc header and the input parameter declaration are automatically
generated. Only the TCL function body needs to be defined. This concludes the definition of the example function.

MOM__boot {} and MOM__halt {}


MOM__boot {} is called always when TCL initializes during the Create Feature Process command. You can gain performance when initializations are done here only once, instead of repetitive in the tcl function body. A typical example is to open an external database once in MOM__boot {}.

Note There is no interference between this MOM_boot{} and the post processor's.
The body of MOM_boot {} is in the TCL language and can be inserted in attribute FunctionLibrary.Initialize. You must do this through editing directly in the attributes window of the User Functions.

Note Do not edit the System Functions library since it will be updated in future
release. Instead, create your own Function Library, like the Sample Functions.

Note You can use Cntrl+Enter to add multiple lines of text.


MOM_halt {} is always called when TCL closes after the Create Feature Process command. Typically this can be used to close the connection to an external application.

124

External Function TCL body definition

The body of MOM__halt {} is in the TCL language and can be inserted in FunctionLibrary.Close. You must do this through editing directly in the attributes window of the Functions Library.

Note Do not edit the System Functions library since it will be updated in future
release. Instead, create your own Function Library. During execution of NX command Create Feature Process..., MOM__boot {} will be generated and output to a temporary file with the same name as the machining knowledge source file, with extension tcl.

125

External Functions using TCL

Screenshot above gives an example of a boot sequence for TCL which initializes the TCOM interface. This file is written to the %Temp% directory. Please note that the this file will be overwritten by each subsequent Create Feature Process... command. Users should only edit their TCL code using the MKE. Do not attempt to change the temporary TCL file.

TCL code
During execution of NX command Create Feature Process..., all TCL functions that are used in rule conditions will be generated and appended to a previously mentioned temporary file with the same name as the machining knowledge source file, with extension tcl. So if your source file is machining_knowledge_short.xml then the generated code of the TCL functions is found in machining_knowledge_short.tcl.

Screenshot above shows the TCL code of the (system) function GetEnv.

126

Testing external function calls

Testing external function calls


Using TCL functions in the MachiningRule condition
In the below example we make an application condition saying that the value of environment variable "Place" must be "Berlin". (Otherwise the rule will be rejected.)

Save the knowledge source file used by the Create Feature Process command.

Feedback on TCL function calls and result


Debug output can be found in the file TmaRecMethod.log on the %temp% directory and gives feedback on the TCL functions that were executed.

In this example we are informed that the input parameter EnvName has value "Place". The output (result) of the function GetEnv is the string with value "Berlin". Therefore the condition will evaluate to TRUE and the rule is used (assuming that all other conditions are also TRUE).

127

External Functions using TCL

More TCL System Functions

Next to GetEnv there are other simple functions implemented in TCL. Their TCL body is a single line of code using internal function AskAttributeValue. The first input parameter for AskAttributeValue is a keyword with value PART_ATTRIBUTE or EXPRESSION or PROGRAM_ROOT. This keyword directs the function to the correct hierarchy in the NX environment. The second input parameter is the name of the attribute or expression we wish to interrogate.

GetPartAttribValue
GetPartAttribValue returns the (string) value of an NX part attribute.

GetExprValue
GetExprValue returns the (string) value of a named expression.

GetProgRootAttribValue
GetProgRootAttribValue returns the (string) value of an attribute in the NC_PROGRAM view.

You can inspect the TCL body of the function in the TCL viewer by selecting the function node. These functions always return a string, also when the requested value is itself an integer or real value. This avoids having to implement 3 duplicate

128

Calling an external application

functions for integer, real and string. Please use functions ToReal or ToInteger to do the conversion when required by your application.

Calling an external application


Example interface to Microsoft Excel from TCL
The ootb machining knowledge has one example of how to connect to Microsoft Excel. Rule Drill_in_center_S1H explanation text explains how. This text is repeated here:
1. In the Conditions tab, clear the REM in front of the line that says oper.Maximum_Depth_Distance = mwf.DEPTH + AskExcelValue("DRILL","GOTHROUGH") REMark the other expression oper.Maximum_Depth_Distance. Otherwise this rule will be rejected when the assignments conflict. 2. The TCOM tcl package which provides a COM interface to Excel is expected to reside on UGII_BASE_DIR/kits/auxiliary. Search the internet or http:// wiki.tcl.tk or ask machining.support.plm@siemens.com 3. On your UGII_CAM_MACHINING_KNOWLEDGE_DIR the TCL script expects the following two files:

1.mke_test.xlsx with a worksheet named OPER; See Image tab of this rule for details. 2. excel_tcl_dll.tcl with content as specified in function AskExcelValue. It must be copied from AskExcelValue body.

129

External Functions using TCL

If all works fine then this operation gets a calculated depth which is the sum of the feature depth and the value '3' from Excel sheet.

Limitations
1.External customer functions can NOT be used in the mapping rule Library (although the functions are shown when you use F8 in the conditions window). 2.Cannot use customer functions on parameters that are not fixed value as in example below:

You will see this message in the TmaRecMethod.log when this happens:

130

Limitations

Script GetRealValue: set real p1: input must be a fixed value (ranges are not supported)

131

External Functions using TCL

132

CHAPTER 7

MKEditor Exercises: Turning

MKEditor Exercises: Turning

Feature Based Turning


This chapter shows the capabilities of NX in Feature Based Turning. You can now create Feature Based Machining processes for Turning. The workflow is identical to feature based milling and drilling. The standard Feature Based Machining installation includes an initial set of predefined Turning features that are recognized, and the Manufacturing Rules for these features. The set of predefined Turning features includes:

TURNING_GROOVE_ID TURNING_GROOVE_OD TURNING_GROOVE_FACE


We will use cam_sample_fbm_2_mm.prt which comes in the samples folder in MACH.

Feature Recognition Load cam_sample_fbm_2_mm.prt from mach\samples Start Manufacturing if necessary. Use Ctrl_Shift+K or the command icon
workpiece solid model visible. in the Tool Bar to make the

Click on the Machining Feature Navigator icon. In the MFN, right click in the background and choose

. The MFN comes up.

( hint: when you double click the icon, you can dock the MFN)

In dialog box Type, select Parametric Recognition. In dialog box Geometry to Search, select Workpiece or All Geometry.

134

Feature Based Turning

In dialog box Features to Recognize,


first deselect all by deselecting the top node, then select only Turning in the ParametricFeatures library.

Click the Find Features icon in the lower right corner of the dialogue.

The Recognized Features shows 6 features ( 2 of each type that is currently recognized automatically) ..

Click OK to accept the result. In addition to the turning features, you will find a STEP1HOLE that was
already recognized before.

Browse through the new TURNING features one by one. When you select a Feature in the MFN, its faces are highlighted in the selection color. Note: the TURNING_GROOVE_ID faces are inside the model.

135

MKEditor Exercises: Turning

Operation Selection Hide the model geometry by pressing Ctrl + B and select the body, or use the
Show/Hide command icon in the Tool Bar.

Press Ctrl + Alt + T for an orthogonal view on the Workplane. In the Machining Feature Navigator, select all Features, right click and execute In the Create Feature Process dialog, verify the Type field is set to Rule Based. In the Knowledge Libaries dialog box, select Turning and click OK.

In the location dialog box, choose turning_workpiece.

Press OK in the Create Feature Process dialog. NX will now automatically


select operations for the selected turning features.

Select the TURNING_GROOVE_FACE feature on the left side of the product.


This feature cannot be machined in the current setup.

Execute command Find Related Operations on this feature.

In the Operation Navigatir, switch to Program Order View and move the operation to the Unused Items folder.

Select the Program folder and execute command Generate Tool Path. Verify the Tool Path with 2D Material Removal switched on.

136

Feature Based Turning

Machining Knowledge Editor


This section lifts the curtain on how these automatic results came into existence, and where you could edit them if desired.

Start > Siemens NX 8.x > Manufacturing > Machining Knowledge Editor File > Open. Select machining_knowledge.xml and press Open. Click on the Machining Knowledge Tab Expand Turning library and select rule Rough_Groove_OD.

Click on the tab Add-ons. Select the add-on of type GeometryParent and class CONTAINMENT.

On the right hand side you see the definition of the axial and radial containment, which can be expressed using the parameters of the TURNING_GROOVE_OD feature.

137

MKEditor Exercises: Turning

This specifies the axial and radial containment limits for the turning operation:

Click on the Conditions tab to inspect the conditions that were defined for Rule
Rough_Groove_OD.

Note that the Non Cutting Moves (NCM) for the turning operation are attributes of the GROOVE_OD operation type.

Choose View > Customization in the menu bar. Expand the customization tree until TurningRough like this:

138

Feature Based Turning

The right-hand side of the customization view displays all attributes for the
TurningRough operations which include GROOVE_OD. Click once on the Display Name column header to sort alphabetically on Display Name.

This field is used to display the path in the OOTB NX user interface dialog for each operation Attribute. It helps the knowledge engineer in finding the NX operation Attribute when the place in NX user interface is known and vice versa.

Close the customization view by clicking the Exit the Machining Knowledge Editor.

Activity: Create a turning rule for a Surface Planar Round In NX, recognize surface_planar_round in
cam_sample_fbm_2_mm.prt. Keep the ones to the right, delete the other two.

create a turning rule in the MKE with the definition components as depicted below:

139

MKEditor Exercises: Turning

The rule needs a geometry parent of class containment. Add this to the rule:

Key in the expression for the containment following the exammple. Save the knowledge and test on the surface_planar_round feature in NX. Verify the Cut Regions defined by the trim planes:

140

CHAPTER 8

Wire EDM

141

Wire EDM

Recognition of WEDM Features


WEDM feature types that are in the OOTB recognition library are listed below:

The recognition rules for these features are identical to those without the WEDM_ prefix. Only the rule priority is lower. Consequently, when for instance both WEDM_RECTANGULAR_STRAIGHT and HOLE_RECTANGULAR_STRAIGHT are selected in the Find Features... dialogue, the latter will be recognized, if found in the geometry. Therefore, if you want to recognize a WEDM feature, make sure you deselect the others.

142

Recognition of WEDM Features

The (only) reason for having special feature types for WEDM is the additional attributes for the start hole as shown below.

The start hole attributes are automatically extracted if a curve with an attribute PDW_WIRE exists in a sketch within the contour of the wedm feature.

PDW feature creation


You need a curve in a sketch with an attribute PDW_WIRE. The attribute type is Real. The value of PDW_WIRE is the diameter of the start hole. The curves position will be used as the start hole position for the wedm operation.

The feature can also be created using the Mold Wizard/PDW wizards. Look in command finder for command Start Hole in NX for instructions.

143

Wire EDM

It is currently not a supported workflow to define the PDW_WIRE as the InputFeature of a WEDM operation. It is also not supported to define a STEP1HOLE as the InputFeature. We would need DRILL_GEOM for that which is not yet available as fbm geometry parent.

PDW feature identification


PDW_WIRE is a feature type that can be

found with command Find Features... in NX. The recognition mode must be Feature Identification. PDW_WIRE will appear in the list only when such a feature is created as described in the previous paragraph.

Defining rules for WEDM features in the MKE


MachiningRules for WEDM features are defined in the same way as for hole making and milling and turning. There is no difference in concept. A few notes apply:

Rule Add-on
Rules for WEDM need an Add-on of type Geometry Parent and class WEDM_GEOM. Please inspect the OOTB rules for examples. The start point for the operation as well as a number of other important parameters get their values on the Add-on. See screenshot below for details.

144

Defining rules for WEDM features in the MKE

The Start Hole position is relative to the feature position.

WEDM resource (tool)


Always choose resource WEDM_WIRE as a resource(tool.)

WEDM operation types


Operation types are read from the operation template part files. These include INTERNAL_TRIM and NOCORE.

Exercise: Create a Wire EDM Rule


See Create a Machining Rule for a Color and Attribute Feature on page 172 where we defined a cavity milling operation on a feature class magenta. In this exercise, we will create an alternative rule to produce the feature using Electrical Discharge Machining.

In MyRules.xml, create a MachiningRuleLibrary for WEDM rules Create or copy the rule where mwf = magenta. The rule definition components are.

145

Wire EDM

Create a Rule Add-on GeometryParent of class WEDM_GEOM with conditions


like this: REM the magenta feature has no start position parameters gp.Start_Status ="Specify" gp.Smart_Start_Point[1] = 0 gp.Smart_Start_Point[2] = 0 gp.Smart_Start_Point[3] = 0 gp.Backburn_Distance = 10 gp.Corner_Control_Fillet_Delta_Radius = 1 gp.Corner_Control_Max_Included_Angle = 90 gp.Corner_Control_Method ="Roll Around" gp.Lead_In_Angle = 45 gp.Lead_In_Method ="Angular"

Save the knowledge and test in NX on the cam_sample_fbm_3_inch.prt

146

CHAPTER 9

Feature Mapping

Feature Mapping is a powerful capability enabling us to transform features immediately after the NX command Find Features and before they appear in the Machining Feature Navigator. Feature Mapping is treated in this tutorial since mapping rules are created with the MKE, very similar to machining rules.

147

Feature Mapping

Using Feature Mapping -case 1


The route sketched on the right-hand side in the above scheme. Allows customers who use their private best machining practice to benefit from the improved parametric machining feature recognition since NX 6.

By mapping recognized features to customer specific UDF features. So existing automatic process selection can be applied to components that were
not designed using customer specific UDF features.

Using Feature Mapping -case 2


The route sketched on the left-hand side in the above scheme. Allows customers using UDF based design to work with NX 6 best machining practices even though these practices do not reference the UDF types.

By mapping customer UDF features to standard NX parametric features.

Example
The below picture illuminates how a SCREW_CLR_COUNTER_BORE_HOLE

(identified feature) can be mapped to a STEP2HOLE (parametric feature) and vice versa. Not only the type of the feature is changed by the Mapping Rule, also most of the parameter values can be deduced. Sometimes parameter values are identical so they can simply be copied.

148

Example

Mapping Rules are defined with the Machining Knowledge Editor (MKE) very similar to machining rules.

The Conditions of the mapping rule define how the parameters of the features map

on each other.

Note a mapping rule always has operation class DummyOperation and has no
Resource.

Note the mapping rule library does not need a build since it is directly interpreted
by NX.

149

Feature Mapping

Mapping to Hole or Pocket feature types?


The feature type SIMPLE_HOLE can usually be through or blind. There is not always an easy decision criterium when we want to map this feature to either a STEP1HOLE or a STEP1POCKET. The same applies to most other identified features types. In the ootb mapping rules we only map an identified feature to a through hole when we are sure the identified feature is through. The decision is made on the attribute DEPTH_LIMIT. The following conditions must be true:

When DEPTH_LIMIT does not exists or it has no value or its value is not one of the three mentioned above, there is a rule to map to a POCKET feature. The mapping rule to a pocket feature has a slightly lower priority.

Activity: Feature Identification not followed by feature mapping Load the testmodel.prt and delete all operations and features. Execute Find Features... on the testmodel

150

Mapping to Hole or Pocket feature types?

In the Type box, select Feature Identification. In Features to Identify, select the 3 check boxes as in screenshot above. Press the Find Features command icon. The resulting features in the MFN:

Note The source column of Identified features is CAD. Activity: Feature Identification followed by feature mapping Load the test_model.prt and delete all operations and features. Execute Find Features... on the testmodel. Switch On Map Features

Note you will see many more Feature


Types appear in the list. Next to the types that can be identified in the CAD model, also the target types to which these CAD features can be mapped are available. So, the types that are presented here depend on the available mapping rules. If for instance, there is a mapping rule from simple_hole to step1hole, then both types will appear in the list.If there is no such mapping rule, only the identified type simple_hole appears. Picture to the right shows the case where the ootb mapping rules are configured.

151

Feature Mapping

Creating a mapping rule


OperationClass class DummyOperation allows the definition of MachiningRules without a Tool. These can be used to transform a more worked feature into a less worked feature without a real machining operation. This mechanism is used by Feature Mapping. The Feature Mapping rules are created in a MappingRuleLibrary that is accessible in the tab redlined below.

In the following exercise you will create a mapping rule from simple_hole to step1hole. Estimated 30 minutes.

Conditions
REM Application Criteria: there are none in this example. REM Tool Attributes: there are none since mapping rules have no tool. REM Less Worked Feature attributes: just copy the attributes: lwf.DIAMETER_1 = mwf.DIAMETER lwf.DIAMETER_1_LOWER = constant.LWF_DIAM_LO lwf.DIAMETER_1_UPPER = constant.LWF_DIAM_UP lwf.DEPTH_LOWER = constant.LWF_DEPTH_LO

152

Identification or Recognition

lwf.DEPTH_UPPER = constant.LWF_DEPTH_UP lwf.SIDE_ROUGHNESS_1 = constant.achievable_Roughness_DRILL_Upper_str REM Operation Attributes: there are none.

Activity: Transformation of classes using a DummyOperation Create a MachiningRule with MWF SIMPLE_HOLE, LWF STEP1HOLE, OperationClass DummyOperation Enter the Conditions as presented under Conditions on page 152. Work on all Tabs and when finished save the xml source file. Execute Find Features and identify a feature SIMPLE_HOLE. Verify that the SIMPLE_HOLE is mapped to a STEP1HOLE.
With Feature Mapping you can do a lot of powerful things like:

Transform legacy feature types like SIMPLE_HOLE into STEP1HOLE. Transform STEP1HOLE into feature types like SIMPLE_HOLE. Interpret user-attributes for tolerance information and translate them into
explicit numerical tolerance values.

Identification or Recognition
Feature Identification Re-uses the design features Type and Attributes The model faces are retrieved from the design feature.
Strength:

Directly re-use information from the Design model No loss of information No need for recognition
Weakness:

153

Feature Mapping

Requires that Designers model with machining features only A machining feature must REMOVE material (a rib can not be machined) Works only for models designed in NX Does not work together with Synchronous Modeling Design features often dont really define correctly what needs to be machined.

Continue to use Feature Identification when:

You work predominantly with in-house designed parts and the parts have been modeled using UDFs and your company is not yet using PMI You work with MW and/or PDW

Feature Recognition Performs geometrical search against a library of known feature types to find
features and their faces

Performs attribute extraction per feature type. Recognition is not trivial and can not guarantee 100% perfect results, sometimes
due to feature intersections. The way to go when Feature Identification is not applicable.

154

CHAPTER 10

Feature Teaching

155

What is Feature Teaching ?

What is Feature Teaching ?


Feature Teaching functionality is intended for NX CAM administrators. Feature Teaching extends feature recognition beyond the limited set of feature types that is delivered out of the box. Using Feature Teaching, recognition rules for feature types can be generated by selecting faces in a part. The generated recognition rules can then be used to recognize features of that type. This will enable NX CAM administrators to easily extend the standard feature types with their own feature types.

When to teach a Feature Type


Generally you will consider to use Feature Teaching when there is a need for automation, that is:

When a specific geometric shape (a feature type) occurs frequently in your companys products and...

you can clearly define the sequence of operations to machine this feature type.
A feature type can be recognized by one or more recognition rules. All parametric feature types that come out of the box with your NX installation have at least one recognition rule. These rules cannot be changed by the user. What you can do is to create new (additional) features types and/or create new (additional) recognition rules. The possiblities are summarized in the table below.
New Recognition Rule New Feature Type Existing Feature Type Use case 1 Use case 2 Modify Recognition Rule Use case 3

Use case 1: Create a new feature type and a new recognition rule. Use case 2: Create a new recognition rule for an existing feature type Use case 3: Modify an existing recognition rule for existing feature type

156

Feature Teaching in NX 8.5

How to teach a Feature Type

How to teach a Feature Type


It is adviced to teach a feature type on a representative part rather than on the actual production part. On a representative part we can use PMI annotations for defining the feature attributes. On a production part, these annotations do not have to exist.

PMI Support in Feature Teaching


Feature-based machining uses dimension PMI annotations to define feature attributes such as length and depth and radius..

Add a tolerance to the dimension PMI to indicate that you want to recognize a toleranced parameter.

Since NX 8.5 the Teach Features command supports the following additional PMI dimension types which reference feature geometry:

An inferred length dimension between a plane and a straight edge. An angle dimension between a plane and a straight edge. A dimension to the centerline of a cylindrical face.

Feature Teaching in NX 8.5

157

How to teach a Feature Type

The Find Features... command now recognizes the length and angle dimension tolerances that correspond to the annotation PMI Also annotated PMI Surface Finish is used to define the MKE feature customization. The Title attribute is used to determine the feature attribute name

Use case 1: Create a new feature type and a new recognition rule
Please refer to the NX CAM technical documentation for details.

Use case 2: Create a new recognition rule for an existing feature type
Please refer to the NX CAM technical documentation for details.

158

Feature Teaching in NX 8.5

Starting Machining Knowledge Editor in admin mode

Use case 3: Modify an existing recognition rule for existing feature type
Please refer to the NX CAM technical documentation for details.

Defining the features position and orientation


Feature-based machining uses a datum CSYS to position and orient features. Feature teaching since NX 8.5 fully supports all CSYS subtypes which reference a point, an edge, or a face of the feature geometry.

Starting Machining Knowledge Editor in admin mode


You can modify the shortcut starting the MKE as depicted below.

This will unlock the possibility to show and edit the generated Feature Recognition Rules source code for the features that were taught. (Not for the standard features.)

Feature Teaching in NX 8.5

159

Starting Machining Knowledge Editor in admin mode

160

Feature Teaching in NX 8.5

CHAPTER 11

Operation Rule Teaching

161

What is Operation Rule Teaching ?

What is Operation Rule Teaching ?


A quick way to create Machining Rules for the MKE based on available operation instances in NX CAM.

When to teach an Operation Rule ?


When you want to automate (a sequence of) operations that work on a well defined piece of geometry that can be recognized as a Machining Feature. In other words: when you have one or more operations that machine a single feature and you want to preserve that piece of machining knowledge.

How to teach an Operation Rule.


In NX, select one or more operations in the NX Operation Navigator. Choose Object -> Teach Operations. The operations will be mapped to FBM machining rules in the selected RuleLibrary. You can inspect and modify the results with the MKE. Normally you will want to generalize the taught machining rules.

162

Operation Teaching

CHAPTER 12

Color and Attribute Features

163

Color and Attribute Features

Face color and attribute recognition


What is it? You can specify any combination of face colors and face attributes to specify regions of a solid body or sheet body for feature recognition. Face attributes may also include a value that can influence the recognition result. Why should I use it? You can use color and attribute recognition to help specify regions for machining that may be difficult to recognize by topology or shape. Where do I find it? Machining Knowledge Editor > Customization view. Below you find an example of

how a feature is declared, how to define a recognition rule and how to use these in NX Feature Based Machining. Exercise: Declaring a new "Color&Attribute" Feature Type
Start > Siemens NX 8.x > Manufacturing > Machining Knowledge Editor File > Open Select MyRules.xml or otherwise machining_knowledge.xml and press Open. Choose View > Customization Expand Features > CustomerFeature, right click and choose Add Class

164

Face color and attribute recognition

Note you can add a new class anywhere in the tree, CustomerFeature is just an
example.

In the Add Class dialog, enter Name = MAGENTA and press OK.

A feature of type MAGENTA is declared. You recognize that it's a customer


defined feature by the underlined type name and the dark blue color.

165

Color and Attribute Features

Right click in the attributes area (right part of the screen) and choose Add to
add an extra attribute to the feature class. Give it any name you like, and choose the rest of the fields as shown in this example:

Click OK when ready. Add another attribute names Height, choose type = double as shown below.

166

Face color and attribute recognition

Press the Save icon Dismiss the Customization view window by clicking the
corner of the screen. This concludes the declaration of a new feature type. in the upper right

Defining a Recognition Rule for the new Feature Type Click on the Feature Recognition Tab Create a new Library node by right clicking node Recognition and choose
New

Rename the new Library to "C&A Recognition Rule Library"

Create a new ColorAndAttributeRecognitionRule under the new library. Rename the ColorAndAttributeRecognitionRule* to MyMagentaFeature. (You
are free to choose any name.)

167

Color and Attribute Features

In the Definition Block, select the previously declared Feature class MAGENTA
from the drop down list.

In the Face grouping block, leave Face grouping at Connected faces. This
means that the faces of a recognized feature of type MAGENTA must be connected.

In the Surface types block, check Plane, Cone and Cylinder. This means that the
faces of a recognized feature of type MAGENTA must be of one of these Surface types.

168

Face color and attribute recognition

In the Edge types block, mark all connection types. This means that all connection types are allowed. (This is only meaningful when option 'Connected faces' was chosen previously, which we did.)

Create a condition that requires the feature's faces to be of color magenta..

This condition means that each face belonging to the feature must have display color = 181.

Note The value (=181 in this case) corresponds to an RGB value set and a color
name as defined in the Color Definition File used by the Part.

Right click in the header area or hit the Insert key to add a second condition.

169

Color and Attribute Features

State that MY_LOGICAL_ATTRIBUTE must be 'true' by selecting from the drop


down lists.

This condition means that each face belonging to the feature must have a Face Attribute named MY_LOGICAL_ATTRIB having value = "true".

Note If a face has no such attribute or it has but its value is not "true" then it will
not be in the recognized feature's face list.

Save the xml source file by pressing


This concludes the definition of the recognition recipe named MyMagenta for a feature of type MAGENTA.

Exercise: Recognizing MAGENTA


cam_sample_fbm_3_inch.prt is used here to recognize a feature of type MAGENTA.

Start NX Load cam_sample_fbm_3_inch.prt from MACH\samples\. Start Manufacturing if necessary. Open the feature navigator Right-click and choose Find Features In the Type box, choose Parametric Recognition In the Geometry to Search box, choose All Geometry In the Features to Recognize window, check MAGENTA Press Find Features icon. Press OK and select the recognized feature. Note that MY_LOGICAL_ATTRIB is one of the feature's attributes. Also note that one of the cavity's faces is not part of the feature: when you select the feature, this face is not highlighted in the selection color.

170

Face color and attribute recognition

Select this face, right click for the Properties and you see why: Change the value of MY_LOGICAL_ATTRIB to true. Delete feature MAGENTA_1. Right-click and choose Find Features Verify that the recognized feature has al faces of the cavity.

Face attribute value


We added an attribute HEIGHT to class MAGENTA. We must manually add this attribute to (one of) the faces of the feature in the part. Then the value will be picked up automatically.

Exercise: Adding a face attribute


Select one of the features faces, right click for the Properties Add attribute HEIGHT of type Real, unit Length and with value = 1. Press OK Inspect the features attribute values in the Details panel. You see that HEIGHT has been picked up.

Approve the feature using the right mb. Machining Direction of C&A Features
The direction of C&A features is chosen arbitrarily. In many cases this will result in a wrong direction. We can manually adjust the direction by supplying the correct values for the depth orientation vector, as done in screenshot below:

171

Color and Attribute Features

Machining Rules for a Color & Attribute feature


There is no difference between a parametrically recognized feature, an identified feature and a C&A feature when it comes to defining a Machining Rule. The source of the feature is irrelevant for the Operation Selection module. Therefore, creating a Machining Rule for feature type MAGENTA follows the same path as for any other feature.

Exercise: Create a Machining Rule for a Color and Attribute Feature Launch Machining Knowledge Editor if necessary and open the xml source file. Create a new Rule under the RuleLibrary Further specify the Rule as per this suggestion:

Choose a tool with a Diameter that is small enough to machine the corners:

Note we used a constant named mm here


with value = 1. This makes the condition valid for inch parts too.

Choose a tool with a FluteLength that is


long enough to machine the full depth of the feature. Make use of the manually added Height attribute here.

File > Save In NX, Create Feature Process... on feature magenta.

172

Machining Rules for a Color & Attribute feature

Verify the result,as below:

Cut Levels
Use of Cut levels in not limited to Color and Attribute features. Cut Levels can be defined as Rule Add-ons for certain operation types. The following notes appy:

The top of Range 1 is automatically determined based on the selected geometry. Range definition is always Measured From Top Level. The sequence of Add-ons of class ZLevelRange is not important. Exercise: Define Cut Levels Select rule Mill_Magenta and click the Add-ons tab. Create Add-ons of class ZlevelBase and ZLevelRange according to examples
below:

173

Color and Attribute Features

Save MyRules.xml In NX do Create Feature Process...and verify the results:

174

CHAPTER 13

Customization View

175

Customization view

Customization view
The customization defines which classes are available and which attributes can be used. Once a RuleLibrary is loaded, the customization can be viewed by selecting View > Customization from the main menu.

This opens the customization view consisting of a tree view on the left listing the classes. On the right hand side you find an attribute view listing all attributes of the selected class, and a relation which shows the relations of the selected class with other objects in the customization. In the relation view, for instance, we find that all operations under HoleMaking have a 1:1 relation with the Cycle object which you can find back under the NXObjects node. The tree views contains:

Features, Operations and Tools classes. For the Operation classes, field Container Type holds the name of the operation template where the class is defined.

Materials and Machines from the NX libraries.

176

Customization View

Customization view

The attributes view shows, for each attribute in the selected class:

Attribute: the name of the attribute as it is used in the MKE. Display Name: the path to the parameter in the NX Operation Dialogue. It helps
to find the purpose of the operation parameters. When you hoover the mouse over an Operation Parameter in a condition, the Type and the Display Name is shown. For instance see the Maximum_Depth_Distance attribute below:

Type: the type of the attribute Enum Type: the type of enumerated defining the allowed values of the attribute. Activity: Customization view Open the Customization view and explore the customization. Default Customization
In directory MACH\machining_knowledge_editor\data there is one single system file containing the base customization of the knowledge library.

customization_base.xml

Customization View

177

Customization view

This file should not be modified as it will be replaced during NX software updates. This file can be read into the MKE just like a machining knowledge source file. This file contains the customization that is not depending on your CAM configuration.

CAM Configuration dependent customization


The root file is the CAM configuration file in the UGII_CAM_CONFIG_DIR. An example is feature_machining.dat. The .dat file is changed compared to NX6, since the key FEATURE_MACHINING is obsoleted since NX 7.5.

MACHINING_KNOWLEDGE: points to the feature recognition rule source


that is used by the Find Features... command.

MACHINING_KNOWLEDGE: points to the machining knowledge source


used by the Create Feature Process.... command

MACHINING_KNOWLEDGE: points to the mapping knowledge source that is


optionally used by the Find Features... command. .

Tools, Machines,Part Materials, UDEs


More entries in the .dat file relevant for the customization are:

178

Customization View

Customization view

LIBRARY_TOOL (the tool library) LIBRARY_MACHINE (the machine library) LIBRARY_PART_MATERIAL (materials library) USER_DEFINED_EVENTS (ude.cdl)

Operation Types
The TEMPLATE_OPERATION entry defines which template parts will be available and hence which operation types. If an operation type is used in more than one of the template parts, then the definition in the last template part will be used, in order of appearance in the .opt file.

Features
When you generate or update the customization with the Machining Knowledge Editor, the feature customization is built up from the following parts:

The parametric feature types which can be recognized by command Find Features.

Any additional customer defined feature for which a recognition rule exists in
the Recognition Rule Library.

The UDF library (User Defined Features). Feature_definitions.def for legacy feature recognition. Feature_identification.def. Additional Customization
Your company's specific additions can be added interactively. Typical additions to the customization are:

New customer specific feature types and their attributes.

Customization View

179

Customization view

On each node in the Features branch in the Customization View you can can click MB3 and use commands to Add, Remove and Edit a feature class.

New attributes to feature types.


For each node in the Feature branch you can can click MB3 in the attributes list and use commands to Add, Remove and Edit attributes of the selected feature class.

NX Version upgrades
With each NX version, improvements and extensions to customization_base.xml can be expected. The knowledge library customization can be updated by checking active the Update Upon Load in the View > Options. Then reload the machining_knowledge xml source.

Activity: Understanding the customization files Trace back the files mentioned in feature_machining.dat in the
UGII_CAM_CONFIG_DIR. Open them in NotePad and read their contents.

In the customization view of Machining Knowledge Editor, try to understand the


customization of the tools, materials and machines in relation to the data listed in the files.

Set as Cutter Diameter, Set as Cutter Length


These are commands available on the tool parameters of the customization. These have to be issued only once after a new xml source file is created, or when additional tool classed are added. Since NX 8.5 inheritance via the hierarchy is in place.

180

Customization View

Customization view

These commands are only enabled for Single Double fields. The commands on an empty field (row) or on the header will remove the value
from this class. If a value is defined on the base class then that will be used.

Customization View

181

Customization view

182

Customization View

CHAPTER 14

TCIN for FBM

Machining Knowledge Editor Training

183

Configuration

With the Machining Knowledge Editor in managed mode we have the xml source file stored in Teamcenter. The only thing we notice when working in managed mode is the different User Interface when we Load or Save the xml source file. You will see a Teamcenter dialogue instead of the usual Windows Explorer. Normally you will only work in managed mode when also NX is used in managed mode. To startup NX in TCIN mode, change the shortcut in your startmenu to something like this (with username/password = user1/user1): C:\Program Files\UGS\NX 8.5\UGII\ugraf.exe" -pim=yes u=user1 -p=user1 Please refer to the NX documentation for additional configuration requirements.

Teamcenter Integration for NX Compatibility


NX6.0.3 -- TC2005SR1 MP8, TC2007.1.7, TC8 NX7.0 -- TC2007.1.7, TC8 NX7.5 -- TC2007.1.x (x > 7), TC 8.1 NX8 -- TC 8.3 (earlier TC versions will be blocked)

Configuration
Both NX and the MKE make use of the same configuration file referenced by environment variable UGII_CAM_CONFIG. The defaults for full native mode are in cam_general.dat. For full TCIN mode this is cam_part_planner_mrl.dat.

184

MKE Training- Teamcenter Integration

Configuration

How to configure the Machining Knowledge Editor when working with TCIN is described in the NX Documentation under Manufacturing > Feature-based Machining and then follow the path as depicted below.

Mixed mode configurations


If you have Teamcenter installed, we recommend using Teamcenter for all components of your configuration. However, Feature Based Machining supports a mixed configuration if your site requires it. You can also use Feature Based Machining when working native and retrieve the cutting tools from the Manufacturing Resource Library (MRL) in Teamcenter. Table below includes the values for the different components of the configuration for TCIN and Native mode. It is a combination of the entries in cam_general.dat (full native) and cam_part_planner_mrl.dat (full TCIN).

Native as in cam_general.dat
TEMPLATE_ OPERATION MACHINING_ KNOWLEDGE
${UGII_CAM_TEMPLATE_SET_DIR} cam_general.opt ${UGII_CAM_MACHINING_ KNOWLEDGE_DIR} machining_knowledge.dat

TCIN
${UGII_CAM_TEMPLATE_SET_DIR} cam_teamcenter_general.opt

as in cam_part_planner_library.d

${UGII_CAM_MACHINING_KNOWLEDG DIR}machining_knowledge_part_planner.dat

MKE Training - Teamcenter Integration

185

Configuration

LIBRARY_ TOOL LIBRARY_ MACHINE LIBRARY_ PART_ MATERIAL

${UGII_CAM_LIBRARY_TOOL_ASC II_DIR}dbc_tool_ascii.def ${UGII_CAM_LIBRARY_MACHINE_ ASCII_DIR} dbc_machine_ascii.def part_materials.def

${UGII_CAM_LIBRARY_TOOL_ INCLASS_DIR}dbc_mrl_tooling_library_tlas_en .def ${UGII_CAM_LIBRARY_MACHINE_ INCLASS_DIR}dbc_inclass_mach.def part_materials.def

With command Load/Save Local in the Machining Knowledge Editor all combinations in the above table are possible. The only remaining limitations as of NX 6.0.3 are:

In Teamcenter Integration your Parts are always managed by Teamcenter. Part materials are always in native NX.
As of NX 8.5 we have a new configuration possibility:

You can work in native mode and retrieve only you cutting tools from the MRL
when using cam configuration cam_native_rm_library.dat.

Commands Load Local... and Save Local... in managed mode


Use the command Load Local to open the machining knowledge source and select the Teamcenter Integration file machining_knowledge_tc.xml or the native NX file machining_knowledge.xml from the file system. Use the command Save as Local to save the machining knowledge source to the file system.

186

MKE Training- Teamcenter Integration

Configuring the Teamcenter data

Configuring the Teamcenter data


The FBM OOTB content kit:
machining_knowledge.xml with machining knowledge rules using the standard native tools (tools defined in dbc_tool_ascii.def). machining_knowledge_tc.xml with a subset of the above machining knowledge rules, adapted to use the MRL tools. Given the limited population of the MRL today, only MachiningRules using one of the following classes are included:

Twist Drill End Mills Face Mills


Note: The native version of the FBM OOTB content kit is created based on full Native mode. It will not be readily usable in mixed modes. To make the machining rules usable in a mixed mode you must update the customization after you have configured the mixed mode configuration. This is done by choosing Open and Update... when loading the xml source file in the MKE. Once the Update is done, there is a new Customization in place and the existing rules need to be adapted. For instance: tool classes or tool attributes may have changed, been added or been deleted. The MRL OOTB content includes a number of sample MachineTools. The MKE

customization uses the Description (CD) attribute of the machine to classify the MachineTools. In order to see a Machine Tool in the MKE customization, you must, in Teamcenter Classification, enter a class name (of choice) in the Description field. Then Open and Update... or File > New... in the MKE.

MKE Training - Teamcenter Integration

187

Configuring the Teamcenter data

Machining Knowledge structure in Teamcenter


Below is a screenshot of the expected structure in the Teamcenter database.

If Item machining_knowledge is not present you can either create it manually or use the MKE like this:
1. 2. 3. 4. 5. 6.

Start Machining Knowledge Editor Choose View > Options. "Use Teamcenter Integration" must be marked and 2tier or 4-tier parameters must be supplied, see useful links above for details. Restart Machining Knowledge Editor if you had to change the View options in previous step (2). Choose File > Open and Update... Press Load Local Select machining_knowledge_tc.xml (from directory mach/resource/ machining_knowledge).

7. Choose configuration file cam_part_planner_mrl.dat Press OK to update the customization. 8. 9.

Choose File > Save As Enter machining_knowledge in the Number field and press OK.

188

MKE Training- Teamcenter Integration

Configuring the Teamcenter data

This will create a new Item, Item Revision and Data set as depicted in screenshot below.

10.

Choose Named References on machining_knowledge-A and you see this:

MKE Training - Teamcenter Integration

189

Managing templates from multiple NX versions in one TC database

Managing templates from multiple NX versions in one TC database


MKE customization
The operation customization is agnostic about the NX version. Only the operation templates name is referred to and stored in the xml source. When a new operation is created by FBM based on a MachiningRule, it is based on a template operation in a template part. NX in TCIN mode has a mechanism to use the template of the active NX version. This makes it possible to have multiple versions of the operation template co-exist in Teamcenter.

Teamcenter Preferences
In NX, File > New uses PAX files pointing to Setup templates. PAX files also include a section with TypeTemplates (these are Operation templates, not Setup templates.) When multiple versions of the operation template co-exist in Teamcenter, the version is indicated by a postfixed number. NX will use the template which belongs to its version if the template is named in a PAX file that is referred to by a special Teamcenter Preference. There is one Teamcenter preference for each NX release, e.g. TC_NX_FileNewPAXFiles_NX85 for NX8.5.x release etc. These preferences will not be shipped with Teamcenter, but the Teamcenter administrator has to create them. The preference value is an array of strings of PAX file item_id or item_id<separator>revision_id. If the preference is set, the PAX files are retrieved from Teamcenter at the start of the NX session using the preference Values. The Preferences in Teamcenter are accessed via Edit > Options... and the Index tab.

190

MKE Training- Teamcenter Integration

Managing templates from multiple NX versions in one TC database

If the preference is not set, the PAX files in native NX will be used.

The value of the preference is an Item which has a Dataset attached. This dataset contains the PAX file.

MKE Training - Teamcenter Integration

191

Managing templates from multiple NX versions in one TC database

If the Teamcenter Preference is set and we Open and Update... in the MKE or we create a new source with File > New... in the MKE, then the TypeTemplates from the PAX file are NOT used to update / create the customization. MKE does not work in master model mode and will not use the PAX file. Instead it uses the .opt file which lists the template parts. To ensure that the MKE customization uses the correct version of the template parts in Teamcenter, you must modify the template set file in your native file system and add the NX version post-fix. See the screenshot of a modified cam_teamcenter_general.opt.

192

MKE Training- Teamcenter Integration

Managing templates from multiple NX versions in one TC database

CAM template import


A Manufacturing script tcin_cam_template_setup.bat is provided to import CAM templates into Teamcenter from NX. This script will import the CAM templates stored in the NX installation:

%UGII_BASE_DIR%\MACH\resource\template_part\english\ %UGII_BASE_DIR%\MACH\resource\template_part\metric\
The item_id of an imported template will be the name of the template suffixed with _inch_NX? or _metric_NX?, where ? is the release version of the NX. For example, the metric template MillTurn_Express.prt in NX6 will be imported into Teamcenter with item_id equal to MillTurn_Express_metric_NX6. The script tcin_cam_template_setup.bat is located in folder %UGII_BASE_DIR%\UGII\ templates\sample\. The script can be executed as follows on a cmd prompt: %UGII_BASE_DIR%\UGII\templates\sample\ tcin_cam_template_setup u=<username> -p=<password>

MKE Training - Teamcenter Integration

193

Managing templates from multiple NX versions in one TC database

194

MKE Training- Teamcenter Integration

CHAPTER 15

Machining Knowledge Customization Project

This chapter describes the OOTB content, the tasks commonly found in a customization project and the milestones to be reached. In the context of this tutorial, the term Customization is used to describe a universe of

machining features operation types tools workpiece materials machine tools

Since NX 7.5 this is extended with

NX Objects such as CutLevels, Cycles, UDEs and more.

Machining Knowledge Editor Training

195

OOTB content

OOTB content
The ootb rule content is shipped with each major release of NX. It is continuously improved based on feedback from the field. Please visit the FBM site and pull the latest Content Kit from there: https://myc2005.ugs.com/marketing/partmfg/nxfbm/default.aspx The ootb rule content is captured in the following source file:

MACH\resource\machining_knowledge\machining_knowledge.xml
You can easily view the ootb rule content outside the Machining Knowledge Editor application with:

machining_knowledge.chm
The ootb rule content is based on this template part (only the unit system is different):

MACH\resource\template_part\metric\machining_knowledge.prt MACH\resource\template_part\english\machining_knowledge.prt

An explanation of the OOTB Rules


What do all these achievable... constants mean?
The majority of the constants we use are threshold values for the quality that can be obtained with a Drill, Mill, Reamer or Boring bar. The two qualities checked in the rules conditions are derived from the PMI and are the surface roughness and the dimensional tolerance. For Drill, Mill, Reamer or Boring bar there are _upper and _lower threshold values of achievable surface roughness and achievable dimensional quality. That gives 4 x (2 plus 2) = 16 constants. You see them in the screenshot below that

196

MKE Training- Customization Project

An explanation of the OOTB Rules

was taken from the Machining Knowledge Editor. The names of these constants are always something like Achievable....

Roughing operations like Drill can be applied when these 2 conditions are both true:
IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_DRILL_Lower roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_DRILL_Lower

Finishing operations like Ream and Bore can be applied when either the roughness or the diameter tolerance is in the achievable interval for reaming and boring.

MKE Training - Customization Project

197

An explanation of the OOTB Rules

The expressions have a form like this and are found in the conditions of all finishing rules in the library:
IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_REAM_Lower AND ( roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_REAM_Lower AND roughness_value(mwf.SIDE_ROUGHNESS_1) <= constant.Achievable_Roughness_REAM_Upper ) OR roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_REAM_Lower AND ( IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_REAM_Lower AND IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) <= constant.Achievable_IT_Class_REAM_Upper )

Note Since NX 6.0.3 the roughness condition and IT class condition are logically
OR. That implies that only one of them needs to be TRUE and the rule will be applied. It was a design choice not to restrict possible application of Rules too much. You may want to be more strict by changing the Roughness condition and the IT_class condition to be logically AND.

Exercise: Find conditions on the PMI in the rules. Select a rule, for instance Drill_Up_S1H Press the Conditions Tab Find the section as depicted here

Find the expressions on the achievable IT_class in this rule.


For Milling there is an extra threshold value for the achievable roughness. This defines the roughness value that requires finishing the surface. Clearly, a features IT-class (usually defined on its Diameter) and its lowest surface roughness value determine the tools that are required.

198

MKE Training- Customization Project

An explanation of the OOTB Rules

All this information can be captured into a single table from which we can derive the required tool, given a combination of IT-class and Surface Roughness. We made the assumption that Drilling is cheaper than Boring which is cheaper than Reaming. When in this table we read D,B,R the preferred solution is using a Drill, when that is not available, try a Boring bar and when that is not available look for a suitable Reamer.
TABLE 1. Operation

(Tool) selection in order of priority for combinations of IT grade and Surface Roughness
IT IT IT IT IT IT IT IT IT IT IT 5 6 7 8 9 10 11 12 13 14 16 R R R B R R B R R B R R B R R B R R D B R D B D D R D B R D B D D R D B R D B D D R D B R D B D D R D B R D B D D

Roughness Ra 0.4 m (16 in) 0.8 (32) or 1.6 (63) or 3.2 (125) 6.3 (250) or 12.5 (500) 25 (1000) 50(2000)

R R R

B R B R B R

B R B R B R

B R B R B R

B R B R B R

B R B R B R

Exercise: Understanding the tolerance threshold values Lookup the Achievable... constants in the Machining Knowledge Editor. What is the only tool that can machine a feature with a diameter tolerance =
IT5?

For which combinations of IT-class and surface roughness, all tools (Drill,
Bore, Ream) could be used?

Discussion of some other constants...


For a minimal explanation please see the Explanation field in the constants Options dialog. (Select the RuleLibrary node, press the Constants tab and double click the constant.)

MKE Training - Customization Project

199

Modify the OOTB or Start from Scratch?

Modify the OOTB or Start from Scratch?


When is modification of the out of the box content the better option:

You do not have User Defined Features or your UDFs can easily be mapped on
the standard parametric feature types.

You use the standard tool library that comes with NX or Teamcenter. Your processes are relatively simple and you are quite satisfied with the results
that are generated ootb. When is it better to start from scratch.

Your company has defined its own best practices or is planning to do so. You think your processes are very different from what is supplied ootb. You do not want to invest in understanding the ootb content.

Workflow in a customization project


Each customization project consists of the following phases.
TABLE 2. Activities

and Milestones in a FBM customization project.


Milestone Milestone: A list with all feature types Milestone: One or more reference models.

Activity Analyze your products for manufacturing features

Analyze your operation sequences

Milestone: List of Operation Sequences for all selected features. Milestone: A list with all tool types Milestone: Implemented Rule Library

Analyze your tool libraries Implement Knowledge Maintain knowledge

200

MKE Training- Customization Project

Analyze your products for manufacturing features

Analyze your products for manufacturing features


Although it is theoretically possible to automate the complete operation generation of feature based products, it is often too costly to do so. We advise to start with the features most common within the typical product families. The first step is to analyze which are typical products in your organization. This normally results in product families where you can describe how often products will be programmed, how many of the operations are standard within the products, etc. In general one of those product families should be chosen for a first project phase. The next step will be to identify the common features within this product family. This should result in a list of common features with the percentage of occurrence within a product. This will normally result in a list of features where it also should be visible which feature types are the most common. In general the first project phase should include those feature types that cover 20% of the feature occurrences within the product family. In a typical second phase, this should be extended with those feature types which would extend this to 50% and in a third phase to 80%. The last step in selecting the feature types is to check on some of the typical products, how the software will recognize or identify these features. It is no use trying to focus on feature types that are not recognized properly.

What comes OOTB


When you generate the customization automatically, the software takes into account:

The parametric feature types which can be recognized by command Find Features.

The UDF library Feature_definition.def Feature_identification.def


The NX CAM help library includes a listing of the recognized parametric features. Browse to CAM > Feature-based machining > Manufacturing features > Parametric Feature Recognition. For your convenience we reproduce (and updated) that list in the appendix. See D: Definition of the standard non-STEPPED features on page 214.

MKE Training - Customization Project

201

Analyze your operation sequences

How to add features that are not standard.


See Feature Teaching on page 155.

Exercise: Creating a Manufacturing Rule for the new UDF Create a new rule with Output Feature = MY_UDF.

Playwise, enter conditions using the three UDF attributes as above.


Milestone: A list with all feature types. It is the complete list of features you can expect in your production models. This should include a percentage of occurrences within the typical products. Milestone: One or more reference models. The models have instances of the features types you can expect in your production models, including PMI. These models should be a mix of typical products and of specific test models designed to analyze problem areas.

Analyze your operation sequences


What comes OOTB
You need to invest time exploring the ootb rules. There are a few options:

try them on your selected features. explore them in the Machining Knowledge Editor. explore them in the generated documentation which is obtained with MKE command Write Documentation.

If you use operation sequences that are not standard ootb.

202

MKE Training- Customization Project

Analyze your operation sequences

In fact that is more than likely. Analyze your operation sequences. For every feature type all possible operation sequences should be described. Although there is no single best way of doing this, it helps to use forms like Sequence Form: Step2Hole on page 132. This allows for a common sequence description. Important is to identify why this sequence is chosen and not one of the other possible sequences, and if this sequence will change based on material or available resources. It is necessary to check if the decision criteria are based on feature attributes or on other factors. In the last case, it can be worth to add additional attributes to the features, which allow the user to define the choice, and to add tagging for these feature attributes to the system. A next step in the analysis of your operation sequences is to create a table as in the example below. It lists all sequences identified in the previous step and enables you to identify common steps within the sequences.

MKE Training - Customization Project

203

Analyze your operation sequences

Horizontally you have the produced features. These are the ones obtained from the first milestone. And directly below you have a column for each anticipated sequence of operations that will finally produce that feature.

204

MKE Training- Customization Project

The first column holds the individual operations, sorted by the feature it produces, which can be an in-process feature. The matrix is then filled by numbers which define the exact order in which the operations are performed. Note, for instance, that sequence nr 3 which produces a STEP1HOLE is defined as: Spot_Drill Drill_in_center_S1P Gun_Drill_S1H [Chamfer_S1H_Drill, Chamfer_S1H_Mill] (one of the two) The following step is to describe the separate operations in more detail. An example could be as in Step2hole operation on page 133. With all this information available, you must decide which operation sequences need to be implemented. It could be that some operation sequences are exotic and it is not worth to implement them. Milestone: List of Operation Sequences for all selected features. This should detail which operation sequences must be implemented.

Analyze your tool libraries


What comes OOTB.
The tool customization is based on the standard tool library that comes with NX, or with TeamCenter when you work in a managed environment.

How to add tools that are not standard. When you need tool classes that are not standard you must add the tool class
and then update the customization (only once). This is done automatically with MKE option Update upon Load.

MKE Training - Customization Project

205

Implement Knowledge

When adding a new tool class, tell NX which attribute is to be interpreted as the
Cutter Diameter and Cutter Length. This is done with MB3 commands in the customization view.

When you need tools of existing classes with dimensions that are not in the standard database you only need to add that tool to the library population.

Please refer to existing NX training manuals and documentation about defining


tool classes and populating them. Milestone: A list with all tool types. It has all the tool types you anticipate to use for your manufacturing features. These should match with the list of operations as chosen in the previous milestone.

Implement Knowledge
This section is just a collection of a few notes. But its the bulk of the project. In general, it is worth to consider, that the users always will need to define some operations manually. To speed up the process and assist the users, customized templates will be used for operations that are created frequently. It is wise to use these templates also in the knowledge definition. This results in uniformity between manually and automatically generated operations. To use a customized operation template (like a customized Drilling) in the MKE it must be in a part file that is referenced by the configuration. This configuration must be chosen when loading the xml source file with option Update upon Load = on (only once). It is important to understand that other changes to the default software configuration can help in the success of the implementation. Examples are:

Adding tagging data for features, which help the user to force the generation of
certain sequences.

Adding default Program Order Groups, which help in generating an initial program sequence that will work without the user having to move operations.

Adding KF post_create functionality to assist the user in putting the operations


in the correct program order groups. How to go about implementing the rules is treated in chapter Machining Knowledge Editor Concepts and chapter MKE Exercises: Hole Making .

206

MKE Training- Customization Project

Maintain Knowledge

Milestone: Implemented Rule Library.

Maintain Knowledge
Of course the manufacturing knowledge should be kept up-to-date. As best practices change also the knowledge should change accordingly. Regularly the knowledge should be checked against:

How many manual changes need to be made before the operations generate correctly?

How many operations are generated manually?


There should be a feedback loop from end-user(s) to the knowledge engineer.

Using Knowledge Fusion (KF) in Feature Based Machining


There are 2 different ways in which KF can be used:
1.

So called PostCreate functions. These functions allow you to do extra things after the standard FBM commands. ug_fbm_postCreateFeaturesCustomFunction() (e.g. add or change feature attributes)

After Find Features

After Create Feature Process


ug_fbm_postCreateCustomFunction() - for instance change a feature group; e.g. its name. ug_oper_postCreateCustomFunction() - change an operation; e.g. its name or one of its attributes (like feed and speed)
2.

Use the MKE to assign dynamic KF operation parameters. You can use the MKE to assign KF operation parameters for the 4 KF enabled operation types (Hole Making, Hole Milling, Face Milling and Cavity Milling only). This is done in the Add-Ons tab of the MKE. As an example, you can assign a KF function that determines the feed rate: k.Feed_Cut = "my_kf_feedrate_function();". Instead of using a fix value, NX will evaluate your KF function after every

MKE Training - Customization Project

207

Using Knowledge Fusion (KF) in Feature Based Machining

change in the operation. This example allows you to automatically use a different feed rate when the user modifies the depth of cut.

208

MKE Training- Customization Project

CHAPTER 16

Appendices

Machining Knowledge Editor Training

209

A: Glossary of Terms

A: Glossary of Terms Machining Rule: Captures 'best practices', describes the relation between manufacturing features, operations and tools. Often abbreviated to Rule.

Machining Knowledge Source: Set of rules including the corresponding customization.

Machining Knowledge Editor: Application to create and modify a Machining


Knowledge Source.

Knowledge Engineer: Superuser who is able to modify the machining knowledge in the Machining Knowledge Source.

OOTB is abbreviated OutOfTheBox which means you get this with your NX
installation.

B: Naming conventions for Manufacturing Features


A few naming conventions apply to all standard features:

HOLE features have no bottom, and can generally be reached from 2 sides. POCKET features have a bottom and can be machined from one side only. STEP1,2,3,4,5,6 features describe a single feature with a number of diameters. STEP3POCKET for instance is a blind hole with 3 diameters where the 1st diameter is larger than the 2nd and the 2nd diameter is larger than the 3rd.

STEP3HOLE1 is a hole with 3 diameters where the 3rd is larger than the 2nd.

210

Machining Knowledge Editor Training

C: Definition of the standard STEPPED features

STEP4HOLE1 is a hole with 4 diameters where the 4th is larger than the 3rd.

STEP5HOLE2 is a hole with 5 diameters where the 4th is larger than the 3rd
and the 5th is larger than the 4th.

C: Definition of the standard STEPPED features


Chamfer surfaces can be either torodial or conical Bottom surfaces are either planar or conical Chamfers are optional Bottom_ is optional if bottom_chamfer_1 or top_chamfer_2 is torodial

Picture above shows the most general constitution of a STEP2HOLE. For features with more STEPPED levels, section STP with elements 4,5,6,7 is repeated. Each added cylinder will get a higher index number.

Machining Knowledge Editor Training

211

C: Definition of the standard STEPPED features

Picture below show the parameters of the most general constitution of a STEP2HOLE.

212

Machining Knowledge Editor Training

C: Definition of the standard STEPPED features

Picture below shows constituent faces and parameters of the most general form of a STEP2POCKET.

Machining Knowledge Editor Training

213

D: Definition of the standard non-STEPPED features

D: Definition of the standard non-STEPPED features


This is a list of standard recognized parametric manufacturing features. TABLE 1. Feature Types occurrence Feature Type name CORNER_ NOTCH_ RECTANGULAR Notes

CORNER_ NOTCH_ ROUND_ CONCAVE

CORNER_ NOTCH_ STRAIGHT

CORNER_ NOTCH_ U_ SHAPED

GROOVE_ AX_ CIRCULAR_ RECT

214

Machining Knowledge Editor Training

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name GROOVE_ INS_ RAD_ RECT Notes

HOLE_ FREE_SHAPED_ STRAIGHT

HOLE_ OBROUND_ STRAIGHT

HOLE_ RECTANGULAR_ STRAIGHT

HOLE_ ROUND_ TAPERED

POCKET_ FREE_SHAPED_ STRAIGHT

Machining Knowledge Editor Training

215

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name POCKET_ OBROUND_ STRAIGHT Notes

POCKET_ RECTANGULAR_ STRAIGHT

POCKET_ ROUND_ TAPERED

SIDE_ NOTCH_ RECTANGULAR_1

SIDE_ NOTCH_ RECTANGULAR_2

SIDE_ NOTCH_ ROUND_ CONCAVE_1

216

Machining Knowledge Editor Training

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name SIDE_ NOTCH_ ROUND_ CONCAVE_2 Notes

SIDE_ NOTCH_ ROUND_ CONVEX_2

SIDE_ NOTCH_ U_SHAPED_1

SIDE_ NOTCH_ U_SHAPED_2

SLOT_ 90_DEGREE

SLOT_ DOVE_TAIL

Machining Knowledge Editor Training

217

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name SLOT_ OBROUND_1 Notes

SLOT_ OBROUND_2

SLOT_ PARTIAL_ OBROUND

SLOT_ PARTIAL_ RECTANGULAR

SLOT_ PARTIAL_ ROUND

SLOT_ PARTIAL_ U_SHAPED

218

Machining Knowledge Editor Training

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name SLOT_ RECTANGULAR_1 Notes

SLOT_ RECTANGULAR_2

SLOT_ RECTANGULAR_3

SLOT_ ROUND_1

SLOT_ ROUND_2

SLOT_ T_SHAPED

Machining Knowledge Editor Training

219

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name SLOT_ UPSIDE_DOWN_ DOVE_TAIL Notes

SLOT_ U_SHAPED_1

SLOT_ U_SHAPED_2

SLOT_ V_SHAPED

SURFACE_ PLANAR_ RECTANGULAR

220

Machining Knowledge Editor Training

D: Definition of the standard non-STEPPED features

TABLE 1. Feature Types occurrence Feature Type name SURFACE_ PLANAR Notes Any flat surface, not necessarily rectangular.

SURFACE_ PLANAR_ ROUND

Machining Knowledge Editor Training

221

E: Tips and Tricks

E: Tips and Tricks Choosing priority for the MACHINING_RULE


The MachiningRule.priority is an attribute which determines the sequence in which MachiningRules are tried, where a higher value means that the rule is tried earlier. The value has a meaning within a set of rules that have the same type of More Worked Feature. When, for instance, rule 1 machines a step1hole and rule 2 machines a step1pocket, the relative priorities are not important, since these rules are not competing. If rule 1 and rule 2 both machine a step1hole, the rule with higher priority will be tried first and only if it is rejected rule 2 will be tried. Generally it is good practice to give the cheaper rule a higher priority. Conditions on the cheaper rule must then be designed such that it is applied only when that is allowed. This is typically customer specific knowledge, allthough a general framework comes with the ootb knowledge.

How to use the MACHINING_RULE conditions


The MachiningRules contain conditions like: mwf.MACHINING_RULE = "TWIST_DRILL" or lwf.MACHINING_RULE = "TWIST_DRILL" These conditions are used to force a certain sequence of operations. An example is the sequence where tapping is always preceded by a drilling operation. In this case the tapping rule (for example Tap_S1H_thread) can contain the condition: lwf.MACHINING_RULE = "TWIST_DRILL" and the drilling rule (for example Drill_S1H) contains: mwf.MACHINING_RULE = "TWIST_DRILL" This prevents other rules from being used. For example the boring rules contain the condition:

222

Machining Knowledge Editor Training

E: Tips and Tricks

mwf.MACHINING_RULE = "BORE" Consequently, the boring rules will be rejected when the Tapping rule was applied before. (Of course the operation sequence in time is the reverse.) This condition is not causing conflicts when the drilling operation should be the first operation. This is because the attribute MACHINING_RULE is normally not defined for recognized features so it will not exist on the feature or it will exist but without a value. In both cases the condition on MACHINING_RULE will not block the MachiningRule. An exception would be if a face attribute MACHINING_RULE were defined on the model with a certain value. In that case the feature recognition will define the attribute on the recognized feature and as a consequence the conditions containing the mwf.MACHINING_RULE must be true otherwise the MachiningRule will be blocked. This way, you can use face attributes to force the sequence of operations.

Machining Knowledge Editor Training

223