Assigning a Process ID Using VB Script Processes

With the help of a Process ID (Process Identifier), processes can be uniquely identified. This function is optional. The assigned Process ID must be unique, and can only be assigned once in a process.

In this chapter you will find out which settings must be executed, in order to assign a process a Process ID using a VB-Script. Structuring and content of the VB-Script is not the subject of this description. The VB-Script is created by the user according to company guidelines.

A Process ID can be assigned to a process using VB-Script, if the following functions are executed in the DPM - Process & Resource Definition workbench:

  • Insert Activity
  • Reparent Activity
  • Cut/Copy/Paste & Drag/Drop of activities

You need to make the following settings:

  1. Select Tools > Options > Digital Process for Manufacturing > Libraries.

  2. To assign the VB-Script click on the Browse button.

  3. Click on Ensure unique ID among siblings.

     

  4. Click OK. After you have set the options, the process is assigned a unique Process ID, when the previously mentioned functions are executed

  • In the example it is Process ID Act10.1.

 

Important note for structuring of VB Scripts

Customer site administrator can choose a VB script, which implements the site-specific process ID generation algorithm based on the respective business processes/conventions. The input to the script will be as follows.

  • Handle to the Activity impacted ( For ex: Activity that is being created or being moved )

The script will contain following functions that are invoked appropriately based on the context in which they are called. Note that the Function name(s) are “Keywords” and should not be changed at the customer site. This essentially means that the customer should simply implement the following functions in a VB script, which will be defined in the Tools>Options as mentioned above.
 

Function OnActivityCreate (iActImpacted)

Dim iAct As Activity

Set iAct = iActImpacted

...

...

End Function Function OnActivityMove (iActImpacted)

Dim iAct As Activity

Set iAct = iActImpacted

...

...

End Function

Example for VB-Script

 

'=================================================================================

'COPYRIGHT DASSAULT SYSTEMES 2006

'

'Jan 2006 User Exit for Process ID Generation - Sample VB script GNY ' '====================================================================================

'Usage Notes: This is a sample script provided with the Software. Customers can modify body

'of the functions in this script in order to implement their site specific algorithm to generate

'process identifier. Also customers can choose to create another script file with the function 'names(OnActivityCreate, OnActivityMove) to implement their naming convention for process identifer

'

'NOTE THAT THE FUNCTION NAMES ARE KEYWORDS AND SHOULD NOT BE CHANGED IN THE IMPLEMENTATION AT

'THE CUSTOMER SITE.

'

'The absolute path of the script file needs to be defined at Tools>Options>Library tab page.

'Note that this can be done only by the site administrator. '====================================================================================== '======================================================================================

'OnActivityCreate() implementation will be called at the time of activity creation. Thus, it will get

'called as a post action to the following operations

'Insert Activity command

'Insert Assembly Activity or BIW Activity command

'Cut/Copy/Paste & Drag/Drop of one activity to another '=====================================================================================

Function OnActivityCreate( iAct )

Dim impAct As Activity

Set impAct = iAct

'Catia.SystemService.Print "Activity Label-OnActivityCreate - iAct: " & iAct.Name

OnActivityCreate = iAct.Name End Function '=======================================================================================

'OnActivityMove() implementation will be called only at the time of reparenting an existing activity.

'Thus, it will get called as a post action to the execution of Reparent activity command. '========================================================================================

Function OnActivityMove( iAct )

Dim impAct As Activity

Set impAct = iAct

'Catia.SystemService.Print "Activity Label-OnActivityMove - iAct: " & iAct.Name

OnActivityMove= iAct.Name

End Function