Software Developer's Kit - ChemDraw

Send comments on this topic
AltGroups Property
See Also 


Member of ChemDrawControl.Objects.

Returns the AltGroups collection from the objects collection

Property type

Read-only property


Visual Basic
Public Property AltGroups() As AltGroups

Return Type


'Shows number of AltGroups within one AltGroup versus AltGroups in the ChemDraw document  
 Private Sub cmdShowNumberOfAltGroups_Click() 
     Dim myAltGroup1 as ChemDrawControl10Ctl.AltGroup
     Dim myAltGroup2 as ChemDrawControl10Ctl.AltGroup 
    'Checks if at least two AltGroups have been drawn
     If ctlChemDraw.Objects.AltGroups.Count > 2 Then 
         Set MyAltGroup1 = ChemDrawControlCtl.Objects.AltGroups.Item(1)
         Set MyAltGroup2 = ChemDrawControlCtl.Objects.AltGroups.Item(2)
        'Returns the number of atoms in each AltGroup
         vMessage = MsgBox("AltGroup1 has: " & MyAltGroup1.Atoms.Count & " Atom/s" _
                    & "AltGroup2 has: " & MyAltGroup2.Atoms.Count& " Atom/s", _
                    vbInformation + vbOKOnly, "Info") 
        'Returns the number of AltGroups within AltGroup1
         Text1.text = "AltGroup1 has: " & format(MyAltGroup1.AltGroups.Count, "##") & " AltGroup/s" 
        'Returns the number of AltGroups within the ChemDraw document
         Text2.text = "There are: " & format(ChemDrawControlCtl.Objects.AltGroups.Count, "##") & " AltGroup/s" 
     End If
 End Sub

See Also