Home > Community > Forums > PCB SKILL > Is it possible to pass variables to script from inside SKILL function

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

 Is it possible to pass variables to script from inside SKILL function 

Last post Mon, May 21 2012 9:16 AM by Kadar. 5 replies.
Started by Kadar 21 May 2012 06:40 AM. Topic has 5 replies.
Page 1 of 1 (6 items)
Sort Posts:
  • Mon, May 21 2012 6:40 AM

    • Kadar
    • Top 500 Contributor
    • Joined on Mon, Jun 6 2011
    • Haifa, Israel
    • Posts 24
    • Points 360
    Is it possible to pass variables to script from inside SKILL function Reply

    Hello everybody,

    Is it possible to pass variables to script from inside SKILL function,

    And then replay the script??

    Thanks

    EVGY

    • Post Points: 35
  • Mon, May 21 2012 6:56 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 83
    • Points 1,135
    RE: Is it possible to pass variables to script from inside SKILL function Reply

    Hi,

    You can use the output of function axlUIPrompt to store in your variable.

    Pawan

    • Post Points: 20
  • Mon, May 21 2012 7:09 AM

    • Kadar
    • Top 500 Contributor
    • Joined on Mon, Jun 6 2011
    • Haifa, Israel
    • Posts 24
    • Points 360
    Re: RE: Is it possible to pass variables to script from inside SKILL function Reply

    Hi Pawan,

    I want to record script and then replay it but with another value.

    For example i want to export DXF file so i go to : File -> Script -> Record

    I record the script filling the form window with name "First".

    Now i want to export DXF file named "Second" using the same script,

    So i want the name  "Second" to be filled instead of "First".

    Is it possible to do so?

    BR,

    EVGY

     

    • Post Points: 20
  • Mon, May 21 2012 7:47 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 83
    • Points 1,135
    RE: Re: RE: Is it possible to pass variables to script from inside SKILL function Reply
    Hi,
     
    You should consider generating dxf using your recorded script with a temporary file name and then renaming this file using your skill(both task performed in a single SKILL code).
    For renaming a file there is a function available

    renameFile( "old" "new" )

    Pawan
    • Post Points: 5
  • Mon, May 21 2012 8:49 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 253
    • Points 4,060
    Re: RE: Is it possible to pass variables to script from inside SKILL function Reply

    You can utilize Allegro variable substitution.

    - Record a starting script

    - edit the file to add variable substitutioncapability

    Example if you want dxf output file to be variable in your just recorded script you will see a line the script like:

       FORM dxf_out dxffile foo

    Change this to take advantage of variable substitution:

       FORM dxf_out dxffile $mydxfile

     Now you can either call this script from another script or take advantage of command chaining to set the variable

    "set mydxffile foo; replay myscript"

    If you worry about the script being called without the variable being set add before the variable an ifnvar line  to defauly the variable to a default value:

      ifnvar  mydxfile "set mydxfile foo"

    • Post Points: 20
  • Mon, May 21 2012 9:16 AM

    • Kadar
    • Top 500 Contributor
    • Joined on Mon, Jun 6 2011
    • Haifa, Israel
    • Posts 24
    • Points 360
    Re: RE: Is it possible to pass variables to script from inside SKILL function Reply

     You've understood my question in exact way!!!

    Crystal clear answer!!!!

    Huge thank YOU !!!

    BR,

    EVGY 

     

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by Kadar at 21 May 2012 06:40 AM. Topic has 5 replies.