Flexibility and the ability to customize the software/environment to your own personal needs is a definite strength of Cadence® software, and the Allegro® platform is no different. Whether you are developing your own SKILL program to make a detailed flow easier; automating a tedious, but routine, task; or just reordering commands in the menu to match your usage flow, Allegro offers you what you need. Best of all, it comes packaged in a way that you can integrate your own tools seamlessly into the core environment.
This is one of those questions I get asked regularly. It's a great opportunity to refresh those of you who are long-time SKILL users while also introducing the growing community of new users alike. Customizing with SKILL is extremely powerful; it is, almost unexpectedly, simple at the same time. For the sake of brevity, I will assume that you’ve already developed your SKILL tool, and that it has a top-level function call, (myFunc), which we will use here.
Phase 1: Making Your Skill Function a Command
It is not necessary to make your SKILL function a command to add it to the menu, but doing so will reap other benefits that make it worth your while. As an interactive command, for instance, if a user is running your feature and then starts another command, yours will automatically receive a done event to finish up and save the command's work before exiting so the user can seamlessly start the new feature. It also permits you register your command for undo/redo support.
Register your function as a new command using the axlCmdRegister function. You can find the fill details for this command, and all of the axl commands used in this post, in your installation hierarchy here:
%CDS_SITE%/share/pcb/examples/skill/DOC/FUNCS
An example call for axlCmdRegister is given below. The first argument is the name of your command, the second is the name of your top-level function. All other arguments are optional, allowing you to specify whether the command is interactive (stops the current command) or immediate (can be run any time), the function to call on a done or cancel event, and whether your command should be undoable. A simple line to register the command, then, might be:
(axlCmdRegister “my command” ‘myFunc ?cmdType “interactive” ?undo t)
You will normally add this in your allegro.ilinit file, which is read every time you launch the tool. If you don’t yet have an ilinit file, check out the example to get you started here:
%CDS_SITE%/share/local/pcb/skill/example.ilinit
Phase 2: Adding Your Command to a Menu
Once you have your command established, it’s time to put it into the menus. If you have different licenses – Allegro, OrCAD, and SiP, for example – you can choose to add the menu only in certain tools, or only when editing specific drawing types. Maybe your command is only useful when designing a new DRA file. Whatever your decisions, using SKILL to customize the menu dynamically is simple and can seamlessly keep up as you download new hotfixes (ISRs), QIRs, or entire releases.
The axlUIMenu series of commands gives you the ability to add new menus and items, change the text of an existing entry, or even delete a command if it is something you never use. For full details on all these commands, see the documentation. The basic commands are:
- axlUIMenuFind– Finds the location of an item in the menus. By using it, you can find and position your command near other, similar items.
- axlUIMenuInsert– Adds a new item into the menus relative to where you found another.
- axlUIMenuChange– Changes information, like the displayed menu text, for a found menu entry.
- axlUIMenuDelete– Deletes a found entry from the menu.
An example for adding the new function into the edit menu above the delete command is below. You can add this either to your same ilinit file directly, or you can create a SKILL file that contains this and add a line in your ilinit file to load your SKILL function, instead. This keeps the ilinit file small and compact.
(defun loadMyMenu (t_menuName)
(when (axlVersion ‘isAllegroDesigner)
(axlUIMenuFind nil "delete")
(axlUIMenuInsert nil "My First Command" "my command")
);when
);defun
(axlTriggerSet ‘menu ‘loadMyMenu)
The axlTriggerSet line at the bottom registers your loadMyMenu function to be called any time menus are reloaded. As a bonus, this example looks at the tool version running to only show your command when in Allegro PCB Designer.
Once you’ve added everything to your allegro.ilinit file and corresponding SKILL source files, note that you’ll have to restart the software to see the effect. Make sure things are working, because the next step is where it all comes together.
Phase 3: Adding a Toolbar Icon
You’ve got your command, and now you’ve got it in the menu. Those are all the prerequisites to adding your command to a toolbar! If this is a command that you and your team run very frequently, it makes sense to have it in a toolbar. That might be one of the existing toolbars, like the routing or shape editing sets, or you may wish to define a toolbar that’s specific to your team.
Bring up the toolbar customization interface, found at View – Customize Toolbar… It will look similar to the below:
If you want to define a team toolbar, simply click New and give it a name. It will then be shown in the toolbars list at the bottom, beneath the standard toolbars (you can rename it later if you want to). In the above, I have added MyToolbar to hold the new command’s button.
After adding your toolbar to the list, move to the Commands tab, and select your toolbar (or an existing one, if you want to add to the route or another default toolbar strip) to add a command to. Click Add Command… to bring up the list of available menu commands to add:
The categories on the left are all the menus and sub-menus present, sorted left to right and top to bottom. This makes it easy to find your command from the hundreds of menu entries in the tool. Navigate to its menu and either click the command and click Add, or just double-click. It will be placed into your selected toolbar. You can continue to add commands without closing this window. Click Close when you’re finished to return to the main page. Don’t worry about ordering, you can change the order in the main page after you’ve added all the commands you want.
One important note! For commands without an associated icon (sorry, you can’t add a custom bitmap icon for your command today), the toolbar button will display the menu entry text for the command. This is great in that it keeps the menu and toolbar consistent. But, if you plan to have a lot of custom icons, longer text may make the buttons larger than you want. Shorten the menu text for a shorter, smaller toolbar button.
Wrapping Up
You can add as many custom commands, toolbar buttons, and menu item entries as you like to the tool. Using SKILL to add them will make sure that they are available in whatever release of Allegro layout editor you’re working with, and only the product options and design types that make sense for the command. If you add a command to a toolbar strip, but the current product plus layout type doesn’t include the command, the button will automatically be suppressed to keep things as clean and uncluttered as possible. In the most recent releases of 17.2, you also have the ability (See the View – UI Settings... sub-menu) to save different toolbar and window arrangements for different tasks you perform. You may want one organization for team design review and sign-off, but another for doing your day to day routing work. Don't manually move things around every time; set things up once and save that arrangement with a name that you can go back to at any time.
Hopefully, this gives you a good start to taking the standard Allegro tool and making it sleek, focused, and optimized for your day to day work. The better the tool works for you, the faster you can get your job done. That time saved makes you, and us, happy.