Software Developer's Kit - ChemDraw

Send comments on this topic
Bonds Collection
See Also  Members 


Member of ChemDraw Control.

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

ChemDraw Bonds Collection contains all of the bond objects in the document.

Object Model


Bonds is a collection containing all of the bonds objects in the ChemDraw document. If myBonds is a bonds collection object:

MyBonds.Application   returns the application associated with the collection of bonds
MyBonds.Count           returns the number of bonds in the collection of bonds
MyBonds.Parent          returns the parent of the bonds collection 
MyBonds.Item(1)        given an index, references one bond in particular from the collection of bonds, enabling all bond properties

With myBonds.Item(i) all the bond properties are enabled for the myBonds(i) of the bonds collection. This index starts with 1.


'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 = 2
    '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