08-28-2010 12:25 PM
Hi,
I'm using the ActiveX plotting function to show a 3D illustration of impedance vs frequency vs time. Everything works fine. Now I want to add a second plot to the same graph without removing the first. I read and tried everything/topic in this board already but I just can't persuade CVI 😞 I'm using the Plots3DAdd command for this. Every single plot PLOT1 & PLOT2 works if I comment the second one. But together I'm always getting a positve (0) return value for Plots3DAdd, but a negative one (-274...) for the second Plot3DSurface command.
The interesting part of my code is in the following:
// 1-dimensional arrys xVt, yVt, 2-dimensional zVt
GetObjHandleFromActiveXCtrl(panelHandle, PANEL_GRAPH3D, &graphHandle);
CW3DGraphLib__DCWGraph3DGetPlots(graphHandle, NULL, &plotsHandle);
CW3DGraphLib_CWPlots3DItem(plotsHandle, NULL, CA_VariantInt(1),&plotHandle);
// PLOT1
CW3DGraphLib_CWPlot3DPlot3DSurface(plotHandle,NULL,xVt,Test,zVt,CA_DEFAULT_VAL);
// Add a 2nd plot
retval=CW3DGraphLib_CWPlots3DAdd(plotsHandle,NULL,¤tPlot);
// PLOT2
retval=CW3DGraphLib_CWPlot3DPlot3DSurface(currentPlot,NULL,xVt,yVt,zVt,CA_DEFAULT_VAL);
It will soon drive me crazy as this problem already occupies me for 3 days. I'd really appreciate every help or hint!
Thanks for reading!
Solved! Go to Solution.
08-29-2010 07:31 AM
Hi Michael,
did you include a call to CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE) ?
08-29-2010 10:11 AM
Hi Wolfgang,
thank you for your reply! I did so as well in the "Edit ActiveX control" menue in the gui as in the code. I didn't mention it in the code example above, because it did not change anything in the result. I just tried again and still got a negative return value and no plot. Is there anything else which might block / suppress the correct output.
Thanks.
08-30-2010 10:27 AM
Hi Michael,
I think you were pretty close. I attached an example how to use multiple plots in 1 graph. I think you have to call the Add function first before you actually plot something.
Hope this helps!
08-30-2010 11:35 AM
Hi Andreas,
thank you so much for your effort. I tried to implement this into my code - it doesn't work. Then I finally put this into an older save file and I got the desired results! The only difference between both of them is that I'm using the NIReport ActiveX driver in the current version of my software. Could this maybe be an incompatibility? I will find out during the next days and repost!
Thank you all for your help!