Home > Community > Forums > PCB SKILL > Changing the artwork output dir

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: *

 Changing the artwork output dir 

Last post Fri, May 3 2013 1:00 AM by Ejlersen. 7 replies.
Started by Adamsen 11 Jun 2012 04:49 AM. Topic has 7 replies and 3252 views
Page 1 of 1 (8 items)
Sort Posts:
  • Mon, Jun 11 2012 4:49 AM

    • Adamsen
    • Not Ranked
    • Joined on Tue, May 22 2012
    • Posts 8
    • Points 245
    Changing the artwork output dir Reply

    I want to write artworks to a design dependent output directory.

    I have a script to create artworks,  

    olddir = "output"
    outdir = "output/123456-ND-A"
    axlSetVariable("ads_sdart" outdir)  ; set working directory to output directory
     sprintf(script
     "scriptmode +i +n +w +c\n
     setwindow pcb\n
     artwork\n
     setwindow form.film_control\n
     FORM film_control select_all\n

     FORM film_control database_check YES\n
     FORM film_control create\n
     setwindow form.film_control\n
     FORM film_control ok\n
     setwindow pcb\n ")  ;end sprintf
     
     COD_replay_script(script)

     axlSetVariable("ads_sdart" olddir)  ;  

    If I set "ads_sdart" using setup user preferences, it works fine. If I use this script, the artworks is generated in "output" and art_param.txt is generated in "output/123456-ND-A". That does not make any sense to me. Any surgestions?

    Alternatively I could move the files afterwards, but that requires much more unessesary coding.

    • Post Points: 20
  • Wed, Jun 13 2012 2:24 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    RE: Changing the artwork output dir Reply
    Hi Adam,

    I am assuming that there exists a directory named “output\123456-ND-A” where your brd file is saved and you want to save all the files to “123456-ND-A”

    I don’t know how are u calling the COD_replay_script(script) function in your code and you haven’t provided your complete code.

    Try running the below SKILL code. It should save all the files in the “output\123456-ND-A” directory.

     
    defun( pawan ()

    olddir = "output"

    outdir = "output/123456-ND-A"

    axlSetVariable("ads_sdart" outdir)

    axlShell("setwindow pcb")

    axlShell("trapsize 3215")

    axlShell("generaledit")

    axlShell("artwork")

    axlShell("setwindow form.film_control")

    axlShell("FORM film_control select_all")

    axlShell("FORM film_control create")

    axlShell("setwindow form.film_control")

    axlShell("FORM film_control ok")

    axlShell("setwindow pcb")

    axlShell("generaledit")

    axlSetVariable("ads_sdart" olddir)  ;

    )

     

    Pawan
    • Post Points: 20
  • Wed, Jun 13 2012 10:56 PM

    • Adamsen
    • Not Ranked
    • Joined on Tue, May 22 2012
    • Posts 8
    • Points 245
    Re: RE: Changing the artwork output dir Reply

    Hello Pawan

    Thanks, for your input. The assumptions you made are correct. The dir structure looks like this, and they exists, at the time I run the script.
    123456.brd/output/123456-ND-A

    I tried running your script. But the result are the same for me.
    123456.brd
    /output/*.art
    /output/123456-ND-A/art_param.txt
    The artwork files are still in the output dir (which "ads_sdart" is set to in site.env), only the art_param.txt is in the output/123456-ND-A dir.

    COD_replay_script makes a scriptfile and replays it.
    procedure( COD_replay_script(cmds)
    let((script_file)
     script_file = axlDMOpenFile("ALLEGRO_SCRIPT", "tmp", "w")
     fprintf(script_file "scriptmode +i +n +w +c\n")
     fprintf(script_file cmds)
     fprintf(script_file "\n")
     axlDMClose(script_file)
     
     if( isFile( "tmp.scr")
     then
      axlShell("replay tmp")
      deleteFile("tmp.scr")
     else
      printf("tmp.scr not found\n")
     ) ;end if
      
    ) ;end let
    ) ; end procedure 

     

    • Post Points: 20
  • Thu, Jun 14 2012 10:26 PM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    RE: RE: Changing the artwork output dir Reply
    Hello Adam,

    I got the desired results as you wanted it to be. Please refer to my code along with the dummy files that I generated in the attachment. I have used my code instead of yours. I am not sure where the problem exists.

    All files(*.art and art_param.txt) are generated in C:\pawan\output\123456-ND-A

    My board file resides in C:\pawan\test.brd

    In case you still see problems, please try to manually do the changes to “ads_sdart” env and see if you are able to do so and generate the artwork files in the any other path you define here.

    Pawan
    • Post Points: 20
  • Mon, Jun 18 2012 2:00 AM

    • Adamsen
    • Not Ranked
    • Joined on Tue, May 22 2012
    • Posts 8
    • Points 245
    Re: RE: RE: Changing the artwork output dir Reply

    Hello Pawan.

    I tried to exactly as you described. Made a new board, put you script with the board, created output and output/123456-ND-A.

    Running your script I get same result as before. *.art in output and art_param.txt in output/123456-ND-A. When i set ”ads_sdart” manually it works as desired.

    Thank you for testing this. I will now open this as a support case, and take it from there.

    • Post Points: 20
  • Thu, May 2 2013 12:25 PM

    • wilef
    • Not Ranked
    • Joined on Sat, May 16 2009
    • Posts 6
    • Points 90
    Re: RE: RE: Changing the artwork output dir Reply
    I have the same issue.  Did a hotfix update this issue?
    • Post Points: 20
  • Thu, May 2 2013 11:10 PM

    • Adamsen
    • Not Ranked
    • Joined on Tue, May 22 2012
    • Posts 8
    • Points 245
    Re: RE: RE: Changing the artwork output dir Reply

    Hello Wilef.

     Here is the answer I got from support.

    I have checked this with our Skill Expert and this is what he has to say on this.
    "This is not a problem with the SKILL function. Setting the variable with SKILL in this way sets the variable for the current session. When you generate artwork it calls an external application which reads the env file. Setting the variable with the SKIILL function does not change the env file.
    If you look at this variable in the preferences editor you will see that it requires a restart of Allegro to take effect.
    If the customer really wants to control this with SKILL then they must create a function that parses and updates the env file."

    I ended up with writing a function that copies the files from "ads_sdart"

    I dont know, if it has been changed since. This was in June 2012.

    • Post Points: 20
  • Fri, May 3 2013 1:00 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: RE: RE: Changing the artwork output dir Reply

    Hi

    This can easily be solved using a new 16.6 skill command named "axlSetVariableFile"

    This command will make the change to the local env fil and hence a restart won't be necessary.

    I've used this with success for other path variables like psmpath and padpath

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by Adamsen at 11 Jun 2012 04:49 AM. Topic has 7 replies.