Software Developer's Kit - ChemDraw

Send comments on this topic
FilterByTag Method
See Also 
tagName
Object tag name to filter by.
includeThese
Indicates whether to include these objects or not.
pVal
Collection of objects returned after applying filter.

Description

Member of ChemDrawControl.Objects.

Return the collection of these objects that have an Object Tag of the specified name

Syntax

Visual Basic
Public Sub FilterByTag( _
   ByVal tagName As String, _
   ByVal includeThese As Boolean, _
   ByVal pVal As Objects _
) 

Parameters

tagName
Object tag name to filter by.
includeThese
Indicates whether to include these objects or not.
pVal
Collection of objects returned after applying filter.

Example

'Declare variables
 Dim vName As String
 Dim vObjectTag As ChemDrawControl11Ctl.ObjectTag

 Private Sub cmdCreateObjectTag_Click()
     vName = "ObjectTagName"
     ChemDrawCtl1.selection.Objects.Item(1).MakeObjectTag vName, vObjectTag, False
     vObjectTag.StringValue = "New string value"
     vObjectTag.Persistent = False
     vObjectTag.Caption.Text = "New Value"
     vObjectTag.Caption.Family = "Arial"
     vObjectTag.Color = vbBlue
 End Sub

 Private Sub cmdFilterByTag_Click()
     vName = "ObjectTagName1"
     Dim myObjects1 As ChemDrawControl11Ctl.Objects
     Dim myObjects2 As ChemDrawControl11Ctl.Objects
     Set myObjects1 = Me.ChemDrawCtl1.Objects 
     'myObjects1: objects to be filtered, myObjects2: objects returned after filter
     myObjects1.FilterByTag vName, True, myObjects2
     Text1.Text = "In: " & myObjects1.Count & " Out: " & myObjects2.Count
 End Sub

See Also