• 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 PCB Editor
  3. Utility to output a single symbol from a design

Stats

  • Replies 4
  • Subscribers 159
  • Views 13486
  • Members are here 0
More Content

Utility to output a single symbol from a design

joma
joma over 8 years ago

jm_write_1_symbol_public.zip

Hi, I recently discovered the skill command "axlWritePackageFile( car(axlSelectByName("SYMTYPE" symbol-name))->definition )" which writes a single footprint
from a pcb. The good thing about it is it writes the symbol .dra and.psm files with all associated padstack files. I find this very handy from time to time. The bad thing

is it is a pain to be typing skill commands like this so I have created a user interface form to make things easier. As I have benefited from lots of utilities found in this
forum I thought I would contribute something of my own (however simple).

To load the code type "skill load("jm_write_1_symbol_public.il"). The file shoud be in your skill path.
To run the code type "write one symbol" on the command line.

All feedback welcome.

Load the Skill code using"skill load("RotateSilkAssyRD.il)" - See more at: community.cadence.com/.../17911
Load the Skill code using"skill load("RotateSilkAssyRD.il)" - See more at: community.cadence.com/.../17911
  • Sign in to reply
  • Cancel
  • eDave
    eDave over 8 years ago
    Hi Jim,

    Nice utility. Great example of the usefulness of Skill.

    I'm curious about the reason for putting functions inside functions. It's unusual to me but probable stems from your experience with other programming languages? If you do this you should avoid the duplicate use of variable names (SymForm).

    The statements putd('jmWriteOneSym nil) etc. are unnecessary I think. I am curious as to why you have done this. Is it regarded as good practice?

    A little known feature in 16.6 is the ability to create a form using a string. This would avoid the need to create a form file that you need to delete later.

    Cheers,
    Dave
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • joma
    joma over 8 years ago
    Hi Dave,

    Thanks for the feedback and I'm glad you like it.

    In fact the style comes from my inexperience and the the fact that I sometimes have had problems passing multiple returning values from functions to a calling function. I figure I can use one let() command to cover a group of functions and play happily with all of the variables without leaking globals. Probably not good practice but it seems to work. This gives just one warning in sklint but no errors so I was happy to stick with it. I think that as I get to grips with skill I will probably change to a more conventional style.

    The putd statements are just something I copied from another program from the forum assuming that they were useful. They probably are useless so if I create a version 1.1 I will delete them.

    Creating a form from a string is a better method. Do you know where I can read about this?

    Cheers,
    Jim
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 8 years ago
    A simple example for a string form:

    p = nil
    sprintf(p "FILE_TYPE=FORM_DEFN VERSION=2\tFORM\tFIXED\tPORT 50 10\tHEADER \"TITLE_OF_FORM\"\tTILE")
    sprintf(p "%s\tTEXT \"HELLO\" \tTLOC 2 1\t\tENDTEXT" p)
    sprintf(p "%s\tENDTILE\tENDFORM" p)
    defvar(fw_test nil)
    axlFormCreate( 'fw_test list("test_form" list(p)) '("CENTER" ) 'fw_callback t)
    axlFormDisplay(fw_test)

    basically you need to make 1 long string that contains the form. New lines need to be \t (tab), not \n or \r.
    Then you need to call axlFormCreate with this : list("test_form" list(p)) the "test_form" can be any string you like.
    The rest of the form function, creation, handling etc is equal to the file-based form.

    To return multiple variables you can or return a list like list( result_a result_b) and then use car() and cadr() to extract the results returned from the function
    Another way is to use a global.
    First you need to generate a global with defvar() and then at the end use var_name = 'unbind. The last statement unbinds/removes the global variable.
    Don't put this global variable into the let(), otherwise it won't work.

    A hint, you can use the form variable to store return values like;
    axlFormCreate( 'fw_test ....
    fw_test->test = "hello"

    and then you can recall the value by simply using 'fw_test->test'.
    Since in the above example the fw_test is a global, you can access it anywhere in your functions.

    Bram
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • joma
    joma over 8 years ago
    Thanks Bram, good info.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
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