CSV import macro

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

Moderator: DPlotAdmin

Post Reply
kdenney
Posts: 6
Joined: Thu Nov 20, 2014 10:44 pm

CSV import macro

Post by kdenney »

Hello,

First off, DPlot is great...nuff said.

I have a question regarding the import of csv data via macro. I plan to have many files with the same column format (X,Y,Z) and would like to generate a 3D surface contour. I can easily generate the graphs I need using either the excel plugin or manual import using File->New->3D Surface, but would like to autogenerate the graphs in the future. I thought the best way to do this would be using a macro. This is what I have so far:

Directory("C:\Path")
ForFilesIn("*.csv")
GetPreferences("Preferences")
FileSaveAs(1,".grf")
FileSaveAs("Portable Network Graphics",".png")
FileClose()
NextFile

It seems to do everything but read in the data correctly; it brings up the "Specify Columns to Plot" dialogue, and I check the appropriate boxes to specify which columns should be used for X and Y. However, it proceeds to generate an XY plot and seems to ignore the Z column (unless I specify to use it as the labels). Is there some way to let DPlot know that I am wanting to generate a 3D Surface plot from the data?

Many thanks for your help!

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

Post by DPlotAdmin »

Before the ForFilesIn line add

FileType(11)
Visualize Your Data
support@dplot.com
kdenney
Posts: 6
Joined: Thu Nov 20, 2014 10:44 pm

Post by kdenney »

Awesome! It works like a charm.

Thanks again!

-kd
Post Reply