DIAdem Help

Method: ExistsByDefinition for AssignmentList <Data>

  • Updated2024-09-12
  • 1 minute(s) read

Method: ExistsByDefinition for AssignmentList <Data>

Checks in the script interface for internal data whether the assignment with a specified definition value already exists in an assignment channel.

bExistsByDefinition = Object.ExistsByDefinition(Definition)
ObjectAssignmentList <Data>
Object with this method
DefinitionVariant
Specifies the definition value of the assignment.
bExistsByDefinitionBoolean
The value is TRUE if the assignment with the specified definition value already exists.

The following example generates an assignment channel with three assignments and checks whether an assignment to the definition value 2 already exists:

VBScriptPython

 

Dim oMyGrp, oMyChn, oMyAssgnList
Set oMyGrp = Data.Root.ChannelGroups(1)
Set oMyChn = oMyGrp.Channels.AddAssignmentChannel("MyAssignmentChn","Default Value")
Set oMyAssgnList = oMyChn.AssignmentList
Call oMyAssgnList.Add("text1",1)
Call oMyAssgnList.Add("text2",2)
Call oMyAssgnList.Add("text3",3)
Call MsgBoxDisp(oMyAssgnList.ExistsByDefinition(2))