• 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 get points from pathSeg ?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 15587
  • 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 get points from pathSeg ?

skillProgram14
skillProgram14 over 11 years ago

Hi,

I made simple script which put automaticaly ruller on all selected pathes.

But if the path is created as pathSeg I have a problem to get the points.

There are just beginPt and endPt for each segment. :( 

Is there anybody who can help me with it ?

The script should do same as for pathes:

(if you select couple of pathes and call script....it puts ruller on each of selected pathes)

procedure( Ruler_on_Path()
prog((winId cvId selObj)
winId = hiGetCurrentWindow()
cvId = getEditRep(winId)
selObj = geGetSelSet(cvId)
if(selObj then
        foreach(shape selObj
                case( shape~>objType                  
                ("path"
                points = shape~>path
                leCreateRuler(cvId points)
                )
                );case
                );foreach
                );if
    );prog
);procedure

 

Thanks for any advice.

Robert

 

 

  • Cancel
  • Li Ting
    Li Ting over 11 years ago

    The beginPt and endPt attributes are what define the legnth of a pathSeg object. In other words, a pathSeg is always have only two points.
     
    If you create a 'U' shaped path, you created one database object with 4 points.
     
    If you create the same 'U' shaped wire (implemented by pathSeg), you have acutally created three pathSeg objects. You will see that each of these pathSeg objects belong to the same 'route' object (an attribute on the pathSeg object).
     
    In order to replicate what you have done for path, you should process the selected set based on pathSeg's route value and build up a point list that represent the whole 'route' object (the U shape).
     
    Assume x is one of the pathSeg object, the following statement will give you the point list for this route object.
     
    append( x~>route~>objects~>beginPt  last(x~>route)~>endPt ) 
     
    You still need to modify the foreach loop so you only generate one ruler for each route.
     
    Li 
     
    ps. I don't know is there already a public SKILL API for getting the points for a route object. 
     
      
     
     
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillProgram14
    skillProgram14 over 11 years ago

     Hi Li, 

     Thx for you replay.I have tired similar thing before but there are some issues:

    1. How to get all routing objects .... you are right if you draw U shape you have 3 route objects

    so if you call  css()~>route~>??

    you get objects (db:0x1997d2d0 db:0x1997d2cf db:0x1997d2ce)

    unfortunately it works just sometimes.

    Tried to copy this U shape and do css()~>route~>??

    you will only get one objects (db:0x1997d2cd) even you selected all route object ....

    Strange ? yes it is :(

    2. issue is, if I make a loop for route object and get all segmets points

    I will have a problem with the order, it depands how you selected the path,

    First segment you touch, it's go first, so its hard to take this points 

    for ruller.

    3. Issue is that ,if you have more than one selected path in your layout it will take

    all selected segment pathes. Here I can see solution to make first a group - list

    for each path  ....each list will include objects only from path ... but it will work

    only if 1. is solved :(

     

    SOLUTION: Best solution would be if I can virtualy merge the pathSeg to path

    like Im doing now if I realy need it, but it;s very stupid solution, because you need to

    have your layout in edit mode and you are changing original .... :( and also if you use

    DesSync it's check out cell. 

    cvId = getEditRep(winId)
            selObj = geGetSelSet(cvId)
            if(selObj then
            foreach(shape selObj
                    case( shape~>objType

                                           ("pathSeg"
                                           leHiMerge()
                                           ))))

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Li Ting
    Li Ting over 11 years ago

    Hi

    When working with objects in a selected set, the order of the objects is not always the same. This is what you have found out. So we need to look at this from a different perspective. Before that I need to cover a little bit about the objects we are working with here as it is important we are using the same terminology. This maybe redundent or trival to experienced developers but it does not hurt to establish a common base line.

    1) Path is a database shape object. This is created by VLS' Create Shape command. It is described by a list of points, width and end point style.

    2) PathSeg is a database shape object. This is created by VLS' Create Wire command (or router command for creating connections). The Create Wire command gives user the impression a 'path' is created but it is not. The implementation is actually presented by a series of two pointed pathSeg figure objects.

    3) Route is a database object but it is not a shape (it is connFig object). It has a bounding box but not the points describing the its contour. Route can be viewed as a container for the pathSeg objects used to form the 'route' from point A to point B.

     Now back to your questions...

    Q1) You can't rely on the selected set information when dealing with pathSeg for the reason you have mentioned. You need to always use the route~>objects to get all the pathSeg objects and you will always get them in the exact same order, ie. from point A to point B regardless where the selection is made. 

    You can get all the routes from a cellview by accessing the routes attribute on a cellview, e.g. geGetEditCellView()~>routes. 

    Q2)  I have already answered earlier that to work with pathSeg/route, you can not rely on the selection set only. Especially css() which always only return the first element of the selected set. If your command is expected to only work with the selected set, then you can maintain a list of 'processed routes',  and while your code process each shape from the selected set and when the shape is a pathSeg, you check is the route of that pathSeg already in the list or not. If yes, skip over the shape; if not, process the route and get its pathSegs from route~>objects.

    Q3) I think this is covered by Q1 and Q2 above.

    Cheers,

     

    Li 

    • 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