Software Developer's Kit - ChemDraw

Send comments on this topic
BracketUsage Property
See Also 

Description

Member of ChemDraw Control.Bracket.

Sets and returns the chemical usage of this bracket.

Property type

Read-write property

Syntax

Visual Basic
Public Property BracketUsage() As CDBracketUsage

Return Type

Remarks

Brackets (parentheses and braces) enclose structures or structural fragments that are to be repeated a number of times. The CDX file format offers several properties of brackets that allow users to specify the context of those repeating units, as well as their orientation.  The Bracket Usage indicates that the enclosed items are repeated a specific known number of times. Representations of polymers are either structure-based or source-based.

- Structure-based representation

Using bracket type SRU (n) to enclose a portion of a structure 

Using bracket usage types "Crosslink (xl)", "Graft (grf)" or "Modification (mod)" to represent specific types of repeating units  

- Source-based representation

Using bracket usage type "Monomer (mon)" to enclose a structure

Using "Mer (mer)" brackets for components of a copolymer where individual components are known not to repeat themselves or alternate with other components

Using bracket type "Component (co)",  "Copolymer, alternating (alt)", "Copolymer, random (ran)", or "Copolymer, block (blk)" to represent different specific types of copolymers

Bracket type "Component (c)" indicates individual mixture elements.

Bracket type "Mixture, unordered (mix)" is not for polymers, but to represent a collection of substances that may all be present, but not necessarily in known amounts.

Bracket type "Mixture, ordered (f)" is primarily used to describe manufacturing processes, where the ordering of components is a critical part of the process (and where a different ordering might produce a different final product. As with Unordered Mixtures, individual elements of an ordered mixture should be surrounded by brackets with a bracket usage of "Component (c)". Unlike with Unordered Mixtures, however, components of Ordered Mixtures must represent their ordering. You can do this by editing the "c" label with the text tool to include a number ("c1", "c2", and so on.)

Using bracket type "Multiple Group (#)" to indicate that the enclosed items are repeated a specific known number of times. Multiple Group brackets may enclose entire structures, or may enclose a portion of the structures only. You can edit the numeric repeat count with the text tool.

Example

'Declares variables
 Dim vbracket1 As ChemDrawControl10Ctl.bracket
 Dim vbracket2 As ChemDrawControl10Ctl.bracket
 Dim BracketNum as Boolean
'Checks that there is a bracket loaded in the variable
 Private Sub ctlChemDraw_SelectionChanged(ByVal selection _ 
         As ChemDrawControl10Ctl.IChemDrawSelection) 
     If  Selection.brackets.Count < 1 OR Selection.Brackets.Count > 2 Then
         Exit Sub
     Else
         If 
Selection.Brackets.Count = 1 Then
             BracketNum = False
             Set vbracket1 =  ctlChemDraw.Selection.Objects.Brackets.Item(1)
         Else
             Set
vbracket1 =  ctlChemDraw.Selection.Objects.Brackets.Item(1)
             Set vbracket2 =  ctlChemDraw.Selection.Objects.Brackets.Item(2)
             BracketNum = True
         End If
     End If
 End Sub 

 Private Sub cboBracketUsage_Click()
   lblDescription.Visible = False
   txtInput.Visible = False
   Select Case cboBracketUsage.List(cboBracketUsage.ListIndex)
     Case Is = "Unspecified"
          vBracket1.BracketUsage = kCDBracketUsageUnspecified
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageUnspecified
          End If
     Case Is = "Any Polymer (anyp)"
          vBracket1.BracketUsage = kCDBracketUsageAnypolymer
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageAnypolymer
          End If
     Case Is = "Component (c)"
          lblDescription.Caption = "Order"
          'input must be an integer 
          vBracket1.ComponentOrder = val(Text1.Text)
          lblDescription.Visible = True
          txtInput.Visible = True
          vBracket1.BracketUsage = kCDBracketUsageComponent
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageComponent
          End If
     Case Is = "CoPolymer (co)"
          vBracket1.BracketUsage = kCDBracketUsageCopolymer
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageCopolymer
          End If
     Case Is = "CoPolymer, Alternating (alt)"
           vBracket1.BracketUsage = kCDBracketUsageCopolymerAlternating
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageCopolymerAlternating
          End If
     Case Is = "CoPolymer, Block (blk)"
           vBracket1.BracketUsage = kCDBracketUsageCopolymerBlock
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageCopolymerBlock
          End If
     Case Is = "CoPolymer, Random (ran)"
           vBracket1.BracketUsage = kCDBracketUsageCopolymerRandom
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageCopolymerRandom
          End If
     Case Is = "CrossLink (xl)"
          vBracket1.BracketUsage = kCDBracketUsageCrosslink
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageCrosslink
          End If
     Case Is = "Generic ()"
          vBracket1.BracketUsage = kCDBracketUsageGeneric
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageGeneric
          End If
     Case Is = "Graft (grf)"
          vBracket1.BracketUsage = kCDBracketUsageGraft
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageGraft
          End If
     Case Is = "Mer (mer)"
          vBracket1.BracketUsage = kCDBracketUsageMer
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageMer
          End If
     Case Is = "Mixture, Ordered (f)"
          vBracket1.BracketUsage = kCDBracketUsageMixtureOrdered
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageMixtureOrdered
          End If
     Case Is = "Mixture, UnOrdered (mix)"
          vBracket1.BracketUsage = kCDBracketUsageMixtureUnordered
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageMixtureUnordered
          End If
     Case Is = "Modification (mod)"
           vBracket1.BracketUsage = kCDBracketUsageModification
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageModification
          End If
     Case Is = "Monomer (mon)"
          vBracket1.BracketUsage = kCDBracketUsageMonomer
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageMonomer
          End If
     Case Is = "MultipleGroup (#)"
          lblDescription.Caption = "Repeat Count"
          vBracket1.RepeatCount = val(text1.text)
          lblDescription.Visible = True
          txtInput.Visible = True
          vBracket1.BracketUsage = kCDBracketUsageMultipleGroup
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageMultipleGroup
          End If
     Case Is = "SRU (n)"
          lblDescription.Caption = "SRU Label"
          vBracket1.SRULabel = val(Text1.text)
          lblDescription.Visible = True
          txtInput.Visible = True
          vBracket1.BracketUsage = kCDBracketUsageSRU
          If  BracketNum = True Then
              vBracket2.BracketUsage = kCDBracketUsageSRU
          End If
     End Select
 End Sub

See Also