Production Applications: NC Process Manager
Overview
The Process Manager functionality is based on the Process Table, which lists all the manufacturing process objects, such as workcells, operations, fixture setups, tooling, and NC sequences.
The Process Table lets you create new manufacturing objects and modify properties of existing ones. You can create new Holemaking and some milling steps directly in the Process Table. Steps of other types, that is, NC Sequences created outside the Process Manager, are also listed in the Process Table. You can manipulate the NC Sequences like any other steps, for example, reorder or duplicate them. However, customizations done to the toolpath outside the Process Table will be lost as a result of manipulation.
You can also define manufacturing templates based on existing Milling and Holemaking steps, and use these templates to create manufacturing steps in a different model.
You can add manufacturing templates as annotations to the reference part. This way, when you bring a reference part into a manufacturing model, the annotation can be automatically extracted into the manufacturing process to create the necessary steps, complete with tooling, parameters, and geometric references.
Accessing the Process Manager
You can access the Process Manager in Creo Parametric in the Manufacturing Mode via Creo TOOLKIT as follows:
•  When the process manager dialog box is not active.
•  When the process manager dialog box is active.
Accessing the Process Manager when the Dialog Box is not Active
You can access and modify the contents of the process manager without opening the Process Manager User Interface or while editing a manufacturing model in Creo Parametric.
Functions Introduced:
The function ProMfgProctableEnable() ensures that the process manager database is prepared for access or modification by Creo TOOLKIT functions. The application must call the function ProMfgProctableEnable() before using the process manager APIs discussed in the following sections.
The function ProMfgProctableDisable() enables Creo Parametric to perform cleanup of data that was loaded while calling the function ProMfgProctableEnable().
Accessing the Process Manager User Interface
You can add new items to the Process Manager User Interface using a Creo TOOLKIT application. The Creo TOOLKIT application should register the new user interface items in Creo Parametric before you open the Process Manager dialog box. Once the dialog box is opened, Creo Parametric automatically adds the registered menu buttons and menus to the dialog box.
Functions Introduced:
The function ProMfgproctableMenuAdd() adds a new menu or submenu to an existing menu in the process manager user interface.
The function ProMfgproctablePushbuttonAdd() adds a new button at the end of the existing menu in the Process Manager user interface. When adding a new menu button, you must supply two callback functions whose signature matches ProMfgproctableItemAccessFunction and ProMfgproctableItemActionFunction respectively.
The function whose signature matches ProMfgproctableItemAccessFunction sets the access state for the button in the process manager dialog box. The function whose signature is similar to ProMfgproctableItemActionFunction provides the implementation for the new menu button.
Use the functions ProMfgproctableSelecteditemsGet() and ProMfgproctableSelecteditemsSet() in the context of menu buttons added to the Process Manager. These functions provide access to the steps, operations and workcells that are currently selected by the user in the Process Manager dialog box. This information can guide the application as to which items it should modify. Select the appropriate type of table for the selected item to be able to determine the subtype of the process item.
These functions can be used out of context of the menu addition APIs as well.
The function ProMfgproctableDisplayUpdate() refreshes the Process Manager dialog box. It allows the application to update the contents of the process table after some changes have been made during a custom menu button action.
Manufacturing Process Items
This section gives you more information on the handles that are provided to enable access to process item data.
Steps, Operations and Workcells
An NC sequence is an assembly feature that represents a single tool path. NC sequences listed in the Process Table are called steps.
An operation is a series of NC sequences performed in a particular workcell and using a particular coordinate system for output of Cutter Location data.
A workcell is a machine tool definition and is stored in the assembly.
The object ProMfgprocItem will be used for all functions that operate on steps, operations, and workcells. This item is a derivative of ProModelitem and is defined as
typedef struct pro_model_item
{
ProType type;
int id;
ProMdl owner;
}ProMfgprocItem;
For all three item types, the ProType field should be PRO_NC_PROCESS_ITEM.
Step Models
The Step Model object represents the default properties of steps in the process manager and is a derivative of the ProModelitem and is defined as typedef struct pro_model_item.
{
ProType type;
int id;
ProMdl owner;
}ProMfgprocItem;
Step objects have a step id, the Mfg owner, and the ProType field as PRO_NC_PROCESS_MODEL.
Determining the Subtype of a Process Item
Function Introduced:
The function ProMfgprocitemSubtypeGet() returns the subtype of a manufacturing process item. It could be one of the following:
•  PRO_MFGPROCITEM_STEP—Specifies if the subtype is a step.
•  PRO_MFGPROCITEM_OPERATION—Specifies if the subtype is an operation.
•  PRO_MFGPROCITEM_WORKCELL—Specifies if the subtype is a workcell.
Accessing Details of Process Items
Although a ProMfgprocItem is not a feature, it shares many properties with Creo TOOLKIT features. In fact, process items generally map one-to-one with a specified manufacturing feature. Because of this, many of the process item’s properties can be accessed via the corresponding manufacturing feature element tree. Also, new items may be created by populating the element tree for the new step, operation or workcell.
Visiting Steps, Operations and Workcells
Functions Introduced:
The function ProMfgProctableVisit() enables you to visit the steps, workcells, and operations in a process table. As with other Creo TOOLKIT visit functions, specify the visit action and visit filter functions. For more information on Visit Functions, refer to the section Fundamentals.
Creating Steps, Operations, and Workcells
Functions Introduced:
Use the function ProMfgprocitemCreate() to create a new step, operation, or workcell in the process table. The input arguments of this function are:
•  model—Specifies the manufacturing model in which to create the new item.
•  table_type—Specifies the type of table where the item will reside. The valid values are:
  PRO_MFGPROCTABLE_PROCESS—Specifies the process table.
  PRO_MFGPROCTABLE_WORKCELLS—Specifies the workcell table.
