Software Developer's Kit - ChemDraw

Send comments on this topic
ComponentOrder Property
See Also 

Description

Member of ChemDraw Control.Bracket.

Sets and returns the component order for this bracket.

Property type

Read-write property

Syntax

Visual Basic
Public Property ComponentOrder() As Long

Return Type

Long

Remarks

Component order (see BracketUsage) should be provided as consecutive positive integers starting at 1 within each Bracketed Group. 

A BracketUsage = kCDBracketUsageMixtureOrdered 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). Individual elements of an ordered mixture should be surrounded by brackets with a bracket usage of "Component (c)". 

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", ...).

A Component Order of zero indicates an unordered component. 

Example

'Declares variables
 Dim vbracket1 As ChemDrawControl10Ctl.bracket
 Dim vbracket2 As ChemDrawControl10Ctl.bracket 
'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
             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)
         End If
     End If
 End Sub 

 Private Sub cmdCommand1_Click()
     If  vBracket1.BracketUsage = kCDBracketUsageComponent
         lblDescription.Caption = "Order"
         vBracket1.ComponentOrder = Text1.text
     End Select
 End Sub

See Also