Software Developer's Kit - ChemDraw

Send comments on this topic
Atoms Property
See Also 


Member of ChemDrawControl.Objects.

Returns the atoms from the objects in the collection

Property type

Read-only property


Visual Basic
Public Property Atoms() As Atoms

Return Type


'Shows number of Atoms within the ChemDraw document  
 Private Sub cmdShowNumberOfAtoms_Click() 
     Dim myAtom1 as ChemDrawControl10Ctl.Atom
     Dim myAtom2 as ChemDrawControl10Ctl.Atom 
    'Checks if at least two Atoms have been drawn
     If ctlChemDraw.Objects.Atoms.Count > 2 Then 
         Set MyAtom1 = ChemDrawControlCtl.Objects.Atoms.Item(1)
         Set MyAtom2 = ChemDrawControlCtl.Objects.Atoms.Item(2)
        'Returns the number of Atoms within the ChemDraw document
         Text2.text = "There are: " & format(ChemDrawControlCtl.Objects.Atoms.Count, "##") & " Atom/s" 
     End If
 End Sub

See Also