use a same document

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
simply
Posts: 40
Joined: Mon Sep 25, 2006 1:53 pm

use a same document

Post by simply »

Hi David,
Is there a way to use an existing document(if exists) to create a new plot????
I don't want to call DPlot_Command(DocNum, "[FileClose()]"), unless the program is closed.
________
Last edited by simply on Mon Sep 12, 2011 2:08 pm, edited 2 times in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'm not sure I understand your question. If you want to add a curve to an exiting XY plot then you should call DPlot_AddData rather than DPlot_Plot or any of its derivatives. If instead you're talking about a) replacing existing curves in an XY plot but keeping all of the plot settings or b) replacing a 3D surface with a new 3D surface but, again, keeping all of the plot settings, then probably the best way to do that is with [SavePreferences("filename")], [DPlotPlot(....)], [GetPreferences("filename")].

If I've misunderstood what you're trying to do please let me know.
Visualize Your Data
support@dplot.com
simply
Posts: 40
Joined: Mon Sep 25, 2006 1:53 pm

Post by simply »

I don't want to add a curve, I want to plot a new one.
If I execute 2 programs that use dplot, when I close one of them, I call dplot_stop, and dplot is closed, and if the second program try to plot a new graph dplot is opened in visible mode. All my programs close documents after creating them(without saving files).

Dplot is closed cause there is no opened files, so i have two possible solutions.
1) I don't close a file after using it, but i use the same file(document) each time).
2) to oblige dplot start hidden by default???may be there is something to put in the ini file????
________
Last edited by simply on Mon Sep 12, 2011 2:08 pm, edited 2 times in total.
simply
Posts: 40
Joined: Mon Sep 25, 2006 1:53 pm

Post by simply »

is there a solution???
________
Last edited by simply on Mon Sep 12, 2011 2:09 pm, edited 2 times in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Sorry - this is getting more, rather than less, confusing for me. It sounds like you don't so much care that a new curve is placed in a new document, you just don't want DPlot to be visible when that happens. Is that correct? If so, just have your second program start DPlot hidden in the same way that your first program did, with DPlot_Start(1,WasActive)
Visualize Your Data
support@dplot.com
simply
Posts: 40
Joined: Mon Sep 25, 2006 1:53 pm

Post by simply »

Sorry for confusion, i "still" have to improve my english :cry:
DPlotAdmin wrote:Sorry - this is getting more, rather than less, confusing for me. It sounds like you don't so much care that a new curve is placed in a new document, you just don't want DPlot to be visible when that happens. Is that correct? If so, just have your second program start DPlot hidden in the same way that your first program did, with DPlot_Start(1,WasActive)
Yes, I want dplot to remain hidden after the first program is closed(the 2 program were opened).
Of course I start dplot with DPlot_Start(1,WasActive), but the problem is that when dplot is closed(by my first program), and after that my second program call a new dplot command, then dplot is re-opened unhidden.

PS:My programs create a plot than close the file after getting the plot in the pictureBox, so when the first program call dplot_stop, there is no opened file, so dplot is closed, even if there is other programs that still can use it.
________
Last edited by simply on Mon Sep 12, 2011 2:08 pm, edited 2 times in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Your English is fine, please don't worry about that.
...but the problem is that when dplot is closed(by my first program), and after that my second program call a new dplot command, then dplot is re-opened unhidden.
In the 2nd program check to see if DPlot is open before calling DPlot_Plot (or whatever other function you're using). The return value of DPlot_Start is the window handle for the application. You can check to see if that window is still open with IsWindow(hwndDPlot). That isn't entirely reliable as some other application might reuse the window handle after DPlot is closed. A better way is with FindWindow("DPLOT",0&) (or FindWindow("DPLOTJR",0&) in the case of DPlot Jr). If FindWindow returns 0, you know DPlot has been shut down. If so, start it with DPlot_Start(1,WasActive).
Visualize Your Data
support@dplot.com
simply
Posts: 40
Joined: Mon Sep 25, 2006 1:53 pm

Post by simply »

DPlotAdmin wrote: A better way is with FindWindow("DPLOT",0&) (or FindWindow("DPLOTJR",0&) in the case of DPlot Jr). If FindWindow returns 0, you know DPlot has been shut down. If so, start it with DPlot_Start(1,WasActive).
It works, thanks
________
Post Reply