Role: This allows the creation of a GenericAction under an Operation
The following code snippet can be used to obtain a GenericActionFactory from a selected Operation
Dim oSelectAct As Activity
set oSelectAct = CATIA.ActiveDocument.Selection.FindObject("CATIAActivity")
Dim objGenActFact As GenericActionFactory
set objGenActFact = oSelectAct.GetTechnologicalObject("GenericActionFactory")
Methods
- Func CreateGenericAction( iActionType, iBefore, iReferenceActivity) As
-
Creates an Action based on the specified type
- Parameters:
-
- iActionType
- Type of Action to be created. dd>
- iBefore
- Created Action can be Predecessor/Successor. dd>
- iReferenceActivitiy
- The Reference Activity Before/After which the Action needs to be created. dd>
- oGenericAction
- Created Action. dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- Action is successfully created and the interface pointer is successfully returned
- E_FAIL
- Action was successfully created, but the interface query failed
- E_NOINTERFACE
- Action was successfully created, but the it doesn't implement the requested interface
- E_OUTOFMEMORY
- The component allocation failed
- Example:
-
Dim objGenActFact As GenericActionFactory ...... Dim refAct As Activity Dim objGenAct as GenericAction CATIASelection ...... Before = TRUE set refAct = CATIA.ActiveDocument.Selection.FindObject("CATIAActivity") set objGenAct = objGenActFact.CreateGenericAction("DNBIgpSpotWeld", False, refAct) ..