Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reference to additional plot in cwgraph3d?

Hi everyone,
 
I am currently working on a project that will require an additional plot overlay on top of the original plot.  I have already added an additional plot (plot-2) in the property page. However, I'm having some difficulty as how to reference to this plot when I'm writing up the code.  I am currently referencing to the graphs by:
 
graph3d.Plot3DParametricSurface(xData,yData,zData,vOptional);
 
With this reference, I can only work with the first plot (plot-1).  Can someone inform me on how to access my plot-2?  Any help will be greatly appreciated.
 
Currently working with Visual Basic C++ .NET with CW 3D Graph 7.0.
 
Thanks,
 
Allen
 
 

Message Edited by alchan on 09-27-2005 12:52 PM

0 Kudos
Message 1 of 7
(4,252 Views)

sorry i meant visual studio c++ .net

0 Kudos
Message 2 of 7
(4,247 Views)
The CNiGraph3D plotting methods are short cuts to the plotting methods on the first CNiPlot3D object in the CNiGraph3D::Plots collection. To plot data to another CNiPlot3D, you must obtain a reference to it and call a plot method directly on it. You use the Item method on the Plots collection to obtain a reference to an object in the collection. You can pass either a name or a one-based index to the Item method. In your case, either of the following lines should do the trick:
 
graph3d.Plots.Item("plot-2").Plot3DParametricSurface(xData,yData,zData,vOptional);
 
graph3d.Plots.Item(2).Plot3DParametricSurface(xData,yData,zData,vOptional);
 
 
0 Kudos
Message 3 of 7
(4,234 Views)
hi
 
thanks very much for your reply,
 
For some reasons I don't have the Plots method or any of its associated methods avaliable in my cw3dgraph.h file.  I am currently using the generated .h and .cpp files automatically generated when I added the cw3dgraph activeX object into my dialog (MFC application), based on  cw3dgrph.ocx (current 7.0).  Very confused.......
 
I have attached my cw3dgraph.h and cw3dgraph.cpp file.
 
Thanks again.
 
Allen
0 Kudos
Message 4 of 7
(4,234 Views)
This is a known issue with ActiveX wrapper generation in Visual C++ 2002 and later and is not specific to Measurement Studio controls. The issue is that Visual C++ 2002 and later generate only the top level objects for ActiveX controls. The National Instruments support topic Why Are the Microsoft Visual C++ .NET-Generated Wrappers for Measurement Studio ActiveX Controls Inc... documents this issue.
 
Is there a reason that you don't want to use the C++ wrapper classes that Measurement Studio provides?
0 Kudos
Message 5 of 7
(4,228 Views)
hi drohacek
 
thats very much for the info.  sorry about the newbie question as my first timeprogramming with visual c .net.  i'm using the visual c++ feature installed with MS and they fixed all the problems.
 
Once again, thanks
0 Kudos
Message 6 of 7
(4,213 Views)
I'm glad to hear that this got you going with Measurement Studio. Good luck with your project(s).
0 Kudos
Message 7 of 7
(4,210 Views)