Software Developer's Kit - ChemDraw

Send comments on this topic
Groups Property
See Also 


Member of ChemDraw Control.Group. 

Returns the groups collection of this group.

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 Group. The properties associated with the collection are the following:

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

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


'Returns the number of groups in this Group 
 Dim MyGroup As ChemDrawControl10Ctl.Group
 Private Sub ChemDrawControl10Ctl_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ChemDrawControl10Ctl.Objects.Groups.Count = 1 Then 'Checks if a Group has been drawn
         Set MyAltGroup = ChemDrawControl10Ctl.Objects.Groups.Item(1) Click()
         vMessage = MsgBox("Number of groups: " & MyGroup.Groups.Count, _vbInformation + vbOKOnly, "Info")
         'there is no group
     End If
 End Sub

See Also