How to Draw Polygons Programmatically

Have a need to draw polygons (eventually filled ones!) programmatically on a display and update the vertices.  

Has anyone done this or have any insights into how to do it?  My poking and prodding around in the BOL turned up how to interactively move the vertices, but nothing on doing it programmatically.  If that's in the BOL, a pointer to the right location would be be appreciated...

Oh, BTW v10+ is the 'region of interest'.

Thanks!

1 Reply

  • I don't think there is any easy way to do what you want on a display.  The key word there being "display".  If it is a pop-up VB form, you have access to the VB drawing primitives and can do what you want.  However, on a DeltaV Operate display, you have to work with what DeltaV Operate exposes through iFix.  For the most part, that means you have programmatic access to object properties but the vertices of a polygon are not exposed as properties.

    You could programmatically build (or make visible/invisible) the "polygon" by using separate line segments and move the "vertices" by setting the StartX, StartY, EndX, and EndY  properties of each line segment.  I'm not sure if there is a way to fill the resulting enclosed region or not since iFix will just see it as a bunch line that happen to touch each other.