Role: The interface is used manage the activities under an Operation and its attributes.
The following code snippet can be used to obtain an Operation from a Robot Task.
Dim objRobotTask as RobotTask Dim objOperationList As Operation objRobotTask.GetAllOperations objOperationList Dim objOperation As Operation objOperation=objOperationList[0]
The Operation can also be obtained from an activity of the type Operation.
Dim objActivity as Activity
...
Dim objOperation as Operation
Set objOperation = objActivity.GetTechnologicalObject("Operation" )
Methods
- Sub CreateRobotMotion( iRefAct, iBefore, oTargetMotion)
-
Creates Robot Motion as a child of Operation.
If there is an already existing RobotMotion we do not create a new one but return the
handle to the existing one, else creates it at the start and link appropriately.
- Parameters:
-
- iRefAct
- Reference activity After/Before which the Target Motion needs to be created. dd>
- iBefore
- Created Target Motion can be Predecessor(True)/Successor(False) to Reference activity. dd>
- oTargetMotion
- The created Robot Motion. dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- The Robot Motion could be successfully created
- E_FAIL
- The Robot Motion could not be created.
- Example:
- The following example creates a robot motion as a child of Operation.
Dim objOperation As Operation Dim objRefAct as AnyObject Dim objRobotmotion as RobotMotion objOperation.CreateRobotMotion objRefAct,1,objRobotmotion
- Sub GetActions( oChildrenList)
-
Retrieves all the Basic Actions under the operation.
- Parameters:
-
- oChildrenList
- Returns the Basic Actions of the Robot dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- The actions could be successfully queried
- E_FAIL
- The actions could not be queried.
- Example:
- The following example gets the actions of the current Operation.
Dim objOperation As Operation Dim ActionList(2) objOperation.GetActions ActionList
- Sub GetRobotMotion( oRobotTargetMotion)
-
Retrieves the RobotMotion.
- Parameters:
-
- oRobotTargetMotion
- Returned RobotMotion dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- The Robot Motion could be successfully queried
- E_FAIL
- The Robot Motion could not be queried.
- Example:
- The following example gets the robot motion of the current Operation.
Dim objOperation As Operation Dim objRobotmotion as RobotMotion objOperation.GetRobotMotion objRobotmotion
- Sub GetViaMode( index)
-
Retrieves the via mode of the operation.
- Parameters:
-
- index
- The Via Mode (1 if the target is a via point and 0 if the Target is Untyped (process)). dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- The via mode was successfully queried.
- E_FAIL
- The via mode could not be queried.
- Example:
- The following example retrieves the Via Mode of the Operation.
Dim objOperation As Operation Dim ViaMode objOperation.GetViaMode ViaMode
- Sub SetViaMode( index)
-
Sets the Via Mode of the Operation.
- Parameters:
-
- index
- The Via Mode (1 if the target is a via point and 0 if the Target is Untyped (process)). dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- The via mode was successfully set.
- E_FAIL
- The via mode could not be set.
- Example:
- The following example sets the Via Mode of the Operation.
Dim objOperation As Operation objOperation.SetViaMode 0