After refering to the analogartist reference, i have copie the simui.menus to my home directory( or work directory), and modify it to add a menu in Tools by add this line ("mytool" ?callback()) in the Tools section of the simui.menus file, but this menu did not turn up when the analogArtist stratup. it seems that the default menus are loaded in ADE. Does anyone know the reason? when i use the command ddGetStartupAll("menus"), the result shows ("~/menu"), i think it is the menu folder which i placed in my home folder. i got quite confused about how to add a user menu in ADE, thanks for explaining this method to me.
by the way, i have load this menu by adding this line "load("~/menu/simui.menus")" in my .cdsinit.
In responce of your question. I already succeeded to add my menu item on the top of the ADE window. Follow the instruction:
1. Create folder "menus" in your home dyrektory.
2. Create file spectre.menus in the folder "menus"
3. Put following text in spectre.menus, it creates custom menu item "Example" with 3 submenus: Item1, Item2 and Item3:
load(prependInstallPath("/etc/tools/menus/spectre.menus"))(sevSetMainWindowPulldownMenus `( "Session" "Setup" "Analyses" "Variables" "Outputs" "Simulation" "Results" "Tools" "Example" "Help" ))(sevAddMenuItemLists (lambda (session name) (case name ("Example" list( hiCreateMenuItem( ?name 'MenuItem_1 ?itemText "Item1" ?callback "println('Item1)" ;;; prints Item1 in the CIW ;this is only trial function callback ) hiCreateMenuItem(
?callback "println('Item2)" ;;; prints Item2 in the CIW
;this is only trial function callback
?callback "println('Item3)" ;;; prints Item3 in the CIW
;this is only trial function callback
) ) ) ;Example
) ; case ) ; lambda ) ; sevAddMenuItemLists
In reply to tyanata:
In reply to imagesensor123:
1. First with this expression
you load the original sepctre menus, and after that on its base you make your custom settings.
2. Here I post how to create custom subitem in Tools menu. Create spectre.menus file with following text.
;------------------------------------------------------------------------; Example of extending the spectre menu Tools and add new subitem "My_menu";------------------------------------------------------------------------ load(prependInstallPath("/etc/tools/menus/spectre.menus")) ; redefine the top level menus - this time putting; a space after "Tools " to distinguish it from original "Tools"(sevSetMainWindowPulldownMenus `( "Session" "Setup" "Analyses" "Variables" "Outputs" "Simulation" "Results" "Tools " "Help" ))(sevAddMenuItemLists (lambda (session name) (case name; Example of creating submenu in menu item "Tools "exchanging oringinal "Tools" menu! ;------------------------------------------------------------------------; now define the "Tools " menu, appending the; new stuff to the already defined "Tools" menu items...; Also replace existing items;------------------------------------------------------------------------ ("Tools " menu_list = (sevMenuItems session "Tools") new = list( hiCreateMenuItem( ?name 'My_MenuItem ?itemText "My_menu" ?callback "println('My_menu)" ;;; prints My_menu in the CIW ;this is only trial function callback ) ) menu_list = append(menu_list new) ) ; Tools ) ; case ) ; lambda ) ; sevAddMenuItemLists
The approach of replacing the "Tools" menu with "Tools " is something that I came up with - it's in solution 11286092
This solution has an example with lots of comments (it's for Simulation rather than Tools, but it's the same idea) which explain why you are doing this. It's trying to avoid having to reimplement the whole of the standard menu in the local customization - it inherits from the one in the installation. So it has to load it first, and then be able to find out the contents of the existing Tools (or Simulation in my case) menu and build on that.
Since the sevAddMenuItemLists is defining a function to call which builds the menu info, if you call the menu the same (no space), then it will only ever find yours, and not the standard one. There are ways around this, but they currently require private functions.
The reason for the quoting is because if you look closely, you'll see that the backquote (i.e. "`") is being used. This is similar to the forward quote, in that it stops the list after it being evaluated except when the symbol is preceded by a comma or comma-at. This allows values to be spliced into the list that is built, without disturbing the structure. The best way to explain this is probably to look at my solution on macros. Rather than me reinventing the wheel and repeating it here!
Your questions are difficult for me to answer (I am not very experienced in SKILL also). I just found the solution of the task using the both solutions from the Cadence support which I posted in my topic as base for my work.
Currently I have to cope with another problem in Cadence environment which I use, in ADE there is a custom button created in some script from our foundry. I want to disable it using the approach bellow but it seems that this button is loaded some time (several seconds) after ADE launching so I could not disable it using this approach.
The script itself works because after this button is created on my ADE if I load commands one by one in CIW this button is deleted.
So can you say how to postpone execution of my scripts let's say with 10 seconds.
procedure(triggerScriptLoad(ADE_WindowID) ADE_WindowID=hiGetCurrentWindow() menuList=hiGetBannerMenus(ADE_WindowID) Unnecessary_Menu=nth(9 menuList) hiDeleteBannerMenu(ADE_WindowID 9); Delete the menu item number 0 is the leftmost menu item. hiRaiseWindow(ADE_WindowID) )deRegUserTriggers("analogArtist-schematic" nil nil 'triggerScriptLoad)
In reply to Andrew Beckett:
Helle Andrew ,
I used for base of my work exactly this solution 11286092
I think it would be best to check the name of the banner menu before deleting it, but the way to delay things would be to use hiRegTimer() to schedule the function to do the deletion to some point in the future. You probably need to record the current window though, because it's possible the current window may have changed by the time your delayed function kicks in.
It might be better to try to use the cdsenv variable I suggested earlier to set up the trigger, because the de trigger you're using won't work if you've (say) saved an ADE state in a cellView, and then you open the state cellView directly (say from the library manager) - because there's no schematic open to fire the de triggers.
I realised trigerring using the function
envSetVal("asimenv.startup" "sessInitTrigFunc" 'string "triggerScriptLoad")
I just included this line in my .cdsinit file
But even using hiRegTimer up to 20 seconds I could not delete the unnecessary ADE menu item.
is very strange because when I launch ADE after 2-3 second I already
see that this menu item is loaded on the ADE window. But after 20 second
when the delay of my function finishes the response of the following 2
response is: sevHelpMenu1. Which is the name of the "Help" button. But
after that when type same commands in CIW the repsonse is the exact name
of the menu item whic i want to delete.
It seems that this menu item is trigered later than ADe starting.
It's probably not wise to just blindly delete the 9th item - maybe you should search along the list until you get the value you're looking for, and then delete that?
You may also be best off contact customer support - and then we could perhaps do a remote web session and take a look. Without knowing the details of the PDK and what it is doing, there's a bit of guess work here.
In reply to NcfC:
I just tried that code in IC5141 (the menus file looks as if it was written for IC5141) and it worked fine. It suggests to me that you've altered the code in some way, because it shows that sevAddMenuItemLists has two arguments, the second of which is the number 2. That's not in the code anywhere, so presumably something got changed when you cut and pasted it?
Which version of Virtuoso are you trying to use?
Yes the code was written for IC5, for IC6 we use the same approach but some of the names of the default menu items are changed, so the script is little bit modified.
Based on an email message sent to me by NcfC (not sure why that user didn't post here, since they posted before) - the email was a bit scramble, but it said
NcfCWhen I load the above code into CIW, I don't get any error nor warning
messages, but I don't see the added menu entry in the ADE window.Could
you help me?Thank you very much in advance.Best regards,Noel Carneiro
Well, you're not supposed to load the code into the CIW. You're supposed to create a file called spectre.menus in a subdirectory called menus (e.g. as a subdirectory of your working dir or home dir).
I'm using version 184.108.40.2060.6.132. I don't know what got changed when I copy and paste the code but I re-pasted it and, although I got no warnings, I don't see the new menu/item anywhere in the ADE window.
If I load the following code in the .cdsinit,
load( prependInstallPath( "etc/tools/menus/schematic.menus" ) )
procedure(CustomMenu( _args )
let( (item1 item2)
;; create a couple of menu items
item1 = hiCreateMenuItem( ?name 'item1 ?itemText "Item 1" ?callback "FunctionOne()" )
item2 = hiCreateMenuItem( ?name 'item2 ?itemText "Item 2" ?callback "FunctionTwo()" )
;; create a menu that includes the menu items and return a list of the
;; pulldown menus
list( hiCreatePulldownMenu( 'CustomMenu "Custom Menu" list( item1 item2 ) ) )
;; create a userMenuTrigger trigger that automatically adds the menu
deRegUserTriggers( "schematic" nil 'CustomMenu )