Software Developer's Kit - ChemDraw

Send comments on this topic
Bonds Property
See Also 

Description

Member of ChemDraw Control.Group.

Returns the bonds collection of this group.

Property type

Read-only property

Syntax

Visual Basic
Public Property Bonds() As Bonds

Return Type

Remarks

This property refers to the collection of bonds in this Group.  The properties associated with the collection are the following:

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

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

Example

'Shows number of bonds within one Group   
 Private Sub cmdShowNumberOfAltGroups_Click() 
     Dim myGroup as ChemDrawControl10Ctl.Group
     'Checks if at least one Group has been drawn
     If  ChemDrawControl10Ctl.Objects.Groups.Count >= 1 Then 
         Set MyGroup = ChemDrawControl10Ctl.Objects.Groups.Item(1)
         'Returns the number of Bonds within myGroup
         Text1.text = "myGroup has: " & format(MyGroup.Bonds.Count, "##") & " bond/s" 
     End If
 End Sub

See Also