Home > Community > Forums > PCB SKILL > Help needed with scripting - Renaming of file from within allegro

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Help needed with scripting - Renaming of file from within allegro 

Last post Wed, Jun 13 2012 8:09 PM by VijayVela. 4 replies.
Started by VijayVela 10 Jun 2012 09:21 PM. Topic has 4 replies and 2315 views
Page 1 of 1 (5 items)
Sort Posts:
  • Sun, Jun 10 2012 9:21 PM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Help needed with scripting - Renaming of file from within allegro Reply

    Hi,
    Is it posible to have Allegro script rename a file from a specified directory?
    I have a recorded script that performs several processing.
    Part of it is to plot a few artwork in pdf format (default printer being a pdf printer).
    What I want to do is to pause after each plotting, rename the output file and then resume with the next artwork to plot.
    Is this posible? If yes, could you please help explain to me on how to do this?

    Thanking you in advance.

     Regards,

    Vijay Anandh Vela

    • Post Points: 35
  • Wed, Jun 13 2012 2:28 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    RE: Help needed with scripting - Renaming of file from within allegro Reply
    Hello Vijay Anandh,

    You  can use the function renameFile( "old file name with path" "new file name with path" )

    Pawan
    • Post Points: 20
  • Wed, Jun 13 2012 7:53 PM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Re: RE: Help needed with scripting - Renaming of file from within allegro Reply

    Hi Pawan,

    Thanks. The rename works for me now.
    The only problem I have now is that I would need to pause in between each plot.
    What happens is that, the script runs faster than the renaming process which results in errors in the subsequent artwork plot.

    Is there a command available to pause allegro before moving on to the next artwork plot?

    plot artwork1 --> pause (3 seconds) --> rename --> pause (3 seconds)
    plot artwork2 --> pause (3 seconds) --> rename --> pause (3 seconds)
    ...
    ..

    Thanks.

     Regards,
    Vijay Anandh Vela

    • Post Points: 5
  • Wed, Jun 13 2012 7:58 PM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    RE: RE: Help needed with scripting - Renaming of file from within allegro Reply
    Hello Vijay Anandh,

    In normal circumstances the program will not step ahead until it finishes the current statement.

    Can you please post your code so that we can have a look at it?

    Pawan
    • Post Points: 20
  • Wed, Jun 13 2012 8:09 PM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Re: RE: RE: Help needed with scripting - Renaming of file from within allegro Reply

    Hi Pawan,

    Below is the script:

    # Allegro script
    # file: C:/Vijay/PCB LAYOUT/plotPDF.scr
    # start time: Thu Jun 14 09:30:37 2012
    # Version: 16.3 S040 (v16-3-85CQ) i86
    version 16.3

    setwindow pcb
    trapsize 26899
    setwindow form.vf_vis
    FORM vf_vis colorview_list Film: Fab1
    setwindow pcb
    plot setup
    setwindow form.fpfileplotsetup
    FORM fpfileplotsetup fpplotmirror NO
    FORM fpfileplotsetup done
    setwindow pcb
    plotwint initialize "Adobe PDF"
    plotwint orientation 2
    plotwint papername "11 x 17"
    plotwint scale 100
    plotwint copies 1
    plotwint defaultsource 15
    plotwint printquality 600
    plotwint color 2
    plotwint execute
    skill
    skill 'renameFile("C:/postprocess/projects/cam350/Allegro.pdf" "C:/postprocess/projects/cam350/fab1.pdf")'
    skill exit
    setwindow form.vf_vis
    FORM vf_vis colorview_list Film: Fab2
    setwindow pcb
    plotwint initialize "Adobe PDF"
    plotwint orientation 2
    plotwint papername "11 x 17"
    plotwint scale 100
    plotwint copies 1
    plotwint defaultsource 15
    plotwint printquality 600
    plotwint color 2
    plotwint execute
    skill
    skill 'renameFile("C:/postprocess/projects/cam350/Allegro.pdf" "C:/postprocess/projects/cam350/fab2.pdf")'
    skill exit
    setwindow form.vf_vis
    FORM vf_vis colorview_list Film: Asy1
    setwindow pcb
    plotwint initialize "Adobe PDF"
    plotwint orientation 2
    plotwint papername "11 x 17"
    plotwint scale 100
    plotwint copies 1
    plotwint defaultsource 15
    plotwint printquality 600
    plotwint color 2
    plotwint execute
    skill
    skill 'renameFile("C:/postprocess/projects/cam350/Allegro.pdf" "C:/postprocess/projects/cam350/asy1.pdf")'
    skill exit
    setwindow form.vf_vis
    FORM vf_vis colorview_list Film: Asy2
    setwindow pcb
    plot setup
    setwindow form.fpfileplotsetup
    FORM fpfileplotsetup fpplotmirror YES
    FORM fpfileplotsetup done 
    setwindow pcb
    plotwint initialize "Adobe PDF"
    plotwint orientation 2
    plotwint papername "11 x 17"
    plotwint scale 100
    plotwint copies 1
    plotwint defaultsource 15
    plotwint printquality 600
    plotwint color 2
    plotwint execute
    skill
    skill 'renameFile("C:/postprocess/projects/cam350/Allegro.pdf" "C:/postprocess/projects/cam350/asy2.pdf")'
    skill exit

    # stop time: Thu Jun 14 09:36:25 2012

    Thanks.

     Regards,

    Vijay Anandh Vela

    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by VijayVela at 10 Jun 2012 09:21 PM. Topic has 4 replies.