Software Developer's Kit - ChemDraw

Send comments on this topic
Groups Property
See Also 


Member of ChemDraw Control.AltGroup.

Returns the groups in this AltGroup.

Property type

Read-only property


Visual Basic
Public Property Groups() As Groups

Return Type


The groups property refers to the collection of groups which is within this AltGroup. The members of this collection will be the groups in this AltGroup. The properties associated with the collection are the following:

myAltGroup.Groups.Application      returns the application associated with the groups collection
myAltGroup.Groups.Count             returns the number of groups in the collection
myAltGroup.Groups.Item(i)            returns one group from the collection
myAltGroup.Groups.Parent            returns the parent of the groups collection

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


'Returns the number of groups in the groups collection in this AltGroup 
 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 number of groups is: " & MyAltGroup.Groups.Count, vbInformation + vbOKOnly, "Info")
 End Sub

See Also