LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CWgraph annotation and shape

I am trying to dynamically change the coordinates of an annotation rectangle, and none of the functions seem to be working. Setcoordinates changes nothing and even get X coordinates returns nothing. Anyone have any suggestions?
0 Kudos
Message 1 of 3
(3,048 Views)
Verdrax,

I tried this our and it seemed to work correctly. Here's the small section of code that I used (you'll have to put the coordinates of max, min, imax, and imin to your code):

Dim max As Variant, min As Variant, imax As Variant, imin As Variant
CWGraph1.Annotations.Add
Set CWGraph1.Annotations(1).Plot = CWGraph1.Plots(1)
CWGraph1.Annotations(1).Name = "Minimum"
CWGraph1.Annotations("Minimum").Shape.Type = cwShapeRectangle
CWGraph1.Annotations("Minimum").Shape.XCoordinates = Array(min, max)
CWGraph1.Annotations("Minimum").Shape.YCoordinates = Array(imin, imax)

If that doesn't work for you, please let us know.

Regards,
Shannon R
Application Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,048 Views)
Thank you for the response. Unfortunately I am using CVI and I am not exactly sure how to translate your VB code example into the C functions provided in CVI. However, I finally stumbled on the solution and all is well now. My mistake was that I was trying to use the annotation handle to manipulate the shape when in fact I needed to use "GetShape" and retrieve yet another handle for the shape portion of annotation.So effectively shape manipulation is 4 handles deep...whew. This revelation really opened my eyes to all the possibilities using activeX.
0 Kudos
Message 3 of 3
(3,048 Views)