• 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. how to add the skill code to banner menu of layout window...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 15970
  • 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

how to add the skill code to banner menu of layout window by giving the input as the path

Sri Charan B
Sri Charan B over 13 years ago

 Hi,

I have got a code written to add the banner menu(like the File, Edit etc.,) but the problem i am facing here is that i need to add the whole skill codes which i want them to be added in that pull down menu, the following is the code which i am using,

procedure(CharanAddMenu(_args)
  let( (item1 item2)
    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "Name_1" ?callback "skill_code_1()")
    item2 = hiCreateMenuItem( ?name 'item2 ?itemText "Name_2" ?callback "skill_code_2()")
    list(hiCreatePulldownMenu('CharanMenu "Charan Menu" list(item1 item2)))
  )
)
deRegUserTriggers("maskLayout" nil 'CharanAddMenu)

in the above code skill_code_*() refers to the skill code which i need to add to this code

and the Name_* refers to the name to be displayed for that particular code in my banner menu.

So if i want to add a new function to this i am supposed to add that code here and this goes on increasing if i want add more and more functions to my menu. Instead of this i want to call the function by passing the path (or the file name) to my above code which makes my job easier by just adding the path of the function (or by just passing the file name).

Some one please help me,

Thanks in advance,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    I'm not really sure I understand your question.

    You can have the code which defines the functions skill_code_1() and skill_code_2() completely separate from the code which defines your menus. That code can be loaded using load("fileContaining_skill_code_1_definition.il") and so on. I'm assuming the callback is a function defined using procedure() or defun() or similar?

    You can also define an autoload property on a symbol:

    skill_code_1.autoload="fileContaining_skill_code_1_definition.il"

    and then the first time somebody calls skill_code_1() it will load the file to try to define the function.

    But I'm guessing a bit here because I don't really understand what you're trying to do.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago

    Hi Andrew,

    Thank you very much for your quick reply, and apologies for my delay in the reply.

    The actual thing i am trying to do here is that i want to create my personalized menu in the layout window like file, edit, view, etc., where all my skill codes which ever i have written are to be in that menu(for example "Charan" be the name of the menu and it has all the skill codes which i have with me in it).

    When i click on that menu a drop box of all the skill codes (code1 performs some action and code2 which performs another action and so on..)which ever i have with me are to be loaded into that and by clicking on the item in that menu should  get my work done without loading my code in the ciw window using the 'load' command everytime i need that code to be run on my layout window.

    I hope that this might clear your doubt on what is my objective actually.

    Once again I would ask apologies for the delay in my respose.

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    In general you don't really want to have to keep loading code to get the job - that suggests that you've not written functions to do the job, but just have some kind of script. If you define functions in your SKILL code, using the procedure() or defun() type function, then you only need to load it once (at startup, say), and then your menu can call CharanDoThis() or CharanDoThat(). 

    If you really want to load the code each time, because it's a script, you can always make the menu callback:

    ?callback "load(\"/path/to/charanDoThisScript.il\")"

    and so on.

    I don't think I really understand what your problem is - I understand what you're trying to do, but I don't understand why you're unable to do this.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago
    Hi Andrew,

    I am still not able to figure it out. I am pasting the code which i have been trying on

    procedure(CharanAddMenu(_args)
      let( (item1 item2)
        item1 = hiCreateMenuItem( ?name 'item1 ?itemText "to_do_this1" ?callback "load(\"/path/my_code1.il")"")
        item2 = hiCreateMenuItem( ?name 'item2 ?itemText "to_do_this2" ?callback "load(\"/path/my_code2.il")"")
        list(hiCreatePulldownMenu('CharMenu "CHARAN Menu" list(item1 item2)))
      )
    )
    deRegUserTriggers("maskLayout" nil 'RPAddMenu)

    while using the above code it is generating the following error


    *Error* lineread/read: syntax error encountered in input

    *Error* eval: unbound variable - item1

    *WARNING* (reader): extra ')' ignored at line 6 of file *ciwInPort*

    *WARNING* (reader): extra ')' ignored at line 7 of file *ciwInPort*


     please help me to figure it out.

    Thanks in advance,
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Fairly clearly the quotes are wrong in the ?callback. I'm surprised you didn't notice that. Secondly, your deRegUserTriggers is registering a different function name than the one you've defined. So it should be:

    procedure(CharanAddMenu(_args)
      let( (item1 item2)
        item1 = hiCreateMenuItem( ?name 'item1 ?itemText "to_do_this1" ?callback "load(\"/path/my_code1.il\")")
        item2 = hiCreateMenuItem( ?name 'item2 ?itemText "to_do_this2" ?callback "load(\"/path/my_code2.il\")")
        list(hiCreatePulldownMenu('CharMenu "CHARAN Menu" list(item1 item2)))
      )
    )
    deRegUserTriggers("maskLayout" nil 'CharanAddMenu)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sri Charan B
    Sri Charan B over 13 years ago

    Hi Andrew,

    I did not check the quotes. Now that you pointed me the mistake the job is done.

    Thank you for your support and co-operation.

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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