Page 1 of 1

3DR dPlot_ZFromXY and AddData command

Posted: Wed Feb 08, 2006 9:55 am
by Tom Chien
David,

1. I tried to run AddData fast for repeated process by [code]dPlot_AddData(DocNum, DATA_3DR, 900, 1, NULL, X) ;
dPlot_Command(DocNum,"[GenerateMesh(120,120,-0.5,-0.5,29.5,29.5,0,1,4)]") ;
DocNum++ ;
dPlot_Command(DocNum,"[FileSaveAs(1,\"surfaceMax.grf\")]") ;
dPlot_Command(2, "[FileClose()]")[/code]
Run the code repeatedly will get some orderly (partial) error data either at plot1 or plot2. If I add [code]
dPlot_Command(1, "[FileClose()]") <= 0)
[/code], then it works perfect.
What my app does is to completely modify whole data set by using AddData. I am not hurry on this issue. It just take one command more but seems to me not logical, do you?

2. This one is quite essential for me. I used
[code]dPlot_AddData(1, DATA_3DR, 3360, 1, NULL, sdgZone.data) ;
dPlot_ZFromXY(DocNum, fgd[dmax].gridNo % 120, 2 + (double)fgd[dmax].dayOffset/60, &fgd[dmax].data) ;
[/code] It gave return code (-2) for "ZFromXY". Then I tried[code]
dPlot_Plot(&DPlot, NULL, sdgZone.data, NULL) ;
dPlot_ZFromXY(DocNum, fgd[dmax].gridNo % 120, 2 + (double)fgd[dmax].dayOffset/60, &fgd[dmax].data) ;[/code] It runs perfect.
But the data I get is linear Z value between 2 points as manual describes. Does any way to get contour value shown on the display instead of linear since that is the real purpose od 3DR? If this case resolved some app which needs only some Z value will not go for GenerateMesh which is very expensive way.
Thanks your product and your time again!

Tom Chien

Posted: Thu Feb 09, 2006 9:43 am
by DPlotAdmin
1. I'm not completely sure I understand what is going on there, but if your code appears exactly as you've shown and you aren't resetting DocNum to 1 at the top of the loop, then you're continuously incrementing it so that you're creating a new (additional) document with every pass. So you'd get an error after the 31st or 32nd loop.

2. That's a good suggestion, but not something I'm prepared to do in a hurry. I'll add it to my to-do list.

Posted: Thu Feb 09, 2006 10:47 am
by Tom Chien
David,

Thanks for the promp answer at "2".
About "1", I did try[code]dPlot_AddData(1, DATA_3DR, 900, 1, NULL, X) ;
[/code]. Please try if you have time.

Tom