Software Developer's Kit - ChemDraw

Send comments on this topic
Inflate Method
See Also 
dx
dx is a double number which is the number of points (expressed in internal coordinates) to expand in the x direction
dy
dy is a double number which is the number of points (expressed in internal coordinates) to shift in the y direction

Description

Member of ChemDraw Control.Rect.

Expands this rectangle.  

Syntax

Visual Basic
Public Sub Inflate( _
   ByVal dx As Double, _
   ByVal dy As Double _
) 

Parameters

dx
dx is a double number which is the number of points (expressed in internal coordinates) to expand in the x direction
dy
dy is a double number which is the number of points (expressed in internal coordinates) to shift in the y direction

Return Type

Rect

Remarks

Inflate expands a rectangle by a specified number of points. Inflate subtracts half (dx,dy) from the left and top edges, and adds half (dx,dy) to the right and bottom edges. If the rectangle is bounding an object, this method does not modify the object.

Example

'Declares variable vObject
 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
'Loads the last object selected into the variable
 For Each myObject In Selection.Objects
     If  myObject.Selected = True Then
         Set vObject = myObject
     End If
 Next  
'------------------------------------------------------------- 

 Private Sub cmdInflate_Click()   
    'Example of Rect.Inflate
     Set myRect = vObject.Bounds
     X = InputBox("These values are verified:" + Chr$(13) + _
         "[Variable].Bounds.TopLeft.X" + Chr$(13) + _

         "[Variable].Bounds.BottomRight.X" + Chr(13) & Chr(13) + _
         "dx is expressed in points = CurCoords * 20", _
         "INFLATE - Please input value for dx", _

         Format(Val(vObject.Bounds.TopLeft.Y), "0.00"))
     Y = InputBox("These values are verified:" + Chr$(13) + _
         "[Variable].Bounds.TopLeft.Y" + Chr$(13) + _

         "[Variable].Bounds.BottomRight.Y" + Chr(13) & Chr(13) + _
         "dy is expressed in points = CurCoords * 20", _
         "INFLATE - Please input value for dy", _

         Format(Val(vObject.Bounds.BottomRight.Y), "0.00")) Y
    'Applies the inflate method
     myRect.Inflate X, Y
    'Shows the coordinates of the inflated rectangle
     vMessage = MsgBox("Rectangle after INFLATE" + _
               Chr$(13) + "NEW.TopLeft.X: " & Format(myRect.TopLeft.X, "###.##") & _
               Chr(13) & "NEW.TopLeft.Y: " & Format(myRect.TopLeft.Y, "###.##") & _
               Chr(13) & "NEW.BottomRight.X: " & Format(myRect.BottomRight.X, "###.##") & _
               Chr(13) & "NEW.BottomRight.Y: " & Format(myRect.BottomRight.Y, "###.##"), _
               vbInformation + vbOKOnly, "Loaded in another Rectangle variable")  

 End Sub           

 

See Also