Macro to copy and paste curve to same plot

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.
Post Reply
rodgiles
Posts: 3
Joined: Mon Aug 05, 2013 7:43 am

Macro to copy and paste curve to same plot

Post by rodgiles »

Hi,

I'm trying to 'copy and paste' the data from curve 1 to a new curve in the same plot using a macro. The code I have is..

>
SelectCurve(1)
CopyText()
Paste()
>
But either nothing gets copied to the clipboard or DPlot crashes, I'm using version 2.3.4.3. What am I doing wrong?

Thanks,

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

Post by DPlotAdmin »

What am I doing wrong?
I've no idea. I tried this just now and it worked fine. Can you save your graph as a DPlot file and send it to me?
Visualize Your Data
support@dplot.com
rodgiles
Posts: 3
Joined: Mon Aug 05, 2013 7:43 am

Re: Macro to copy and paste curve to same plot

Post by rodgiles »

Hi,

I tried the code snippet with a test plot containing 4 points and it copied and pasted without problems. When I try with the actual data, it fails to copy. Could it be a problem using data copied from another plot file? If I copy the data to a new plot using the edit:Move/Copy Curves command, then either the SelectCurve(1) or CopyText() commands do not work (I can't tell where the Macro stops). There's nothing in the clipboard.

This is the complete code listing of the Macro I'm trying to create:

Code: Select all

EditOperateX("x/360+0.5")
SelectCurve(1)
CopyText()
Paste()
SelectCurve(2)
EditOperateX("x+1")
CombineCurves(1,2,1,0)
SelectCurve(1)
CopyText()
Paste()
SelectCurve(2)
EditOperateX("x+2")
CombineCurves(1,2,1,0)
SelectCurve(1)
CopyText()
Paste()
SelectCurve(2)
EditOperateX("x+4")
CombineCurves(1,2,1,0)
SelectCurve(1)
CopyText()
Paste()
SelectCurve(2)
EditOperateX("x+8")
CombineCurves(1,2,1,0)
FFTMethod(1)
SelectCurve(1)
FFT()
It's a simple code to create an FFT of a roundness plot. I'm using the EditOperate() and CombineCurves() commands to create 16 repeats of the original curve and then carry out an FFT to find the order components of the out of roundness. I have measurement points at 0.5 degree intervals, hence 721 points per dataset. Needless to say I have a large number of roundness datasets to process and I would like to use a macro to speed the process up.

Best Regards,

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

Post by DPlotAdmin »

I threw together an example and used your macro and it all worked fine, up until the FFT() command - which did nothing. It failed because the points are not evenly-spaced (but it won't tell you that when running from a macro). You can easily confirm whether that's the problem by running your macro, then manually trying an FFT.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Any luck? News? Whatever?
Visualize Your Data
support@dplot.com
Post Reply