• 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 Design
  3. Need a Skill code to get a list of elements under a plygonal...

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 127
  • Views 22493
  • 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

Need a Skill code to get a list of elements under a plygonal shape.

AmitBiswas
AmitBiswas over 16 years ago

I am looking for a comand in skill to get the list of elements under a polygonal shape.

There is a command

 

dbgetTrueOverlaps(
d_cellView
l_bBox
)

 here the output of this command is a list of elements. But this command only takes the input as a list of two points.

 I want to give a list of more number of points as input to the code and the output it will return a list of elements under the polygon formed by the list of input points.

If anybody knows how to get it done please repply.

Regards,

Amit 

 


  • Cancel
  • dmay
    dmay over 16 years ago

    The only way to do this is to decompose the polygon into rectangles and run dbGetTrueOverlaps on each rectangle. If your polygons are not orthogonal, then you'll have to do some approximating. Cadence has a routine called dbLayerTile that will take an input shape and decompose it into trapezoids. If the original shape is orthogonal, then the results will be rectangles. The drawback to this routine is that it will actually create the trapezoids (or rectangles) in your layout where the source shapes are located. If you need to be able to work in a read-only mode, then you would have to mess around with a scratch cell to do your layer tiling. You alternative is to write your own polygon to trapezoid routine or find one out on the web.

     -Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Austin CAD Guy
    Austin CAD Guy over 16 years ago

     Derek is correct, using dbLayerTile will break an orthogonal polygon into rectangles which can then be fed to dbGetTrueOverlaps. The first  argument for dbLayerTile is a cellView ID so you could open a scratch cellView using dbOpenCellViewByType in "s" mode (including IC6.1.3) and create the resulting rectangles there. dbLayerTile returns the dbId's for the rectangles so you could then process them from there. I often open a scratch cellView and keep it open just for this type of issue, sharing it among multiple programs.

     

    Ted

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AmitBiswas
    AmitBiswas over 16 years ago

    Thans a lot , it solved my problem.

    But now I have one more issue that is when I am using  " dbGetTrueOverlaps " command , if there is any Guardring or any multipartpath present inside that area, This command returns list of dbid of the  multipartpath along with all the individual contacts and vias and layers.

    I want  dbID of the MultipartPath only.

    And How to diferentiate a " Path " and a " Multipartpath " in the layout.

    car(geGetSelSet()) ~>??    for both Path and Multipartpath  gives the same kind of properties.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 16 years ago

    Amit,

    One way that you could check is to see if rodGetObj() returns a rod object id or nil, if a rodObj:0x... is returned, then the path is possibly a multipart path. Then you could check the subShapes attribute of the rodObject to see if the path is indeed a multi-part path, or just a named rod path with no sub-parts. (Create->Multipart Path could create a rod path with no subparts, but then it is really just a rod-named path).

    I hope that this answers your question, or at least helps you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AmitBiswas
    AmitBiswas over 16 years ago

     Thank you Lawrence, because of you only now I have a bug free code.

    Really it reduced my lot of work. Now I hve one more doubt How to get the dbid of last placed object in the layout,

    because I want to get the dbid of the polygon but hiCreatepolygon  does not return any dbid.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    Sounds like you want to use a combination of enterPolygon and dbCreatePolygon. The enterPolygon routine will allow you to define your own polygon creation interface. When it completes, you can use dbCreatePolygon to create the actual polygon and the return value of this routine is your dbId.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AmitBiswas
    AmitBiswas over 16 years ago

    Derek ,

    Acually I want to get the dbID of last placed object in the layout.I intentionally used lehiCreatePolygon command (whhich does not return any dbid). 

    I can not use dbcreatePolygon command because I want to create the polygon using human interface  after that I will check the points of that polygon.

    and in enterPolygon command also I need to give the list of points as an argument.

     

    Thanks & Regards,

    Amit 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    The points argument is not required. This simple example (similar to the one in the documentation for enterPolygon) will allow you to create a polygon interactively:

    procedure(myPolygon()
        enterPolygon(
            ?prompts list("Point at the first point of the polygon:" "Point at the next point of the poygon")
            ?doneProc "myPolygonDp"
            ?cmdName "My Polygon"
        )
    )

    procedure(myPolygonDp(w done pts)
      let((polyId)
        if( done then
            printf("Polygon entered was %L.\n" pts)
            polyId = dbCreatePolygon( w->editCellView leGetEntryLayer() pts)
        else
            println("Polygon entry aborted.")
        )
        polyId
      )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AmitBiswas
    AmitBiswas over 16 years ago
    enterPolygon code is working fine. I solve that problem some other way. now can u plz explain me how this code is working. How that "done" "pts" and "w" is initialized .this is the code given as an example in the documentation but I didn't find any explanation. For my last question that how do I get the dbid of last placed object in the layout. I have done it. its working fine but I am not sure It is working by chance or it is the right code. What I have done 1.deselect all element 2.select all element 3. then car(geGetselset) will return the last placed object's dbid. is it correct for all the time. the first point of deselecting all the element is because I found that if any object is selected then it will return that object's dbid as the output of car(geGetselSet()) If you have any other code to do it, plz tell me. Regards, Amit
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 16 years ago

     Hi Amit,

    The "doneProc" automatically has three arguments supplied, the "w" is the window id, done is t/nil indicating whether the user completed the action or aborted (e.g. by pressing "Esc" during the enterFunction command), and points are the digitized points that the user supplied.

    I'm not sure that it is safe to rely on the selection giving the most recently added shape first.  However, it may just always work this way. A similar thing that you might be able to rely on more soundly is the cellview shapes attribute, for example:

    cv = geGetEditCellView()
    ;; the following should give the most recent shape
    car(cv~>shapes)
    ;; the folowing should give the most recent polygon shape
    car(setof(sh cv~>shapes sh~>objType=="polygon"))
    
    

    Hope it helps.

    regards,

    Lawrence.

    • 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