• 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. Reselect Items

Stats

  • Locked Locked
  • Replies 19
  • Subscribers 143
  • Views 18309
  • 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

Reselect Items

blankman
blankman over 14 years ago

Hi all, is it possible in skill to create a reselect tool, that would reselect any preselected number of objects in the event of deselecting by mistake? For instance, when doing complex stretches that involve carefully selecting only certain objects, it can be quite cumbersome when one looses the selection and has to go to the trouble of reselecting everything again. Thanks,

Brian.
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Brian,

    One possibility would be to create a group in the cellView (using dbCreateGroup) - this allows you to store the relationship between a set of dbObjects, and everything will then be self-consistent (and it will also get saved in the database). Of course, this requires write access - so that may not be what you want either.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Hi Andrew, write access is ok, but im not sure I fully understand you, can you give a short example? The code im using is below.

    Thanks,

    Brian.

     

    procedure(BSstoreSelSet1()
        if(geGetSelSet()==nil
            then    printf("Nothing selected to be stored")
            else    brianpartselobjlist1=nil
                      brianpartselobjpointlist1=nil
                      brianfullselobjlist1=nil
                      foreach(fig geGetSelSet()
                          if(geIsObjectPartiallySelected(fig nil) == t
                              then    brianpartselobjlist1 = cons( fig brianpartselobjlist1 )
                                        brianpartselobjpointlist1 = cons( geGetSelSetFigPoint(fig) brianpartselobjpointlist1 )
                              else    brianfullselobjlist1 = cons( fig brianfullselobjlist1 )
                          );if
                      );foreach
                      printf("Selection Set 1 stored\n")
        )
    );procedure
    hiSetBindKey("Layout" "Ctrl Shift<key>KP_End" "BSstoreSelSet1()")


    procedure(BSreselectSelSet1()
    let( (dmessage)
        when(boundp('brianpartselobjlist1) != t
            brianpartselobjlist1=nil
        )
        when(boundp('brianpartselobjpointlist1) != t
            brianpartselobjpointlist1=nil
        )
        when(boundp('brianfullselobjlist1) != t
            brianfullselobjlist1=nil
        )
        if(brianpartselobjlist1==nil && brianpartselobjpointlist1==nil && brianfullselobjlist1==nil
            then    printf("Nothing stored in Selected Set 1 - instructions -> Ctrl Shift keypad divide\n")
            else    brianpartselobjpointlist1destruct=brianpartselobjpointlist1
                      geDeselectAll()
                      foreach(obj brianfullselobjlist1
                          if(dbIsId(obj) == t
                              then     geSelectFig(obj)
                             else    sprintf(dmessage "Selection Set 1 no longer exists in its entirety\n")
                         )
                      )
                      foreach(obj brianpartselobjlist1
                         if(dbIsId(obj)==t
                              then    if(obj~>nPoints==length(car(brianpartselobjpointlist1destruct))
                                            then    geSelectFigPoint(obj car(brianpartselobjpointlist1destruct))
                                            else    sprintf(dmessage "Selection Set 1 no longer exists in its entirety\n")
                                         )
                              else    sprintf(dmessage "Selection Set 1 no longer exists in its entirety\n")
                          )
                      brianpartselobjpointlist1destruct=cdr(brianpartselobjpointlist1destruct)
                );foreach
                unless(dmessage    printf("Selection Set 1 selected\n"))
                when(dmessage    geDeselectAll() printf("Selection Set 1 no longer exists in its entirety\n"))
        )
    );let
    );procedure
    hiSetBindKey("Layout" "Ctrl<key>KP_End" "BSreselectSelSet1()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Brian,

    I started thinking about this - and did this bit of code:

     procedure(BSstoreSelSet1(@optional (cv geGetEditCellView()))
    let((group (groupName "BSstoreSelSet"))
        dbDeleteGroupByName(cv groupName)
        group=dbCreateGroup(cv groupName list("unordered" "deleteLast"))
        foreach(obj geGetSelectedSet(cv)
        dbAddObjectToGroup(group obj)
        )
        t
    )
    )

    You can then do dbGetGroupByName(cv "BSstoreSelSet")~>members to find out the objects in the group - it will remove the objects from the members list if they get deleted.

    For partial selection, it's tricky. Probably you'd have to store the partial selection info on each object as a user-defined property. Even then you'd have to handle the scenario on a polygon or path where the number of points changed due to an edit.

    So it's far from straightforward!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Hi Andrew, many thanks for your input. I was playing around with your code and came up with the below, however when I go to reselect the objects in the second function I get the error message: *Error* geSelectFig: Invalid figure - db:307396888. I can't figure out why, as it is a database object in the list as far as I can tell. Would you have an idea?

    Thanks,

    Brian.

     

    procedure(BSstoreSelSet1(@optional (cv geGetEditCellView()))
    let((group (groupName "BSstoreSelSet"))
        dbDeleteGroupByName(cv "BSstoreSelSet")
        group=dbCreateGroup(cv "BSstoreSelSet" list("unordered" "deleteLast"))
        foreach(obj geGetSelectedSet(cv)
        dbAddObjectToGroup(group obj)
        )
        t
    )
    )
    hiSetBindKey("Layout" "Ctrl Shift<key>KP_End" "BSstoreSelSet1()")


    procedure(BSreselectSelSet1(@optional (cv geGetEditCellView()))
        foreach(fig dbGetGroupByName(cv "BSstoreSelSet")~>members
            geSelectFig(fig)
        )
    )
    hiSetBindKey("Layout" "Ctrl<key>KP_End" "BSreselectSelSet1()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Brian,

    Apologies, it should have been ~>objects not ~>members. The members attribute gives you a list of groupMem objects, each of which has an object associated with it.  Actually that could be the place where you store the partial selection information rather than on the original object itself - for example (and there's no checking here whether the number of points in the object has changed in the meantime here - I'll leave that for you):

    procedure(BSstoreSelSet1(@optional (cv geGetEditCellView()))
        let((group (groupName "BSstoreSelSet") groupMem)
            dbDeleteGroupByName(cv groupName)
            group=dbCreateGroup(cv groupName list("unordered" "deleteLast"))
            foreach(obj geGetSelectedSet(cv)
                groupMem=dbAddObjectToGroup(group obj)
                when(geIsObjectPartiallySelected(obj nil)
                    groupMem~>partialSelect=geGetSelSetFigPoint(obj)
                )
            )
            t
        )
    )
    
    procedure(BSreselectSelSet1(@optional (cv geGetEditCellView()))
        let((partialSelect)
            foreach(groupMem dbGetGroupByName(cv "BSstoreSelSet")~>members
                partialSelect=groupMem~>partialSelect
                if(partialSelect then
                    geSelectFigPoint(groupMem~>object partialSelect)
                else
                    geSelectFig(groupMem~>object)
                )
            )
        )
    )
     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

     Andrew thanks again for all your help, that did the trick. I've added the checking below.

    Rgds,

    Brian.

     procedure(BSstoreSelSet1(@optional (cv geGetEditCellView()))
        let((group (groupName "BSstoreSelSet") groupMem)
            dbDeleteGroupByName(cv groupName)
            group=dbCreateGroup(cv groupName list("unordered" "deleteLast"))
            foreach(obj geGetSelectedSet(cv)
                groupMem=dbAddObjectToGroup(group obj)
                when(geIsObjectPartiallySelected(obj nil)
                    groupMem~>partialSelect=geGetSelSetFigPoint(obj)
                )
            )
            printf("Selection Set 1 Stored\n")
            BSgroupLength1=length(dbGetGroupByName(cv "BSstoreSelSet")~>objects)
            BSgroupPoints1=dbGetGroupByName(cv "BSstoreSelSet")~>members~>partialSelect
            t
        )
    )
    hiSetBindKey("Layout" "Ctrl Shift<key>KP_End" "BSstoreSelSet1()")

    procedure(BSreselectSelSet1(@optional (cv geGetEditCellView()))
        let((partialSelect)
            when(boundp('BSgroupPoints1) != t
                BSgroupPoints1=nil
            )
            when(boundp('BSgroupLength1) != t
                BSgroupLength1=nil
            )
            if(BSgroupPoints1==nil && BSgroupLength1==nil
                        then    printf("Nothing stored in Selected Set 1\n")
                else    if(length(dbGetGroupByName(cv "BSstoreSelSet")~>objects)==BSgroupLength1 && BSgroupPoints1==dbGetGroupByName(cv "BSstoreSelSet")~>members~>partialSelect
                        then    foreach(groupMem dbGetGroupByName(cv "BSstoreSelSet")~>members
                                partialSelect=groupMem~>partialSelect
                                if(partialSelect
                                    then    geSelectFigPoint(groupMem~>object partialSelect)
                                    else    geSelectFig(groupMem~>object)
                                )
                            )
                            printf("Selection Set 1 Selected\n")
                        else     printf("Selection Set 1 no longer exists in its entirety\n")
                    )
            )
        )
    )
    hiSetBindKey("Layout" "Ctrl<key>KP_End" "BSreselectSelSet1()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Brian,

    That checking is not what I meant. That adds checks to ensure that all the objects still exist - which isn't really necessary, and indeed makes this less useful. The whole point of storing it in a group is that if an object is deleted, the corresponding groupMember goes too - so  deleting a shape or instance which was in your stored selected set will cause it to be removed from the stored group automatically.

    So the whole BSgroupLength1 and BSgroupPoints1 stuff is unnecessary. With this check, it will stop you being able to use the selection save/restore if any of the members are deleted - and in fact it would have behaved sensibly. The check that I'd omitted was ensuring that the partialSelect information may have a different number of points in it  than the shape it's referring to - the shape (if it was a polygon or a path) may have been edited so it now has a different number of points. It will only be an issue for polygons and paths, since these are the only shape types (I think) which can alter the number of points (in IC5141 at least; in IC61 this is superseded by the built-in capability to save/restore the selection set). So you may need to check groupMem~>object~>objType to see if it's a path or polygon, and then compare groupMem~>object~>nPoints with length(partialSelect).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Andrew, yes I see what you mean, but I don't want it to reselect the set if there has been some objects deleted, so one can be confident when reselecting that the set is still as it was when stored, if with this approach I shouldn't need to add the extra checking as it is all done with BSgroupLength1 & BSgroupPoints1.


    Regards,

    Brian.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Andrew, thinking again I reckon your right its better to go the route of re-selecting when the set has changed. I have attempted to add the above checking (I think its correct - code attached). One thing; I am looking to reselect paths and polygons when they have been edited, somehow to select only their remaining points, however I notice when an object gets edited, the whole object gets deleted from the group. For instance say I store a polygon, then edit it, the polygon is no longer a group member. Is there anyway to keep the polygon in the group after editing?
    Regards,
    Brian.

    sel_set.il
    • 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