View previous topic :: View next topic |
Author |
Message |
rodgiles
Joined: 05 Aug 2013 Posts: 3
|
Posted: Mon Dec 02, 2013 9:23 am Post subject: Macro to copy and paste curve to same plot |
|
|
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 |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Mon Dec 02, 2013 12:21 pm Post subject: |
|
|
Quote: | 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 |
|
Back to top |
|
|
rodgiles
Joined: 05 Aug 2013 Posts: 3
|
Posted: Tue Dec 03, 2013 4:11 am Post subject: Re: Macro to copy and paste curve to same plot |
|
|
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: | 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 |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Tue Dec 03, 2013 1:19 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Thu Dec 05, 2013 6:58 pm Post subject: |
|
|
Any luck? News? Whatever? _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|