• 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. Undo within a function OR interactive undo command with...

Stats

  • Replies 0
  • Subscribers 160
  • Views 13389
  • Members are here 0
More Content

Undo within a function OR interactive undo command with function having key parameters

EvanShultz
EvanShultz over 4 years ago

I have written a function that works great. It accepts one required string argument and one a second string argument can be provided if desired. The second parameter is using the @key keyword.

The code loops through each symbol in a design and manipulates graphical elements. (Just explaining that I haven't used axlDBCloak().)

Because I wrote this function after the introduction of the Design Workflow, I added an entry in that XML file which calls the function directly. I did not find a reason to need to use axlCmdRegister(). The workflow entry contains a genericized section that looks like command="skill myFunction("thing1" ?optionalArgument "thing2")".

That works fine. But I'd like to be able to undo the changes in my function. Since everything happens in one fell swoop, there is no real need for user interaction. What would work is in my function ran to completion and could be undone with a single-click from the standard Allegro undo menu. Just a single undo for everything.

From the documentation, that appears to require axlCmdRegister() in interactive mode with the undo argument given. To check this, however, I added x_mark = axlDBTransactionStart() at the start of my function and two lines with axlDBTransactionMark(x_mark) and axlDBTransactionCommit(x_mark) at the end of the function. x_mark is in the let() statement local to the function, but if I make it global there seems to be no effect.

That does nothing. Allegro's undo button is greyed out after running my function. There is not a transaction being added to the Allegro stack that can be undone.

So then I added axlCmdRegister("myFunction" 'myFunction ?cmdType "interactive" ?undo t) to my SKILL code in the hope that I could use the default (read: simple) undo function which would seem to do everything that I wanted. Then instead of calling my function directly from the Design Workflow I can use the command interface to my function and get the same result. But no. When I try myFunction thing1 I get an issue about arguments in the console unless I specifically make the second argument default to nil in the function definition (which usually doesn't need to be done). With myFunction thing1 thing2 and myFunction thing1 ?optionalArgument thing2 the console shows that there are extra arguments or a keyword missing. So none of those work or I've done something wrong.

I can see two ways to implement the undo feature I would like, which I described above:

1. Keep my existing function and make it have an undo feature.

2. Register my function and give it the generic undo feature.

I have tried to describe my experiments toward making either option above work. I have not been successful. Maybe someone can give me a hand to fix my error above? Or perhaps there's another way that I haven't tried? Any help is appreciated! Thank you all!

  • 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