• 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 pass argument in user defined procedure function...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 5423
  • 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 pass argument in user defined procedure function on pull-down menu skill code.

yogeshjaiswalCAD
yogeshjaiswalCAD over 1 year ago

Dear Group members ,

I need small favor from your expertise,  Please help me on  how to pass argument in user defined  procedure of pull-down menu. 

I have tested following pulldown skill code 

procedure(AmitAddMenu(args)

let( (item1 item2)

;; create a couple of menu items

item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item" ?callback "AmitFunctionOne()" )

item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item" ?callback "AmitFunctionTwo()" )

;; create a menu that includes the menu items and return a list of the

;; pulldown menus

list(hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2)))

);let

); procedure

;; create a userMenuTrigger trigger that automatically adds the menu

deRegUserTriggers("maskLayout" nil 'AmitAddMenu)

Please help me with following query  

For example : How to pass argument to different argument to user skill function in pulldown menu 

AmitFunctionOne( "meatl2" .08)   let say two arguments are "meatl2" .08

AmitFunctionTwo(" Via1"  .09)        let say two arguments are "Via1" .09

Thanks for your help again !

Best regards,

Yogesh Jaiswal

USA

  • Cancel
  • yogeshjaiswalCAD
    yogeshjaiswalCAD over 1 year ago

    please post you suggestion or code , how to proceed  

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to yogeshjaiswalCAD

    Hi Yogesh,

    I am not sure to understand your question,

    If you want to pass the arguments directly, you can type them in the callback string:

    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item" ?callback "AmitFunctionOne(\"meatl2\" .08)" )

    If you want the user to be able to select those arguments you will have to build a custom interface

    There might be other solutions to provide variables inside a string callback (global variables, SKILL++, etc.) but you need to clarify the use case for our answers to be pertinent

    Cheers,

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yogeshjaiswalCAD
    yogeshjaiswalCAD over 1 year ago in reply to AurelBuche

    greetings Aurélien,

    many thanks for you reply , I want the user to be able to select those arguments from outside which needs  build of custom interface for example

    There might be other solutions to provide variables inside a string callback.. if you can share any such custom interface where i can pass such 2 or more argument ..for ease let say i want to pass  metal2 and .08 from user interface. Please help me on this.

    many thanks again

    cheers,

    yogesh

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yogeshjaiswalCAD
    yogeshjaiswalCAD over 1 year ago in reply to yogeshjaiswalCAD

    please share your view or code for above issue , thanks in advance 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to yogeshjaiswalCAD

    Hi Yogesh,

    Usually you create a GUI function to display the form and you use your main function in the form callback : 

    procedure( AmitFunctionOne_gui( @rest _args)
      "Display a GUI to provide parameters to `AmitFunctionOne' and run it"
      hiDisplayForm(
        hiCreateLayoutForm( 'AmitFunctionOne_form "Custom Form"
          hiCreateFormLayout( 'main_layout
            ?items
            list(
              hiCreateStringField( ?name 'layer  ?prompt "Layer"  )
              hiCreateFloatField(  ?name 'number ?prompt "Number" )
            )
          )
          ?callback
          lambda( (form)
            ;; Fetch form values and call main function
            AmitFunctionOne( form->layer->value form->number->value )
          )
        )
      )
    )

    In the menu you call the GUI function : 

    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item" ?callback "AmitFunctionOne_gui()" )

    Cheers,
    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yogeshjaiswalCAD
    yogeshjaiswalCAD over 1 year ago in reply to AurelBuche

    Many Thanks Aurélien , 

    I mean it , you took personal time to share perfect solution in simplest way. I was looking for the same.
    Have a Great Day & Stay Blessed !

    Cheers,
    Yogesh
    (
    USA)

     

    • 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