Andrew, I had something working very well, but I was trying multiple iterations of things, and by the time I restarted cadence after a crash, the code I was using started to give me errors. *Error* dbCreateLabel: Invalid cellView - db:0x218a5c9a For a more complete picture here is the code I am working with now.... It is a simple bindkey that will grow a rectangle by a fixed amount and maintain the area. That part is fine, It then should create labels for the Net Name, Area, and Length and Height of the shape. Right now only the Net Name is passing through. It seems to be stalled at the dbCreatelabel portion. but I had everything working for a few days. Thanks in advance. hiSetBindKey("Layout" " [" "stretchAreax()") /*********************************************** Stretch Rectangle With Constant Area +X ************************************************/ procedure( stretchAreax() foreach(X geGetSelectedSet() net = X~>net sSet = geGetSelSet() corners = car(sSet)~>bBox delta = 5 ll = car(corners) ur = cadr(corners) dx = xCoord(ur) - xCoord(ll) x1 = xCoord(ll) x2 = xCoord(ur) + delta newdx = (xCoord(ur)+delta - xCoord(ll)) rnewdx = round(newdx) dy = yCoord(ur) - yCoord(ll) rdy = round(dy) y1b = yCoord(ll) y1t = yCoord(ur) newarea = abs(newdx * dy) area = round(abs( dx * dy )) y2 = y1t - (dy-(area/newdx)) printf("Area of rectangle is %L.\n" area) ;; Displays Area in CIW window printf("Length of Rectangle is %L.\n" newdx) ;; Displays Length in CIW window printf("Height of Rectangle is %L.\n" dy) ;; Displays Height in CIW window r=css() r~>? r~>?? lowerLeft(r~>bBox) upperRight(r~>bBox) xCoord(lowerLeft(r~>bBox)) yCoord(lowerLeft(r~>bBox)) newBBox=list(list(x1 y1b) list(x2 y2)) r~>bBox=newBBox string = sprintf(area "%L" area) stringL = sprintf(rnewdx "%L" rnewdx) stringH = sprintf(rdy "%L" rdy) foreach(selObj geGetSelSet() foreach(child selObj~>children when(member(child~>objType '("label" "textDisplay")) && child~>layerName=="text" && child~>purpose=="drawing" dbDeleteObject(child) ) ) ) disp=dbCreateTextDisplay( net X list("text" "drawing" ) t centerBox(X~>bBox) "lowerRight" "R0" "roman" abs(dx/12) nil nil t nil t "name" nil) ;;Creates text label from net name of figure label=dbCreateLabel(cv "text" centerBox(X~>bBox) string "lowerLeft" "R0" "roman" abs(dx/18)) labelL=dbCreateLabel(cv "text" centerBox(X~>bBox) stringL "upperRight" "MXR90" "roman" (dx/22)) labelH=dbCreateLabel(cv "text" centerBox(X~>bBox) stringH "upperLeft" "MYR90" "roman" (dx/22)) leAttachFig(label r) leAttachFig(labelL r) leAttachFig(labelH r) label~>labelType="ILLabel" ;;Creates text label with area of figure labelL~>labelType="ILLabel" ;;Creates text label with area of figure labelH~>labelType="ILLabel" ;;Creates text label with area of figure ) ) ;procedure
↧