Software Developer's Kit - ChemDraw

Send comments on this topic
GroupType Property
See Also 


Member of ChemDraw Control.Group.

Returns the type of group for this group.

Property type

Read-only property


Visual Basic
Public Property GroupType() As CDGroupType

Return Type


GroupType can be can be equal to kCDGroupTypeGroup or kCDGroupTypeFragment. The difference is that a Fragment is a chemical entity, whereas Group can be a collection of disjoint elements.


 Private Sub ctlChemDraw_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     Set MyGroup = ctlChemDraw.MakeGroup()
     For  x = 1 To Selection.Objects.Count - 1 'groups the objets, without including the actual object
          Selection.Objects.Item(x).Group = MyGroup
     Next x
     If  MyGroup.GroupType = 1 Then
         Text1.text = "kCDGroupTypeFragment"
         Text1.text = "kCDGroupTypeGroup"
     End If
 End Sub

See Also