Click or drag to resize

IMcEngineParentOfOperator Method

Find the immediate parent operator, if any, for some operator.

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
Function ParentOfOperator ( 
	Operator As Object
) As Object

Parameters

Operator
Type: SystemObject
The operator instance for which the parent operator is desired. This must be an interface implementing IMcHasObject or it must be the McObject of such an interface.

Return Value

Type: Object
The parent operator or Nothing if the operator is global (has no parent).
Remarks
This function provides a convenient way to determine if an "operator" (an interface implementing IMcHasObject) has an immediate parent operator and returns the parent if so. Use AncestorOfOperator to find any ancestor of a given type.
Examples
VB
'Example, Determine if an operator has a parent (i.e. is not a global operator)
Function DoesOperatorHaveParent(myOperator As Object) As Boolean
Dim myParent As Object
Set myParent = ParentOfOperator(myOperator)
DoesOperatorHaveParent = Not myParent Is Nothing
If DoesOperatorHaveParent Then
Debug.Print ThisApplication.McObject(myOperator).Name & " is a child of " & ThisApplication.McObject(myParent).Name
Else
Debug.Print ThisApplication.McObject(myOperator).Name & " is global (has no parent)."
End If
End Function
Sub TestParentOfOperator()
Debug.Print DoesOperatorHaveParent(ThisApplication.ActiveImage.LineFeatures.Profiles)
Debug.Print DoesOperatorHaveParent(ThisApplication.Engine) 'Engine has no parent
End Sub
See Also