Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I read plot data back from a CWGraph3D object?

I am using the ComponentWorks 3D Graph 8.0 object in some C# code, implementing the Plot3DCurve() function to create the graph. Is it possible to 'read back' the data from my graph? i.e. return the 3 arrays of data used to create the graph? I want the equivalent of the XYPlot.GetXData() and XYPlot.GetYData() functions I use for 2D graphs.

 

I could get round my problem by just storing the arrays when I produce the graph so I can access the data later but this does seem like a waste of memory when the graph object must be storing that data too.

 

Thanks for any help.

CAS

0 Kudos
Message 1 of 4
(3,846 Views)

Hi CAS

 

I hope this finds you well. I do not think there is any need to use a function to read back the arrays from the graph in this situation, since there is not going to be any extra memory used up by the graph. The reason being that in ComponentWorks, things are done by reference, rather than using up more memory. Therefore, the graph is merely referencing the location of the data that has been stored already, rather than storing new data and using more memory.

 

I hope this helps!

 

Kind Regards

Jeremy T
Technical Marketing
NI
0 Kudos
Message 2 of 4
(3,773 Views)

Hi Jeremy

 

Thanks for your reply but the structure of my code is such that I don't retain the original data array after plotting the graph and so cannot access it. For a bit of background, the user can load data from file, process it and plot the graph. They can then load different data and/or apply different processing which populates the arrays with the new data. However, the first graph can still be visible and I want the user to be able to save the graph data to file despite the fact that I have loaded new data in to the arrays.

 

I have got round the problem by just storing the plot data to local arrays whenever I produce a plot but this must mean that I'm using twice as much memory - whch could pose a problem with the amounts of data I am handling.

 

CAS

 

 

0 Kudos
Message 3 of 4
(3,769 Views)
Hi CAS,

I have taken over this forum post as Jeremy is unavailable just now. Having looked at the code for the ComponentWorks 3D Graph object, one of the Data Items that you could use would be the CNiPlots3D data member to access the Plots object for this class.

Could you possibly provide a little more information on the setup you currently have on your PC? Which versions of Visual Studio are you using? Which version of Measurement Studio are you currently using?

Could you also attach your code to this forum so I can have a look at how you are using this object?

Many thanks,
Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,735 Views)