• 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. Adding skill command to the toolbar incl. Icon

Stats

  • State Not Answered
  • Replies 11
  • Subscribers 21
  • Views 2794
  • Members are here 0
More Content

Adding skill command to the toolbar incl. Icon

PatEscher
PatEscher over 1 year ago

Hello, 
does anyone know if it is possible to add a skill command I created/registered to the toolbar and also assign an icon to it programmatically via skill?

No problem to add the skill commands as a menu (like the File menu for example)
No problem in manually adding the skill comman to the toolbar by going through View --> customize toolbar

But as said, I want to do it programmatically, as otherwise all our users have to do by themselves

Thanks, 

Patrick

  • Sign in to reply
  • Cancel
  • andakConsultingLtd
    0 andakConsultingLtd 4 months ago

    Hi,

    You can do it with a script. I just tested it. I was hoping to find an easier solution (like some env file settings, but did't work easily)

    things to do:

    1. You need an icon in bmp format

    2. I have my command in a top menu as well. I haven't tested without this. This is important since you need to have it listed when customizing things. Let me know if you don;t know how to create your own top menu

    3. on your machine, record the script like any other script, where you add this in the toolbar.

    4. you can run this script at startup using a SKILL, and using a variable to make sure it runs only once.

    5. I suggest you to have a cds_site location defined

    6. I suggest you define an icon location path in environment variables, it will make things easier

    that is it.

    my script code:

    # Allegro script
    #    file: C:/Users/andak/OneDrive/Work/allegroWork/icoTest.scr
    #    start time: Fri Apr 18 10:07:41 2025
    #    Version: 23.1-2023 S008 (4262797) Windows SPB 64-bit Edition
    version 23.1

    setwindow pcb
    trapsize 811
    display toolbar param
    QtSignal spbtoolbareditor spbtoolbareditor_tabView currentChanged Commands
    QtSignal spbtoolbareditor_commands spbcommandtab_toolcombo CurrentIndexChanged Display
    QtSignal spbtoolbareditor_commands spbcommandtab_add clicked
    QtSignal spbtoolselector spbcategory_list currentRowChanged 0
    QtSignal spbtoolselector spbcategory_list currentRowChanged 57
    QtSignal spbtoolselector spbcategory_list itemSelectionChanged KNEOS
    QtSignal spbcommand_table spbcommand_table_selectmodel currentChanged current 9 1 +
    QtSignal previous "-1" "-1"
    QtSignal spbcommand_table spbcommand_table_selectmodel currentRowChanged current 9 +
    QtSignal 1 previous "-1" "-1"
    QtSignal spbcommand_table spbcommand_table_selectmodel currentColumnChanged current +
    QtSignal 9 1 previous "-1" "-1"
    QtSignal spbcommand_table spbcommand_table_selectmodel selectionChanged selected 9 +
    QtSignal 0 9 1 9 2
    QtSignal spbtoolselector spbcommand_table cellClicked 9 1 9 1
    QtSignal spbcommand_table spbcommand_table_selectmodel currentChanged current 8 1 +
    QtSignal previous 9 1
    QtSignal spbcommand_table spbcommand_table_selectmodel currentRowChanged current 8 +
    QtSignal 1 previous 9 1
    QtSignal spbcommand_table spbcommand_table_selectmodel selectionChanged selected 8 +
    QtSignal 0 8 1 8 2 deselected 9 0 9 1 9 2
    QtSignal spbtoolselector spbcommand_table cellClicked 8 1 8 1
    QtSignal spbtoolselector spbcommandslct_add clicked
    QtSignal spbtoolselector spbcommandslct_close clicked
    QtSignal spbtoolbareditor_commands spbcommandtab_list currentRowChanged 7
    QtSignal spbtoolbareditor_commands spbcommandtab_list itemSelectionChanged "Fiber Wave"
    QtSignal spbtoolbareditor_commands spbcommandtab_icon_change clicked
    QtFillin "pcbenv/toolbar_icons/demoIco.bmp"
    QtSignal spbtoolbareditor spbtoolbareditor_closeBtn clicked

    #    stop time: Fri Apr 18 10:08:19 2025

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • andakConsultingLtd
    0 andakConsultingLtd 4 months ago in reply to Mhawley1

    Skill menus can be added easily (posting this for everyone else) and then follow the script reply I gave earlier. Launching a script from SKILL is easy too.

    Define a CDS_SITE system variable like shown below:

    test it with:

    create your corporate folder structure inside that folder (skill, scripts, icons, footprints etc).

    For this discussion you need this one:

    Q:\ADK_SITE\pcb\skill

    in this folder you need to do 2 things:

    1. in allegro.ilinit (create it if it's missing) add this line: load "company_name_menu.il"

    2.have a file named company_name_menu.il with a content like shown below:

    first item in the list is the name to display in the menu, the second item in the list is the alias you gave to your SKILL function, as shown at the bottom.

    file: company_name_menu.il

    KNEMenuList = '(
        (popup "KNEOS")
            ("DFA Check" "dfaer")
            ("Open Symbol's Lib Path" "ofl")
            ("WEB Search" "dbpi")
        )

    procedure( KNEMenuLoadTrig()
        ; add a new menu item before the help menu
        res = axlUIMenuRegister(-1 KNEMenuList)
    ) KNEMenuLoadTrig()

    DFA Check file entry, loaded in allegro.ilinit with load "dfaErrorCheck.il", to depict complete setup of top menu

    file: dfaErrorCheck.il

    axlCmdRegister( "dfaer" `dfaerMain)

    (defun dfaerMain ()
        printf("\nDFA error check by ANDAK CONSULTING LTD (c) 2019-2025.\n")
    ); end defun

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • PatEscher
    0 PatEscher 4 months ago in reply to andakConsultingLtd

    having a menu added through skill is not a problem. the question here is about the Toolbar itself, incl. Icon

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • PatEscher
    0 PatEscher 4 months ago in reply to andakConsultingLtd

    Thanks for this info.

    Whereas it might work using the scripting, it is for me more a kind of a 'workaround' rather than a real production solution.
    automating the UI and button clicks is not really something which should be used for real products (and it is even more worse in OrCAD, as here a lot of things have to be done through the UI)
    I think that Cadence has to come up with a real capability to do this.

    Anyways, thanks for that

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • andakConsultingLtd
    0 andakConsultingLtd 4 months ago in reply to PatEscher

    My pleasure.

    I agree with you, and, after digging a bit more I realized that this probably will not be easy to do in the future (Presto is coming). Adding an icon in the menu is GUI dependent which is release dependant. So I think we need to accept this limitation and move on.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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