• 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. Skill code to add the option in toolbar to show layer p...

Stats

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

Skill code to add the option in toolbar to show layer properties

ssram
ssram over 9 years ago

Hi,

I do have the following skill code to display the selected layer property in the toolbar. Right now it just shows the selected layer and the purpose, but how can i add a third field to it to show the width of the same layer?

procedure(dynamicMetUpdate()

let((win choice layer purpose barId)

mouseSingleSelectPt()

if( car(geGetSelectedSet())~>lpp then

choice=car(geGetSelectedSet())~>lpp

pathWidth=car(geGetSelectedSet())~>width

else 

choice=list("" "")

)

layer=car(choice)

purpose=cadr(choice)

win=hiGetCurrentWindow()

barId=car(setof(menu hiGetWindowToolbars( hiGetSessionWindow(win) )

            rexMatchp("^myToolBar" symbolToString(menu~>hiToolBarSym))))

if(barId then

hiDeleteToolbarItems(barId list('C_GROUP1 'C_GROUP2))

C_GROUP1=hiCreateToolbarComboBox(

                ?name 'C_GROUP1

                ?prompt "Selected Layer "

                ?value  layer

                ?editable nil

?enabled nil)

C_GROUP2=hiCreateToolbarComboBox(

                ?name 'C_GROUP2

                ?prompt "Selected Purpose "

                ?value  purpose

                ?editable nil

?enabled nil)

               ;items

 hiAddToolbarItems(barId list(C_GROUP1 C_GROUP2))

)

if(!boundp('myToolbar) then

myToolbar = hiCreateToolbar(

   ?name 'myToolBar

   ?title "My Toolbar For Fixed Menu"

   ?toolButtonStyle 'textBesideIcon

   ?toolTip "My Fixed Menu Toolbar"

   ?invisible t

   ?items list(

            hiCreateToolbarComboBox(

                ?name 'C_GROUP1

                ?prompt "Selected Layer "

                ?value  layer

                ?editable nil

?enabled nil)

               

        

hiCreateToolbarComboBox(

                ?name 'C_GROUP2

                ?prompt "Selected Purpose "

                ?value  purpose

                ?editable nil

?enabled nil)

              ) ;items

        ) ;hiCreateToolbar

    );unless

unless(win~>cellView win=cadr(reverse(hiGetWindowList())))

 

hiPlaceToolbar(hiGetSessionWindow(win) myToolbar 'top)

  hiShowToolbar(myToolbar)

   )

)

hiSetBindKey("Layout" "None<Btn1Down>" "dynamicMetUpdate()")

procedure(dynamicMetUpdate()let((win choice layer purpose barId)mouseSingleSelectPt()if( car(geGetSelectedSet())~>lpp thenchoice=car(geGetSelectedSet())~>lpppathWidth=car(geGetSelectedSet())~>width
else choice=list("" ""))layer=car(choice)purpose=cadr(choice)win=hiGetCurrentWindow()barId=car(setof(menu hiGetWindowToolbars( hiGetSessionWindow(win) )            rexMatchp("^myToolBar" symbolToString(menu~>hiToolBarSym))))if(barId then hiDeleteToolbarItems(barId list('C_GROUP1 'C_GROUP2))
C_GROUP1=hiCreateToolbarComboBox(                ?name 'C_GROUP1                ?prompt "Selected Layer "                ?value  layer                ?editable nil ?enabled nil)C_GROUP2=hiCreateToolbarComboBox(                ?name 'C_GROUP2                ?prompt "Selected Purpose "                ?value  purpose                ?editable nil ?enabled nil)               ;items  hiAddToolbarItems(barId list(C_GROUP1 C_GROUP2))
)if(!boundp('myToolbar) thenmyToolbar = hiCreateToolbar(   ?name 'myToolBar   ?title "My Toolbar For Fixed Menu"   ?toolButtonStyle 'textBesideIcon   ?toolTip "My Fixed Menu Toolbar"   ?invisible t   ?items list(            hiCreateToolbarComboBox(                ?name 'C_GROUP1                ?prompt "Selected Layer "                ?value  layer                ?editable nil ?enabled nil)                        hiCreateToolbarComboBox(                ?name 'C_GROUP2                ?prompt "Selected Purpose "                ?value  purpose                ?editable nil ?enabled nil)              ) ;items        ) ;hiCreateToolbar    );unless unless(win~>cellView win=cadr(reverse(hiGetWindowList()))) hiPlaceToolbar(hiGetSessionWindow(win) myToolbar 'top)  hiShowToolbar(myToolbar)   ))
hiSetBindKey("Layout" "None<Btn1Down>" "dynamicMetUpdate()")

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Your code formatting seems to have got a bit messed up (and pasted twice), but isn't this just a matter of adding another field (e.g. hiCreateToolbarTypein()) with the width converted to a string (e.g. using sprintf(nil "%g" pathWidth) ? Of course you need to check that you actually have a pathWidth before doing that.

    However, this all seems a bit unnecessary - the functionality is rather similar to the built-in Window->Toolbars->Show selection info (that's more designed to show what will be selected rather than what is selected - but the principle is the same).

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 9 years ago
    Thanks a lot for the quick reply Andrew. I've tried adding a new field to the script, but somehow it just breaks when i try to load, not sure why. The script was pasted twice, but that was by mistake. The issue with the info balloon is that it shows info about only the top layer if there are many overlapped ones. The code above shows the selected layers properties and i could always make a selection easily. So i guess the Info Balloon is not really an effective way.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    I didn't say anything at all about info balloons. This is a toolbar that exists already (it's enabled by default in fact) that shows the potential selection (i.e. what gets highlighted by hovering over the object). Please try the toolbar I selected. 

    If that's not up to the job, please post your code attempt that doesn't work...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 9 years ago
    I got it now, this works exactly like the way i wanted it. Thanks Andrew!
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 9 years ago
    One more thing about this option: I would like to use the Info Balloon since its kind of a distraction in the design window while you are doing the design. But certainly the one you have mentioned is the one that i'm looking for. Right now it displays the layer Type,Name, Purpose, & Width. Is there a way i can customize this? For example, can i add the area & length field as well? If so, how can i do that?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    I don't believe the contents of this assistant can be customised currently. If you want that, please contact customer support so that an enhancement can be filed.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 9 years ago
    Definitely one would love to have customizable options in it. I would surely get in touch with them. Thanks!
    • 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