Software Developer's Kit - ChemDraw

Send comments on this topic
Height Property
See Also 


Member of ChemDraw Control.Rect.

Sets and returns the height of this rectangle.

Property type

Read-write property


Visual Basic
Public Property Height() As Double

Return Type



This property sets and returns the height of a rectangle. This value is expressed in points and is equivalent to Bottom minus Top.


'This example illustrates the use of Rect Properties 
'Declares the variables

 Dim myObject  As ChemDrawControl10Ctl.Object
 Dim vObject As ChemDrawControl10Ctl.Object 
 Dim myRect  As ChemDrawControl10Ctl.Rect
'Checks that there is an object loaded in the variable
 If  Selection.Objects.Count < 1 Then 
     Exit Sub
 End If

'Works with one object (could be any ChemDraw object)
 For Each myObject In Selection.Objects
     If  myObject.Selected = True Then
vObject = myObject
     End If
Private Sub cmdRectProperties_Click()
     Set myRect = vObject.Bounds 
    'Shows the properties of Rect - using the rectangle that bounds an object
     Label2.Caption = "Rect coordinates that return values in IntermCoords" + Chr$(13) + _
                 Format(myRect.Bottom, "0.0") + Chr$(13) + _
                 Format(myRect.Height, "0.0") + Chr$(13) + _
                 Format(myRect.Left, "0.0")   + Chr$(13) + _
                 Format(myRect.Right, "0.0")  + Chr$(13) + _
                 Format(myRect.Top, "0.0")    + Chr$(13) + _
                 Format(myRect.Width, "0.0")  + Chr$(13)
    'Applies the IsEmpty property: Returns False if Rect contains an object 
     Text1.Text = myRect.IsEmpty 
 End Sub

See Also