Software Developer's Kit - ChemDraw

Send comments on this topic
Item Method
See Also 
index

The location of an object in a collection, counted from the top, starting with 1.

Description

Default member of ChemDraw Control.Atoms

Given an index, returns one atom from the atoms collection.

Syntax

Visual Basic
Public Function Item( _
   ByVal index As Long _
) As Atom

Parameters

index

The location of an object in a collection, counted from the top, starting with 1.

Return Type

Remarks

Working with this property, allows referencing any given atom of a collection of atoms, and all the atom properties are available.

MyAtoms.Item(i).ElementNumber:   returns or sets the element number of one atom in the collection
MyAtoms.Item(i).LabelText:            returns or sets the LabelText of one atom in the collection

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