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.Bonds

Given an index, returns one bond from the bonds collection.

Syntax

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

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 bond of the collection of bonds, and all bond properties are available.

Example

'Declares variables 
 Dim myBonds As ChemDrawControl11Ctl.Bonds
 Set myBonds = ctlChemDraw.Selection.Objects.Bonds   
 Dim MyParent As ChemDrawControl10Ctl.Object

 Private Sub cmdBonds_Click()
    'returns the application of the Bonds collection
     Text1.text = MyBonds.Application
    'returns the number of Bonds in the Bonds collection
     Text2.text = MyBonds.Count 
    'sets the Item(1) of the Bonds collection 
     myBonds.Item(1).BondDisplay = 26
    'returns element number of Item(1)of the Bonds collection 
     Text3.text = MyBonds.Item(1).BondDisplay    
    'must verify that parent has been set
     Set myParent = ChemDrawControlCtl.Bonds.Parent
 End Sub

See Also