Software Developer's Kit - ChemDraw

Send comments on this topic
MappedAtoms Property
See Also 


Member of ChemDraw Control.Atom.

Sets and returns the collection of mapped atoms which are mapped to this atom.

Property type

Read-only property


Visual Basic
Public Property MappedAtoms() As Atoms

Return Type


You can create correspondences between atoms in different structures for use in creating queries for searching a reaction database.  The reactions mapped can be single or multi-step.  You can assign atom-to-atom mapping for creating records for a reaction database and for creating queries for searching a reaction database.  

An atom-atom map on the reaction components in a query specifies exactly which atoms in the reactants correspond to the atoms in the products.  You can specify the atoms that must (or must not) change in the transformations that you retrieve.

The property MappedAtoms refers to the collection of atoms mapped to this atom.

myAtom.MappedAtoms.Item(i)          returns a specific atom of the collection
myAtom.MappedAtoms.Application    returns the application of the atoms collection
myAtom.MappedAtoms.Count           returns the number of atoms in the collection
myAtom.MappedAtoms.Parent          returns the parent of the atoms collection


'Declares variables
 Dim vAuxAtom  As ChemDrawControl10Ctl.Atom
 Dim myAtom As ChemDrawControl10Ctl.Atom
'Checks that there is an atom loaded in the variable
 If  Selection.Atoms.Count < 1 Then
     Exit Sub
 End If

'Adds a mapped atom
 Private sub cmdAddMappedAtom_click()
   'Verifies if there is a secondary atom chosen
    If  MyAtom.LabelText = "Secondary" Then
        vMessage = MsgBox("Cannot be mapped to itself, please select another", _
                   vbCritical + vbOKOnly, "Error")

        Exit Sub
    End If

    MyAtom.AddMappedAtom vAuxAtom
    Text1.Text = MyAtom.MappedAtoms.Count

End Sub

See Also