Software Developer's Kit - ChemDraw

Send comments on this topic
Bonds Property
See Also 


Member of ChemDraw Control.AltGroup.

Returns the bonds in this AltGroup.

Property type

Read-only property


Visual Basic
Public Property Bonds() As Bonds

Return Type


This property refers to the collection of bonds in this AltGroup. The members of this collection will be the bonds in this AltGroup. The properties associated with the collection are the following:

MyAltGroup.Bonds.Application  returns the application associated with the collection of bonds
MyAltGroup.Bonds.Count         returns the number of bonds  in the collection of bonds
MyAltGroup.Bonds.Parent        returns the parent of the bonds collection  bonds
MyAltGroup.Bonds.Item(i)       returns one bond from the collection

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


'Returns the number of bonds in this AltGroup bonds collection
 Dim MyAltGroup As ChemDrawControl10Ctl.AltGroup
 Private Sub ChemDrawControl10Ctl_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ChemDrawControl10Ctl.Objects.AltGroups.Count = 1 Then 'Checks if an AltGroup has been drawn
         Set MyAltGroup = ChemDrawControl10Ctl.Objects.AltGroups.Item(1)
         Command1.Enabled = True
         Command1.Enabled = False
     End If 
 End Sub
 Private Sub Command1_Click()
     vMessage = MsgBox("The alt group has " & MyAltGroup.Bonds.Count & " Bond/s", _
                vbInformation + vbOKOnly, "Info")
 End Sub

See Also