• 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. Printing CIW return value at cursor in layout window

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 142
  • Views 8363
  • 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

Printing CIW return value at cursor in layout window

Tejaskill
Tejaskill over 2 years ago

Hi all,

I am looking for a code which can print the Return value of CIW at cursor in layout window

I am writing a code as follows but I have to see the return value of this code at the cursor point in layout window for every iteration. 

hiSetBindKey("Layout" "Ctrl Shift<Btn4Down>" "pwi()")
hiSetBindKey("Layout" "Ctrl Shift<Btn5Down>" "pwd()")
procedure(pwi()
pwi=geGetSelSet()
foreach(h pwi
h~>width=h~>width+0.01
)
)
procedure(pwd()
pwd=geGetSelSet()
foreach(h pwi
h~>width=h~>width-0.01
)
)

Thanks in advance.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    I don't really understand what you're asking here. The return value of the pwi() and pwd() functions is the list of database objects which are selected.I'm not sure what you mean by "printing at the cursor in the layout window".

    Please explain clearly what you want to happen.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Tejaskill
    Tejaskill over 2 years ago in reply to Andrew Beckett

    Hi andrew

    I want to print the first value of the list returned by the functions pwi() and pwd() at the cursor point in layout window
    In most of the cases the value returned by pwi() and pwd() function is list with single float element. Now I want that float element to be printed at cursor point every time when I call the functions pwi() and pwd().

    Thanks,
    Teja

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RicardoGV1
    RicardoGV1 over 2 years ago in reply to Tejaskill

    If you mean visually, I've already asked support for a way to let us write on LEW CCR#2682366, the other thing that you could do meantime, is to create a text obj with the value you are getting from those fn's.

    you could use _leCreatePGText to create the text and here are two procedures to get the cursor position which I think hiGetPoint will be better for your case

    procedure(getCoordsScrn()
        prog(
                (
                    pythonScript pythonScriptProcess pythonOutput tmp mouseXpos mouseYpos
                )
                pythonScript = "python ~/Documents/Skills/Prueba/skill/to_be_approved/Skills/Mouse/Coordinates/MouseCord2.py"
                pythonScriptProcess = ipcBeginProcess(pythonScript) ;execute my python script
                ipcWait(pythonScriptProcess) ;wait for scipt to complete
                pythonOutput = ipcReadProcess(pythonScriptProcess) ;store script output
                if(ipcIsAliveProcess(pythonScriptProcess) == t then ;if child still exists
                    ipcCloseProcess(pythonScriptProcess) ;close child
                )
                if(rexMatchp("Errno" pythonOutput) || rexMatchp("SyntaxError" pythonOutput) then
                    printf("\nERROR --> [getMouseCoordinates.il] A problem occured when executing the command: %L \n", pythonScript)
                    return(nil)
                )
                rexCompile(" *")
                pythonOutput = rexReplace(pythonOutput " " 0)
                pythonOutput = parseString(pythonOutput "\n") ;format script output
                foreach(line pythonOutput ;step through each line of script output
                    rexCompile(" *")
                    line = rexReplace(line "" 0)

                    if(rexMatchp("c_int" line) == t then
                        tmp = parseString(line ")")
                        mouseXpos = atoi(nth(1 parseString(nth(0 tmp) "("))) ;store mouse X position
                        mouseYpos = atoi(nth(1 parseString(nth(1 tmp) "("))) ;store mouse Y position
                    )
                )
                return(list(mouseXpos mouseYpos))
        )
    )


    procedure(getCoordsWin()
        hiGetPoint(hiGetCurrentWindow())
    )



    Of course Andrew know more and maybe he could tell you something different.

    Regards,
    R. Gómez

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to RicardoGV1

    It's still not clear what you want. There is the ability to show info balloons with custom contents as you hover over a shape (see Options->Dynamic Display - you can even define a SKILL function to determine that content) - but you can't (as far as I know) show a temporary info balloon as you execute a function. I guess you could create a hilight label (geCreateHilightSet and then geAddHilightLabel) and use a timer (hiRegTimer) to turn off the display of it after a period of time (probably removing the label or destroying the hilight set). That could be added at the current point using something like hiGetPoint().

    Your pwi/pwd functions don't return numbers; I assume you want them to show the new width. Anyway, I'll leave this as an exercise for you to try out.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Tejaskill
    Tejaskill over 2 years ago in reply to Andrew Beckett

    Hi andrew,

    Thanks for the reply I have written a code based on your inputs I have acheived what I want 
    But There is an issue with my code the highlighting labels are not removing with geDeleteHilightSet() but the hilight labels are removed by geDeleteAllHilights() >>>>> but with this function the highlights created by MarkNet are also being removed could you please suggest me a solution.

    Below is the code I have written based on your inputs

    hiSetBindKey("Layout" "Ctrl Shift<Btn4Down>" "pwi()")
    hiSetBindKey("Layout" "Ctrl Shift<Btn5Down>" "pwd()")
    procedure(pwi()
    tk=geGetEditCellView()
    pwi=car(geGetSelSet())
    rw=pwi~>width=pwi~>width+0.01
    rw1=artMakeString(rw)
    ln=pwi~>layerName
    lp=pwi~>layerPurpose
    hs=geCreateHilightSet(geGetEditCellView() list(ln lp) nil)
    hs~>enable=t
    hp=hiGetPoint(hiGetCurrentWindow())
    geAddHilightLabel(hs hp rw1 "centerCenter" "R0" "stick" rw nil)
    hiRegTimer("geDeleteAllHilightSet(tk)" 5)
    )
    procedure(pwd()
    tk=geGetEditCellView()
    pwd=car(geGetSelSet())
    rw=pwd~>width=pwd~>width-0.01
    rw1=artMakeString(rw)
    ln=pwd~>layerName
    lp=pwd~>layerPurpose
    hs=geCreateHilightSet(geGetEditCellView() list(ln lp) nil)
    hs~>enable=t
    hp=hiGetPoint(hiGetCurrentWindow())
    geAddHilightLabel(hs hp rw1 "centerCenter" "R0" "stick" rw nil)
    hiRegTimer("geDeleteAllHilightSet(tk)" 5)
    )

    Teja.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Tejaskill

    Teja,

    Rather than deleting all hilight sets you should delete the specific hilight set you created. I modified your code to achieve this, and at the same time got rid of all the global variables; it stores the hilight set as a property on the window so that it can be retrieved easily later for deletion:

    hiSetBindKey("Layout" "Ctrl Shift<Btn4Down>" "pwi()")
    hiSetBindKey("Layout" "Ctrl Shift<Btn5Down>" "pwd()")
    procedure(pwCommon(increment)
      let((tk pwi rw rw1 ln lp hs hp win)
        win=hiGetCurrentWindow()
        ; delete hilight set if already exists in case increment/decrement
        ; is done before timer has kicked in
        pwDeleteHilight(win)
        tk=geGetEditCellView()
        pwi=car(geGetSelSet())
        rw=pwi~>width=pwi~>width+increment
        rw1=artMakeString(rw)
        ln=pwi~>layerName
        lp=pwi~>layerPurpose
        hs=geCreateHilightSet(geGetEditCellView() list(ln lp) nil)
        hs~>enable=t
        ; store the hilight set as a property on the window to
        ; retrieve later for deletion.
        win~>pwCommonHS=hs
        hp=hiGetPoint(win)
        geAddHilightLabel(hs hp rw1 "centerCenter" "R0" "stick" rw nil)
        hiRegTimer(lsprintf("pwDeleteHilight(window(%d))" win->windowNum) 5)
      )
    )
    
    ; retrieve hilight set from the window, and delete if valid
    procedure(pwDeleteHilight(@optional (win hiGetCurrentWindow()))
      when(geIsValidHilightSet(win->pwCommonHS)
        geDeleteHilightSet(win->pwCommonHS)
      )
    )
    
    procedure(pwi()
      pwCommon(0.01)
    )
    
    procedure(pwd()
      pwCommon(-0.01)
    )
    
    

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Tejaskill
    Tejaskill over 2 years ago in reply to Andrew Beckett

    Thanks Andrew 

    Now it works perfect.

    Best regards,

    Teja

    • 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