•  elem_tree—Specifies the manufacturing feature element tree used to enumerate the properties of the new manufacturing item. To create a step you must fill one of the following element trees:
  Milling and Drilling—The element tree documented in header file ProNcseq.h.
  Fixture—The element tree documented in header file ProFixture.h.
  Assembly setup step—The element tree documented in header file ProFixture.h.
To create an Operation you must fill out the element tree documented in header file ProMfgoper.h.
To create a Workcell you must fill the element tree documented in header file ProWcell.h.
•  predecessor—Specifies the step or operation immediately before the new manufacturing item in the process table. When creating workcells, this can be NULL.
The function ProMfgprocitemCreate() returns the new manufacturing item.
Use the function ProMfgprocitemFromTemplateCreate() to create a new manufacturing step or workcell from a predefined template. A template is an XML file containing information necessary to create the manufacturing step or workcell, such as:
•  Resources, that is, workcells, tools, and fixtures
•  Ordered operations
•  Ordered steps and their reference information such as manufacturing templates and manufacturing criteria.
•  Retract plane for a step or an operation, as a distance calculated from the step coordinate system.
Accessing the Properties of Manufacturing Process Items
The functions described below enable you to access the properties of process items.
Functions Introduced:
The function ProMfgprocitemFeatureGet() returns the feature referenced by the process item. If the item is related to an actual manufacturing feature, some of the access functions that follow will not be supported. The properties of the item can be obtained by reading the feature’s properties and element tree.
The function ProMfgprocitemElemtreeGet() obtains the element tree for a manufacturing item. This tree should be freed using ProMfgprocitemElemtreeFree().
The function ProMfgprocitemAnnotationGet() returns the annotation element that created the process item.
The function ProMfgprocitemReorderlimitsGet() identifies the limits where the specified process item may be moved in the process table. The top limit represents the first process item after which you can insert the step. The lower limit, if any, represents the first process item that must come after the step in the process sequence.
The limits of reorder are based on step dependencies and priority and prerequisite rules. The input argument options specifies the checks to determine the position of reordering the process item elements. The valid values are:
•  PRO_MFGPROCREORDER_CHECK_PARENT_CHILD
•  PRO_MFGPROCREORDER_CHECK_PREREQUISITES
•  PRO_MFGPROCREORDER_CHECK_PRIORITIES
The function ProMfgprocitemNextitemGet() returns the process item following the specified item in the process table.
The function ProMfgprocitemPreviousitemGet() returns the process item preceding the specified process item in the process table.
The function ProMfgprocitemHolesetdepthtypeGet() returns the type of holeset and holeset end reference contained in the manufacturing process step.
The output argument end_type can have the following values:
•  PRO_MFGSTEP_HOLESETEND_REFERENCE—Specifies the end reference surface for the hole depth.
•  PRO_MFGSTEP_HOLESETEND_ALONG_AXIS—Specifies the end reference by entering a depth value along the hole axis.
The function ProMfgprocitemHolesetdepthGet() returns the process item holeset depth for a holeset of type BLIND and end reference type of ALONG AXIS.
The function ProMfgprocitemHolesetdepthSet() sets the holeset depth for a step. This function supports steps with only one holeset. The holeset type must be BLIND and the end reference type will be changed to ALONG AXIS after using this function.
The function ProMfgprocitemDefaultfixturesetupstepGet() returns the fixture setup defined for the specified operation.
Modifying Process Items
Functions Introduced:
Use the function ProMfgprocitemRedefine() to redefine the manufacturing item created using an element tree.
The function ProMfgprocitemDelete() deletes the specified step, operation, or workcell from the manufacturing table.
The function ProMfgprocitemReorder() reorders a step or operation within the process table.
Parameters
Several categories of parameters are accessible for items in the process manager table:
•  Manufacturing parameters
•  AE parameters
•  Step parameters
•  Template parameters
•  Special parameters
•  Global Parameters
Manufacturing Parameters
You can access the manufacturing parameters by reading or writing the manufacturing feature or step element tree.
Annotation Element Parameters
You can access the annotation element parameters by getting the parent Annotation Element via ProMfgprocitemAnnotationGet() and reading parameters from that object. Refer to the chapter Parameters for details on how to read parameters from items such as annotation elements.
Step Parameters and Relations
Step Parameters are parameters assigned to the step object. You can define parameters and relations to a particular step in the process table.
You can access these parameters by reading them directly from the step object using the standard parameter functions.
Refer to the chapter Parameters for details on how to read parameters from items.
Template Parameters
Template parameters are inherited from the step’s process template.
Function Introduced:
The function ProMfgprocitemTemplateparamGet() obtains a template parameter value for the process item.
Special Parameters
Other special parameters are properties of steps and can include the extract status, machining time, the template name, and so on. Some of these properties may be also accessible via the step element tree.
Functions Introduced:
The function ProMfgprocitemPropertyGet() returns the value of the special property of the process manager step or operation. The special property can be as follows:
•  PRO_MFGPROP_EXTRACT_STATUS—Specifies the extraction priority of the step.
•  PRO_MFGPROP_ACTUAL_MACHINING_TIME—Specifies the machining time of a step.
•  PRO_MFGPROP_ACTUAL_MACHINING_LENGTH— Specifies the machining distance of a step.
•  PRO_MFGPROP_TEMPLATE_NAME—Specifies the name of the manufacturing template used.
•  PRO_MFGPROP_GROUP_LEVEL_1—Specifies a merge group created by merging several Holemaking steps together, to optimize the tool path.
•  PRO_MFGPROP_GROUP_LEVEL_2—Specifies a merge group created by merging PRO_MFGPROP_GROUP_LEVEL_1 type merge groups together.
ProMfgprocitemPropertyGet()returns string values for PRO_MFGPROP_GROUP_LEVEL_1 and PRO_MFGPROP_GROUP_LEVEL_2 depending on the location of the process manager step in the merged group. The following table lists all the possible values taken by the special properties.
Step Location
Value returned for
Value returned for
If the step is a merge leader, but not a merge member.
“*leader”
Empty string
If the step is both a merge leader and merge member.
Name of the parent merge leader
“*leader”
If the step is merge member, but not a merge leader.
Case 1: It is a two level merge. For example, the parent itself is a merge member.
Name of the top merge leader
Name of the parent merge leader
Case 2: It is a one level merge
Name of the parent merge leader
Empty string
If the step is neither merge leader nor a merge member.
Empty string
Empty string
The function ProMfgprocitemPropertySet() sets the value of the special property of the process manager step or operation.
Global Parameters and Relations
Function Introduced:
The function ProMfgProctablemodelGet() obtains the process model that provides access to the manufacturing global parameters.
You can use this function to specify parameters and relations to all or selected steps in the process table. The modelitem handle returned by this function can be used to access the Global parameters of the process table.
Manufacturing Features
Functions Introduced:
The function ProMfgproctableFeaturesCreate() creates features for items in the process manufacturing table.
The function ProMfgproctableFeaturesDelete() deletes all existing manufacturing features from the Creo Parametric model while keeping everything in the process manager unchanged.
Import and Export of Process Table Contents
Functions Introduced:
The function ProMfgProctableWrite() exports the contents of the manufacturing process table to CSV format. The input arguments of the function are:
•  mfg—Specifies the manufacturing model.
•  table_type—Specifies the type of table to be generated as output. The valid values are:
  PRO_MFGPROCTABLE_PROCESS
  PRO_MFGPROCTABLE_WORKCELLS
