data points command

VBA and general Excel Q&A and examples

Moderator: DPlotAdmin

Post Reply
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

data points command

Post by seppli »

Hi there

I was searching for the command, which shows the data points in a 3d surface plot (black, rectangular points), in the manual, but I somehow could not find it. Does somebody has found it?

Thanks for your help.

Cheers seppli
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

SymbolType(1,<anything other than 0>)
Visualize Your Data
support@dplot.com
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

Post by seppli »

Thank you very much for your help! It's great to have such a nice support here!

Cheers
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

Saving Problems

Post by seppli »

I'm sorry, but I have one more question.

I'm using for the xyz surface plot the script which is included in dplotlib.xla. At the end of the script I want to save the plot, which I generated, with this command:

ret = DPlot_Command(doc, "[Directory("C:\My Documents\")]")
ret = DPlot_Command(doc, "[FileSaveAs(1,"|TITLE1||TITLE2|.grf")]")

but this is ending in a error message like "Syntax error". What I'm doing wrong?

many thanks in previous

seppli
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The quotation marks are fouling things up. Quotation marks are used to delineate the entire command string, as well as any character string arguments within a command.

So instead of this:
ret = DPlot_Command(doc, "[Directory("C:\My Documents\")]")

you'll need to do something like this:
ret = DPlot_Command(doc, "[Directory(""C:\My Documents\"")]")

which is more or less equivalent to this (which may make it clearer):
ret = DPlot_Command(doc, "[Directory(" & chr$(34) & "C:\My Documents\" & chr$(34) & ")]")
Visualize Your Data
support@dplot.com
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

Post by seppli »

Ah yes :) thank you for your help. As you see I'm not a very experienced vba programmer. It is now perfectly working. But if I am using replaceable Parameters in the FileSiveAs command like "|TITLE1|" I get an error message: "Null result for replaceable parameter |TITLE1| in FileSaveAs command. Why?

have a nice day

seppli
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The error indicates that your plot has no first title line... except that's not correct. I tried an example just now and get the same message with a plot that definitely has a title. I obviously fouled something up in a recent release. Sorry for the trouble, will fix this in the next release.
Visualize Your Data
support@dplot.com
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

Post by seppli »

Yes that's why I was a bit confused, because my plot has a first title line... But thank you for your help and your nice support!
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

ContourLevels Command with Variables

Post by seppli »

Thanks for the new release!
I'm sorry to disturb you again, but i have one more question regarding my excel macro.
I'm using a surface plot, and I want to force the countour levels with the following command: [ContourLevels(a,b,c)] a,b,c are variables defined as Public Integer in an other Sub. I always get en error when I use these variables in the command, when I put numbers in it, it works.

Can you help me? Thanks and have a nice day.

seppli
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

All of the commands sent to DPlot via DPlot_Command are character strings. So this will work:

Code: Select all

ret=DPlot_Command(doc,"[ContourLevels(20,0,1000)]")
but the following will give an error, as you've already found:

Code: Select all

Dim a as Long
Dim b as Double
Dim c as Double

a=20
b=0
c=1000

ret=DPlot_Command(doc,"[ContourLevels(a,b,c)]")
(In this case you aren't really sending the variables a, b, c, you're sending the character string "a,b,c")

What you want is something like this:

Code: Select all

Dim a as Long
Dim b as Double
Dim c as Double

a=20
b=0
c=1000

ret=DPlot_Command(doc,"[ContourLevels(" & str$(a) & "," & str$(b) & "," & str$(c) & ")]")

Visualize Your Data
support@dplot.com
seppli
Posts: 7
Joined: Mon Jun 29, 2009 11:08 am

Post by seppli »

ah ok, thank for your help! It is now perfectly working :-)
Post Reply