Software Developer's Kit - ChemDraw

Send comments on this topic
Parent Property
See Also 

Description

Member of ChemDraw Control.AltGroups.

Returns the parent of the AltGroups collection.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As Object

Return Type

Object

Remarks

When you create a parent compound that contains an AltGroup you defined, an attachment point symbol appears next to the label. The attachment point number matches that found in the definition.

The property Parent returns the parent of the AltGroups collection.

Example

'AltGroups collection in the ChemDraw document 
 Private Sub cmdShowNumberOfAltGroups_Click() 
     Dim myAltGroup1 as ChemDrawControl10Ctl.AltGroup
     Dim myAltGroup2 as ChemDrawControl10Ctl.AltGroup 
     Dim myParent    as ChemDrawControl10Ctl.Object 
    'Checks if at least two AltGroup have been drawn
     If  ctlChemDraw.Objects.AltGroups.Count > 2 Then 
         Set MyAltGroup1 = ChemDrawControlCtl.AltGroups.Item(1)
         Set MyAltGroup2 = ChemDrawControlCtl.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") 
        'Must verify that parent has been set
         Set myParent = ChemDrawControlCtl.AltGroups.Parent 
     End If
 End Sub

See Also