Creating an iFIX Shape with a VBA Script

Use the following script to create a shape through a VBA script:

Dim Pic As Object

Dim Shape As Object

 

Set Pic = Application.ActiveDocument.Page

Shape.HorizontalPosition = 10

Shape.VerticalPosition = 10

Shape.Width = 30

Shape.Height = 30

Shape.ForegroundColor = RGB( 255, 0, 0 )

The BuildObject method creates the object. Once the object is created, you can perform one of these options:

  • Set the object's properties through VBA code.
  • Call the CreateWithMouse method (as in the above example) to change your mouse cursor into the draw cursor and then configure the properties of the object using the traditional iFIX user interface.