Software Developer's Kit - ChemDraw

Send comments on this topic
FilterByTagLong Method
See Also 
tagName
Object tag name by which to filter.
tagValue
Long value by which to filter.
includeThese
Indicates whether these objects should be included 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 and value

Syntax

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

Parameters

tagName
Object tag name by which to filter.
tagValue
Long value by which to filter.
includeThese
Indicates whether these objects should be included 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.LongValue = varLong
     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, TagValue, True, myObjects2
     Text1.Text = "In: " & myObjects1.Count & " Out: " & myObjects2.Count
 End Sub

See Also