PdcOperationList.Add
Jump to navigation
Jump to search
Declaration
Add(opKind as pdcOperationKind,Name as String) as PdcOperation
Description
Returns an new added operation object with the supplied number
Notes
This method add an operation to the operation list.
The first parameter determines the kind of the operation.
The second parameter is the operation code from the master data.
The result is the added operation object or nothing if the operation not exist.
The following pdcOperationKinds are available:
Value - pdcOperationKind - Description
0 - pdcInternalOp - Internal operation
1 - pdcExternalOp - Subcontracting
2 - pdcExtraOp - Additional cost
Code example
This code example adds the following items to the operation list:
- An internal operation and sets the setuptime to 25 minutes and the cycletime to 5 minutes.
- A subcontracting and sets the additional costs to 35 euro and the item costs to 20 euro.
- Additional costs and sets item costs to 25 euro.
dim objCalc
dim strBWPL
dim objOperation
set objCalc = pdc.ActiveCalculation
strBWPL = "LASER1"
set objOperation = objCalc.OperationList.Add(pdcInternalOp, strBWPL)
if IsValid(objOperation) then
objOperation.SetupTime = 25
objOperation.CycleTime = 5
else
msgbox "Operation " & strBWPL & " does not exist in the internal operations master data."
end if
strBWPL = "4006"
set objOperation = objCalc.OperationList.Add(pdcExternalOp, strBWPL)
if IsValid(objOperation) then
objOperation.SetupCosts = 35
objOperation.PieceCosts = 20
else
msgbox "Operation " & strBWPL & " does not exist in the subcontracting master data."
end if
strBWPL = "9999"
set objOperation = objCalc.OperationList.Add(pdcExtraOp, strBWPL)
if IsValid(objOperation) then
objOperation.PieceCosts = 25
else
msgbox "Operation " & strBWPL & " does not exist in the additional costs master data."
end if
objCalc.Refresh
Availability
Available since 2004 (version 2.7).