LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Change 3D axe caption

Solved!
Go to solution

Hello everybody,

 

I have a second question, so i made a 3D graph and, according to the acquisition that i'll choose ( 2 mode ), the X and Y axes will change. So i want to program this change. I managed to change the X axis but i don't know how to select Y and change it.

 

Fonction use :

 

CWAxis3DSetCaption(AxisHandle, NULL, p_rev);

 

 

0 Kudos
Message 1 of 4
(4,737 Views)
Solution
Accepted by Bouyakaz

Start from the following example: 3DGraphAxis.cws (you’ll find it in the CVI library of examples). This example makes use of CWAxis3DSetCaption as well as several other CWAxis3DSet* functions.

 

Typically, these functions take an object reference, gAxis (your “AxisHandle”), to refer to the axis that will have its properties set. Example: CWAxis3DSetCaption(gAxis, NULL, caption).

 

To get the gAxis reference, you need to call:

CWAxes3DItem(axes, NULL, CA_VariantInt(axis + 1), &gAxis))

“axes” is of type CAObjHandle and is a handle to the ActiveX object associated to the axis;

“axis” is an integer (axis = 0 for the X axis, 1 for the Y axis and 2 for the Z axis);

(CA_VariantInt is just a function that converts integers to the variant type);

 

Now, how do you get “axes”? This way:

Declare it: CAObjHandle axes = 0; 

Then get it thanks to this function call: DCWGraph3DGetAxes(gGraph, NULL, &axes))

 

And if you also need to get a handle to the graph (but I suppose you already have one defined somewhere in your code), simply do:

CAObjHandle gGraph;   

GetObjHandleFromActiveXCtrl(gPanel, PANEL_CWGRAPH3D, &gGraph);

 

Have a look to the AxisCallback CVI callback in the source code of the example, you’ll see the piece of code that manage all these handles.

 

I hope this will help...

Pierre-Emmanuel BELLES
Certified LabVIEW Developper
Certified TestStand Architect

0 Kudos
Message 2 of 4
(4,709 Views)

Thanks for your answer, after some time on the exemple I find how to do it. Your explanation was very clear.

0 Kudos
Message 3 of 4
(4,699 Views)

You're welcome 🙂

I wish you a successful code development!

Pierre-Emmanuel BELLES
Certified LabVIEW Developper
Certified TestStand Architect

0 Kudos
Message 4 of 4
(4,677 Views)