• 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. How to delete a repeated object in layout

Stats

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

How to delete a repeated object in layout

rammi
rammi over 7 years ago

I am new to skill. is there any  skill code to delete a repeated copy in layout

for example

fills are overlapped with other objects at same interval of distance(20 times). so if I delete at one place other places has to be deleted 

  • Cancel
  • mbracht
    mbracht over 7 years ago

    Can you be a little more specific about what exactly you want to delete. Essentially everything in a layout is an OA object which maybe deleted with dbDeleteObject(). So I think the question in your case is how to identify what exactly you what to delete. For example you might use the dbGetOverLaps() function when the objects you want to delete are in a specific bounding box or you might filter by layers or whatever...that's why I'am asking to be a little more specific

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • rammi
    rammi over 7 years ago in reply to mbracht

    HI mbracht, thanks for quick replay 

    suppose let us consider  metal1 which is repeated 20 times with same interval of distance where other devices and metals also present in between the metal1. but I want to delete only metal1 which are having same distance  

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 7 years ago in reply to rammi

    ok - assume you have a list of metal1 rectangles with one being the source and the other ones the copies.
    To determine whether a shape is copy you need to check the objType, the width/height and the layer.
    Assume moreover that the source rectangle is on the very left and the copies on the source's right hand side.
    Select the original and the run the below code:

    (defun getWidth (rect "d")
       (xCoord (upperRight rect~>bBox))-(xCoord (lowerLeft rect~>bBox)))

    (defun getHeight (rect "d")
       (yCoord (upperRight rect~>bBox))-(yCoord (lowerLeft rect~>bBox)))

    sourceRect = (car (geGetSelSet))
    sWidth=(getWidth sourceRect)
    sHeight=(getHeight sourceRect)
    cv=(geGetEditCellView)

    copies = (cdr (sort
       (setof shape cv~>shapes
          shape~>layerName==sourceRect~>layerName &&
             shape~>objType == "rect" &&
                (sprintf nil "%2.3f" (getWidth shape))==(sprintf nil "%2.3f" sWidth)) &&
                   (sprintf nil "%2.3f" (getHeight shape))==(sprintf nil "%2.3f" sHeight)
       )
       (lambda (s1 s2) (xCoord (lowerLeft s1~>bBox)) -  (xCoord (lowerLeft s2~>bBox)))
    ))

    (foreach copy copies
       (dbDeleteObject copy))

    The code collects the source and  all copies (that's what the setof() does) and then sorts them left to
    right (this is what sort() does). The cdr() eventually returns all but the first shape (the sourec shape) coming from setof()
    I've made quite a few assunptions which I don't know whether they are the case for you...so this is just an example which
    probably doesn't reflect exactly your scenario but it might at least give you a rough idea how to do that.

    • 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