Software Developer's Kit - ChemDraw

Send comments on this topic
Position Property
See Also 


Member of ChemDraw Control.ObjectTag.

Sets and returns the position of this ObjectTag.

Property type

Read-write property


Visual Basic
Public Property Position() As Point

Return Type



The position of the object is given as a point, which is the Top Left corner of the rectangle that bounds that object. It is indicated by (x, y, z) coordinates expressed as CurCoords. If the object is an arrow, position coincides with the end point of the arrow.


'Declares variable vObject
'Object can be any ChemDraw object
 Dim vObject As ChemDrawControl10Ctl.Object
'Checks that there is an Object loaded in the variable
 If  Selection.Objects.Count < 1 Then
     Exit Sub
 End If
 Private Sub cmdPosition_click()
'Reads the X & Y coordinates of the Object´s Position point 
     Text1.text = vObject.Position.X
     Text2.text = vObject.Position.Y
    'Example to ASSIGN values to the X & Y coordinates of the Object´s Position point 
     Dim myPoint As ChemDrawControl10Ctl.Point
     Set myPoint = vObject.Position
     myPoint.X = 350
     myPoint.Y = 150
     vObject.Position = myPoint
     Label1.Caption = "Position" + chr$(13) + _
            Format(vObject.Position.X, "0.0") + " Position X" + Chr$(13) + _
            Format(vObject.Position.Y, "0.0") + " Position Y" + Chr$(13)
 End Sub

See Also