Software Developer's Kit - ChemDraw

Send comments on this topic
Atoms Collection
See Also  Members 

Description

Member of ChemDraw Control.

For a list of all members defined for this collection, see Atoms Members.

ChemDraw Atoms Collection contains all of the Atom objects in the document. 

Object Model

Remarks

Atoms is a collection containing all of the atom objects in the ChemDraw document. If myAtoms is an atoms collection object:

MyAtoms.Application   returns the application associated with the atoms collection
MyAtoms.Count          returns the number of atoms in the collection
MyAtoms.Item(i)        given an index, references one atom in particular
MyAtoms.Parent         returns the parent of the atoms collection

Using myAtoms.Item(i) all the Atom properties are enabled for myAtoms(i). This index starts with 1.

Example

'Declares variables 
 Dim myAtoms As ChemDrawControl11Ctl.Atoms
 Set myAtoms = ctlChemDraw.Selection.Objects.Atoms

 Private Sub cmdAtoms_Click()
    'returns the application of the atoms collection
     Text1.text = MyAtoms.Application
    'returns the number of atoms in the atoms collection
     Text2.text = MyAtoms.Count 
    'sets the Item(1) of the atoms collection 
     myAtoms.Item(1).ElementNumber = 26
    'returns element number of Item(1)of the atoms collection 
     Text3.text = MyAtoms.Item(1).ElementNumber
 End Sub

See Also