Thursday, April 2, 2009

Cadence skill code - Mouse click to activate/call a procedure

Sometimes you might want to create a function that can be called/activated by a mouse click in schematic/layout. For example, you want to create a labeling algorithm that can label signal a1, a2, a3, a4....by each mouse click in the layout. Here is how to do it (not a complete skill code in procedure abc) :


enterPoints(?prompts list("Please click")
?alwaysMap 't
?addPointProc "abc"
)


procedure(abc(windowId points)
prog(()
point = car(last(points))
point = geWindowToEditPoint(windowId point)
dbCreatelabel (***** point ****) ;use point as the xy
text_count=text_count+1

))

Take note that when procedure abc is called by enterPoints, 2 values are assigned automatically to it (windowID and clicking points). The value of "point" after geWindowToEditPoint is the real point we need to create text or polygon. Hope this will help.

No comments:

the INQUIRER

X-bit labs

The Star Online: Business