T O P I C R E V I E W |
richardljohnsonjr |
Posted - 02/26/2010 : 2:59:55 PM Origin Ver. and Service Release: Origin Pro 8.1 SR1 Operating System: Windows Vista 32 bit
I have xyz data that I plot into a xyz contour plot and want to be able to compute the area of the xy projection for specific contour lines. As I haven't discovered any built in support for this I intend to write a function that extracts the contour lines and uses a polygon area algorithm on the points. The contour plot window itself provides a method for extracting the contour lines into a worksheet via a shortcut menu, but I would like to do this programatically. I can't find any examples of how to go about this in the documentation. |
6 L A T E S T R E P L I E S (Newest First) |
cpyang |
Posted - 03/05/2010 : 4:58:00 PM Yes, you need to wait for WM_PAINT to come in to draw the plots, and if there is no idle, that message will not come through.
You can try adding a delay in your code, like
LT_execute("sec -p 0.2");
CP
|
richardljohnsonjr |
Posted - 03/05/2010 : 10:11:16 AM The example was very helpful and i've nearly got it all working. The problem I'm now having is that I can't seem to generate the contour plot and extract the contour lines in a single function call. For example I have a function loadData() that loads in the contour data from my database and generates the contour plot. I have another function computeArea() that locates the contour plot and then extracts the contour lines and computes the areas. If I call theses functions separately from the command line everything works fine. If however I call computeArea() from inside loadData(), I get a return value of 0 from ExtractContourData. It is as if there is some asynchronous calls that generate the contour plot that I need to wait to complete before trying to extract the contour lines. If so how do I go about doing this?
|
Penn |
Posted - 03/03/2010 : 01:28:25 AM Hi,
The function ocmath_d_polygon_area can be used to calculate polygon area.
I have made some changes in this example. Hope it helpful in your case.
Penn OriginLab Technical Services |
Penn |
Posted - 03/02/2010 : 10:03:52 PM Hi,
This method is not listed in the CHM help files yet, that is why you cannot find it in the help document. Sorry for the inconvenience.
Now, it has been added to the newest CHM help files and will be bundled with the coming version.
Penn OriginLab Technical Services |
richardljohnsonjr |
Posted - 03/02/2010 : 09:30:03 AM Thanks for the response, FYI- I double checked, and this method is not listed in the help files that were bundled with the download I installed. I assume this is a relatively recent addition to the DataPlot class and must have gotten overlooked.
|
Penn |
Posted - 03/02/2010 : 04:42:54 AM Hi, There is a method in DataPlot class for extracting contour data, DataPlot::ExtractContourData. Please refer to the following page.
http://ocwiki.originlab.com/index.php?title=OriginC:DataPlot-ExtractContourData
Penn OriginLab Technical Services |