•  view_name—Specifies the view name in the setup file; pass NULL to use the current view.
•  output_file—Specifies the full path and name of the output file.
The function ProMfgProctableSynchronize() synchronizes the manufacturing table with the input CSV file.
Notification
Function Introduced:
The notification ProMfgproctableExtractionPostAction identifies when the user has extracted the process table in order to form manufacturing features. It provides the path to the extraction log file, which can be examined by the application for further information.
Example 1: To Add Menu Button to The Manufacturing Process Table
The sample code in PTMfgProcTable.c located at <creo_toolkit_loadpoint>\<version>\Common Files\protoolkit\protk_appls\pt_mfg_proctable\pt_mfg_proctable_src enables you to add the Highlight Prereq and the Update Speed and Feed options respectively, to the Tools menu in the Manufacturing Process Table.
Image
The image above displays the Highlight Prereq and Update Feed & Speed menu buttons added to the Tools menu in the Manufacturing Process Table. When you click the Highlight Prereq option the function PTMfgProctableItemActionPreReq is invoked. The following example deals with this function in detail.
Example 2: To Highlight the Pre-requisites for the Selected Step in The Manufacturing Process Table
The sample code in PTMfgProcTable.c located at <creo_toolkit_loadpoint>\<version>\Common Files\protoolkit\protk_appls\pt_mfg_proctable\pt_mfg_proctable_src demonstrates how to highlight the pre-requisites for the selected step in the Manufacturing Process Table.
Image
Example 3: To Update Feed and Spindle Speed
The sample code in PTMfgProcTable.c located at <creo_toolkit_loadpoint>\<version>\Common Files\protoolkit\protk_appls\pt_mfg_proctable\pt_mfg_proctable_src demonstrates how to change the cut feed and the spindle speed for the specified tool.
When you click the Update Speed and Feed options in the Tools menu in the Manufacturing Process Table, the function PTMfgProctableItemFeedSpeed is invoked.
Image
The sample code in PTMfgProcTable.c located at <creo_toolkit_loadpoint>\<version>\Common Files\protoolkit\protk_appls\pt_mfg_proctable\pt_mfg_proctable_src describes the following action functions
•  PTMfgElemtreeWalkthroughAction()
•  PTMfgUsrUpdateAction()
•  PTMfgUsrCancelAction()
•  PTMfgElemtreePreReqAction()
•  PTMfgDialogCreate()
•  PTMfgProcitemElemtreeGet()
•  PTTestMfgProcItemVisit()
•  PTMfgParameterVisit()
•  PTMfgProcitemToolNameGet()
Example 4: To Add a Submenu to the Manufacturing Process Table
The following example enables you to add a menu and submenu to an existing menu option in the Manufacturing Process Table.
  #include <ProMenuBar.h>
  #include <ProMfgproctable.h>
  #include <ProMfg.h>
  #include <ProMdl.h>
  #include <ProMessage.h>
  #include <ProUtil.h>
  ProName submenulabel;
  ProName help;
  ProName submenubutton;
  ProError APITestCommand (ProMfg mfg, char* button_name, 
ProAppData appdata); ProStringToWstring (submenulabel, "MyNewSubmenu"); ProStringToWstring (submenubutton, "SubmenuButton"); ProStringToWstring (help, "SubmenuHelp"); status = ProMfgproctableMenuAdd ( "APITestMenu", submenulabel, "Insert" ); PT_TEST_LOG_SUCC("ProMfgproctableMenuAdd") status = ProMfgproctablePushbuttonAdd ("APITestMenu", "APITestMain", submenubutton, help, NULL, APITestCommand, NULL ); PT_TEST_LOG_SUCC("ProMfgproctablePushbuttonAdd"); ProError APITestCommand (ProMfg mfg, char* button_name, ProAppData appdata) { printf("Just some output\n"); return PRO_TK_NO_ERROR; }
Image