• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - Skill
  3. Creating Context File

Stats

  • Replies 7
  • Subscribers 17
  • Views 15948
  • Members are here 0
More Content

Creating Context File

EMperson
EMperson over 7 years ago

The process for creating context files is unclear to me. I've read the sklanguser.pdf summary, but I'm confused on a few things:

1) How to set up the Directory Structure. If I want to create the context file "HelloWorld.cxt", where should the file "HelloWorld.il" go?

2) I keep getting the error "can't access startup.il". Where should that file be stored? What should the contents of startup.il be?

I just need a super concise, easy tutorial of how to create a context file. Thanks!!

  • Cancel
  • Sign in to reply
Parents
  • eDave
    eDave over 7 years ago

    I agree, the documentation makes it sound difficult.

    This is a simple way of doing it:

    In a DOS shell, cd to your Skill folder

    Run Allegro Skill by typing:

    il_allegro

    Name your context file:

    setContext("My_context")

    load your Skill file(s) needed to run the code (normally only one):

    load("mySkillFile.il"); This is what startup.il does - you would add a load statement for each Skill file.

    define the initiation process:

    defInitProc("My_context", 'myFunction); Where myFunction is the name of the procedure/function that you want to call in your Skill file.

    Protect your code:

    sstatus(writeProtect t)

    saveContext("My_context.cxt")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EMperson
    EMperson over 7 years ago in reply to eDave

    Thanks, this is super helpful! One last thing-- I need to load my code into Allegro PCB Designer, and my code has a command I created using  axlCmdRegister. So how do I load my "My_Context.cxt" file into Allegro, and then run a command?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 7 years ago in reply to EMperson

    Where you previously would have used "load", use "loadContext".

    Be aware that 17.2 context files are in a 64bit folder.

    Run your command the same way as before.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EMperson
    EMperson over 7 years ago in reply to eDave

    I read somewhere that axlCmdRegister() cannot be included in a context file... How do I still use commands?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 7 years ago in reply to EMperson

    I always register commands in the allegro.ilinit file - not the Skill file itself unless I'm debugging.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EMperson
    EMperson over 7 years ago in reply to eDave

    Do you have to create your own .ilinit file? Where should the allegro.init file be? I read a different post that says to check where the ALLEGRO_ SITE variable but I don't know where that is...

    Would you mind posting how to find the allegro.iliinit file, as well as example code of registering commands in the allegro.ilinit file? Thanks Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 7 years ago in reply to EMperson

    The allegro.ilinit file resides in your Skill path.

    Type "set" on the Allegro command line to get the settings of all your variables. Find allegro_site. The skill folder is a subdirectory of that folder.

    Here's an example:

    loadContext("AutosilkUtils_public.cxt")
    axlCmdRegister("silkutils_public" 'ASU_start ?cmdType "interactive")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • eDave
    eDave over 7 years ago in reply to EMperson

    The allegro.ilinit file resides in your Skill path.

    Type "set" on the Allegro command line to get the settings of all your variables. Find allegro_site. The skill folder is a subdirectory of that folder.

    Here's an example:

    loadContext("AutosilkUtils_public.cxt")
    axlCmdRegister("silkutils_public" 'ASU_start ?cmdType "interactive")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information