• 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. Custom IC SKILL
  3. deRegUserTriggers

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 14269
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

deRegUserTriggers

Michael85
Michael85 over 13 years ago

Hi,

I'm trying to add a new button to the layout tool bar.

This is the code I wrote for that:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;   Start the script only if layout view is opened   ;;  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
deRegUserTriggers( "maskLayout" nil nil 'AddCleanButton)
deRegUserTriggers( "maskLayoutXL" nil nil 'AddCleanButton)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;       This procedure adds a new button            ;;  
;;          to the tool bar of Layout Suite.         ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure( AddCleanButton(nul)

 let((Clean_Button toolbar new win_ID win_ID match)
 
  match = 0
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;Create new tool bar button;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        Clean_Button = hiLoadIconFile( "/layout/home/ms36/icons/32x32/broom_icon.png" 32 32 );Load icon
        toolbar = hiCreateToolbar(?name 'toolbar ?title "Remove unused nets");Create a new tool bar
        new=hiCreateAction(?name 'Remove_Unused_Nets_and_Terminals ?icon Clean_Button ?callback  "RemoveUnusedNetsAndTerminals()");Create an action for the clean button
        hiAddToolbarItem(toolbar new);Add the clean_button to the tool bar
        win_ID = hiGetCurrentWindow() ;Recive the current window Id
  tool_bar_list= hiGetWindowToolbars(win_ID);Gets the list of toolbars that a window contains.
  foreach(tool_bar tool_bar_list
  tool_bar_name = tool_bar~>_title
  if(tool_bar_name == "Remove unused nets" then
   match = 1
  );End if(tool_bar_name == "Remove unused nets")
  );End foreach
  if(match == 0 then
                hiPlaceToolbar(win_ID toolbar 'top);Define the location of the tool bar
  )         
  );let
)

It's working fine, when I'm openning the layout\layoutXl cell view from Library Manager.

But when i'm trying to open layoutXL view from the layout view, the tool bar button disappears  from the layout view and is not added to the layoutXL view.

What should I do in order to prevent that? 

 Thanks,

         Michael

 

  • Cancel
Parents
  • skillUser
    skillUser over 13 years ago

    Hi Michael,

    Rather than throwing away the argument to the trigger function ('nul' in your code), use this to obtain the window ID, perhaps call the argument "args" and use "args->window" to get the window - I'm not saying this will solve the issue, but you will eliminate the chance of picking up the wrong window id this way.  If this does not solve the issue, put some print statements in the trigger function to follow what is happening (e.g. print out each variable to see if you are getting what you would expect).

    Hopefully this will help you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 13 years ago

    Hi Michael,

    Rather than throwing away the argument to the trigger function ('nul' in your code), use this to obtain the window ID, perhaps call the argument "args" and use "args->window" to get the window - I'm not saying this will solve the issue, but you will eliminate the chance of picking up the wrong window id this way.  If this does not solve the issue, put some print statements in the trigger function to follow what is happening (e.g. print out each variable to see if you are getting what you would expect).

    Hopefully this will help you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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