Software Developer's Kit - ChemDraw

Send comments on this topic
Atoms Property
See Also 

Description

Member of ChemDraw Control.Group.

Returns the atoms collection of this group.

Property type

Read-only property

Syntax

Visual Basic
Public Property Atoms() As Atoms

Return Type

Remarks

This property refers to the collection of atoms which is in this Group. The properties associated with the collection are the following:

myGroup.Atoms.Application      returns the application associated with the collection of atoms 
myGroup.Atoms.Count             returns the number of atoms that are in this AltGroup
myGroup.Atoms.Item(i)            returns one atom from the collection 
myGroup.Atoms.Parent            returns the parent of the collection of atoms

With myGroup.Atoms.Item(i) all the atom properties are enabled for atom(i). This index starts with 1.

Example

'Shows number of atoms within one Group   
 Private Sub cmdShowNumberOfAtoms_Click() 
     Dim myGroup as ChemDrawControl10Ctl.Group
     'Checks if at least one Group has been drawn
     If  ChemDrawControl10Ctl.Objects.Groups.Count >= 1 Then 
         Set MyGroup = ChemDrawControl10Ctl.Objects.Groups.Item(1)
         'Returns the number of Atoms within myGroup
         Text1.text = "myGroup has: " & format(MyGroup.Atoms.Count, "##") & " Atom/s" 
     End If
 End Sub

See Also