• 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. My code (fill PP in fluid N-GR) works when pasted in the...

Stats

  • Replies 2
  • Subscribers 144
  • Views 646
  • Members are here 0

My code (fill PP in fluid N-GR) works when pasted in the CIW, but doesn't work when modified as a bindkey.

YC202502167727
YC202502167727 4 months ago

Hi,

I am trying to write a code that fills PP into existed N-Fluid GR.

My approach is quite intuitive, and it works successfully when I paste the code into the CIW.

1. flatten the GR

2. merge all the N-imps

3.Find the inner frame of N-imp.

4.hiUndo twice to restore the GR

5.use inner frame to create a new PP

Then I modified it in a text file and loaded it as a bindkey, but a problem occurred.

It seems that the "hiUndo" function can't be used.

Here's the explanation I found  from "dbUndoToHandle" function on the official website.

dbUndoToHandle ...... has the same limitations as hiUndo. For example, dbUndoToHandle cannot be called from within a SKILL procedure.

I'll paste my code in the text file below. I’d like to know if there’s a way  to restore the GR to its original state, or if there are alternative functions that can replace HiUndo.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

list("<Key>F6" "

a=geGetSelSet()
leFlattenInst(car(a) 31 t)

(let ((instances (geGetEditCellView()~>shapes)))
(foreach shape instances
(if (equal (shape~>layerName) \"NP\")
(progn
(geSelectObject shape)  ))))

leHiMerge()

(defun RemoveDuplicatesManually (lst)
(let ((result '()))
(foreach item lst
(if (not (memv item result))
(setq result (cons item result))))
(reverse result)))

(setq a (geGetEditCellView()~>shapes))

(setq xVals '())
(setq yVals '())

(foreach shape a
(if (equal (shape->layerName) \"NP\")
(foreach point (shape->points)
(setq xVals (cons (car point) xVals))
(setq yVals (cons (cadr point) yVals))  )))

(setq xVals (reverse xVals))
(setq yVals (reverse yVals))

(setq xVals (RemoveDuplicatesManually xVals))
(setq yVals (RemoveDuplicatesManually yVals))

(setq xVals (sort xVals (lambda (x y) (lessp x y))))
(setq yVals (sort yVals (lambda (x y) (lessp x y))))

(setq secondSmallestX (cadr xVals))
(setq secondLargestX (caddr xVals))

(setq secondSmallestY (cadr yVals))
(setq secondLargestY (caddr yVals))

hiUndo()
hiUndo()

dbCreateRect(geGetEditCellView() '(\"PP\" \"drawing\") list( (list secondSmallestX secondSmallestY) (list secondLargestX secondLargestY)))    ")

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have also saw an post titled 'Coordinates (bBoxes) of all the shapes (layers) in a layout view' that mentions using the abs function to avoid flatten.

However, due to insufficient reference material, I’m currently unable to write the code by using abs. function.

Could you provide any example by using abs function to find out the points of any shape within a fluid GR?

Any advise will be thankful and helpful.

Best Regards.

  • Sign in to reply
  • Cancel
Parents
  • YC202502167727
    YC202502167727 4 months ago

    Sorry for the typo mistake, it's the abe* function, not the abs function.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • YC202502167727
    YC202502167727 4 months ago

    Sorry for the typo mistake, it's the abe* function, not the abs function.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

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