Software Developer's Kit - ChemDraw

Send comments on this topic
Bonds Property
See Also 

Description

Member of ChemDraw Control.Atom.

Returns the bonds collection that is attached to this atom

Property type

Read-only property

Syntax

Visual Basic
Public Property Bonds() As Bonds

Return Type

Remarks

This property refers to the collection of bonds attached to an atom, which are the following:

MyAtom.Bonds.Application  returns the application associated with the bonds
MyAtom.Bonds.Count         returns the number of bonds attached to the atom
MyAtom.Bonds.Item(1)      given an index, returns a bond
MyAtom.Bonds.Parent        returns the parent of the bonds attached to the atom

With MyAtom.Bonds.Item(i) all the bond properties are enabled for bond(i). This index starts with 1.

Example

'Declares variable vAtom
 Dim myAtom As ChemDrawControl10Ctl.Atom
'Checks that there is an atom loaded in the variable
 If  Selection.Atoms.Count < 1
Then
     Exit Sub
 End If

 Private Sub cmdAtom_Bonds_Click() 
     Dim vBond As ChemDrawControl10Ctl.Bond  
   
  Text1.text = MyAtom.Bonds.Application
     Text2.text = MyAtom.Bonds.Count
     vBond = MyAtom.Bonds.Item(1)
 End Sub

See Also