• 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. Help on skill code for unselecting/selcting objects like...

Stats

  • Locked Locked
  • Replies 23
  • Subscribers 143
  • Views 13900
  • 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

Help on skill code for unselecting/selcting objects like path/wire, rectangle/polygon etc.

zeroskills
zeroskills over 15 years ago

Hi All,

First of all, i have no talent doing skill code, i have very very basic knowledge of it. here's my request, and i think it's possible because if did some reseach on it, i just don't know how to do it.

Problem:

For example, i have a wire/path and a rectangle/polygon overlapping each other, i would like to select "only" the wire/path and not the rectangle/polygon. it would be nice if there's a skill code that can turn off or on wire/path or rectangle/polygon selection like the instance button on the LSW window.

So basically i would like to have something like the intance turning on or off selection, like this...

--->leSetObjectSelectable("inst" t) instance is selectable or

--->leSetObjectSelectable("inst" nil) instance is unselectable

But i would like something like this for other objects, like wire/path, rectabgle/polygon etc. not necessarily a button but i would like it to toggle, like "shift+w" to turn it on or off using if statements.

Thanks in advance, I hope someone could help me. 

 

 

  • Cancel
  • zeroskills
    zeroskills over 15 years ago

    Yes, i loaded 3 of them:

    load("/user/me/abLeMultiSelectionFilter.ils")

    this from your new code (no window pop up)

    load("/user/me/abShapeSelectionFilter.ils")

    load("/user/me/abToggleForm.il")

    ;;BINDKEYS
    hiSetBindKey("Layout" "Ctrl<Key>7" "abShapeSelectionSetFilter(?togglePath t)")
    hiSetBindKey("Layout" "Ctrl<Key>8" "abShapeSelectionSetFilter(?togglePolygon t)")
    hiSetBindKey("Layout" "Ctrl<Key>9" "abShapeSelectionSetFilter(?toggleText t)")

    and it doesn't work. i don't know why, it was working  yesterday until i crashed today. i've been doing boot and reboot and still the same.

    it's strange.

    i even tried loading your old code with the pop up window and it doesn't work. i get errors. 

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

    Well done, you've found the deliberate mistake in the code ;-) . After adding the ability to toggle or set each of the path, polygon and text modes, I forgot to ensure that the filter was actually registered. Essentially as it stood, it only works if you have first invoked the form, turned one of the checkboxes off, and then hit OK or apply. After that, the toggle functions would work (unless you used the form to turn back on all selections).

    Anyway, I've updated the code to take care of the filter registration whether you use the form or the direct call to abShapeSelectionSetFilter(). Here's the new code:

    /* abShapeSelectionFilter.ils
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 02, 2008 
    Modified   Sep 17, 2009 
    By         A.D.Beckett
    
    Main entry point:
    
    abShapeSelectionFilter()
    
    Brings up form, asking you to choose which type of shape objects
    are selectable.
    
    Written in C syntax to allow ease of modification by those scared
    of LISP ;->
    
    Requires abToggleForm.il and abLeMultiSelectionFilter.ils to
    be loaded first.
    
    Can also use:
    
    ; specify t or nil for whichever options you want to set or
    ; unset those options
    abShapeSelectionSetFilter(?setText t ?setPolygon t ?setPath nil)
    
    ; specify whichever keywords you want to toggle them
    abShapeSelectionSetFilter(?toggleText t ?togglePolygon t ?togglePath t)
    ; e.g. just toggling paths
    abShapeSelectionSetFilter(?togglePath t)
    
    ***************************************************
    
    SCCS Info: @(#) abShapeSelectionFilter.ils 09/17/09.22:21:18 1.3
    
    */
    
    importSkillVar(abShapeSelectionFilterForm)
    let(((pathsOK t) (shapesOK t) (textOK t) registered)
        /***************************************************************
        *                                                              *
        *                        (displayForm)                         *
        *                                                              *
        *     Local function, exported as abShapeSelectionFilter()     *
        *   which creates form if not already created, and displays    *
        *                             it.                              *
        *                                                              *
        ***************************************************************/
        defun(displayForm ()
    	unless(boundp('abShapeSelectionFilterForm)
    	    abCreateToggleForm(
    		?name 'abShapeSelectionFilterForm
    		?prompt "Check selectable objects:"
    		?textList '("Paths/Path Segments" "Polygons/Rects" "Text")
    		?callback 'abShapeSelectionFilterCB
    		?formTitle "Filter objects"
    		?buttonLayout 'OKCancelApply
    		?toggleHeight 80
    	    ) ; abCreateToggleForm
    	) ; unless
    	abToggleFormSetSelected(abShapeSelectionFilterForm
    	    list(
    		list("Paths/Path Segments" pathsOK)
    		list("Polygons/Rects" shapesOK)
    		list("Text" textOK)
    	    ) ; list
    	) ; abToggleFormSetSelected
    	hiDisplayForm(abShapeSelectionFilterForm)
        ) ; defun
    
        /***************************************************************
        *                                                              *
        *                      (regOrUnregFilter)                      *
        *                                                              *
        * Local function to take care of registering or unregistering  *
        *                          the filter                          *
        *                                                              *
        ***************************************************************/
        defun(regOrUnregFilter ()
    	if(!textOK || !shapesOK || !pathsOK then
    	    unless(registered
    		registered=t
    		abLeRegUserObjectSelectionFilter(
    		    "abShapeSelectionFilterFilter"
    		)
    	    )
    	else
    	    when(registered
    		abLeUnregUserObjectSelectionFilter(
    		    "abShapeSelectionFilterFilter"
    		)
    	    )
    	    registered=nil
    	) ; if 
        ) ; defun regOrUnRegFilter ()
    
        /******************************************************************
        *                                                                 *
        *                       (formCallback form)                       *
        *                                                                 *
        *   Local function, exported as abShapeSelectionFilterCB, which   *
        * takes choices from form, and updates lexically scoped variables *
        *    to remember settings - so that the filter() function can     *
        *                         reference them.                         *
        *                                                                 *
        ******************************************************************/
        defun(formCallback (form)
    	let((choices)
    	    choices=abToggleFormGetSelected(form)
    	    pathsOK=shapesOK=textOK=nil
    	    foreach(choice choices
    		case(choice
    		    ("Paths/Path Segments" pathsOK=t)
    		    ("Polygons/Rects" shapesOK=t)
    		    ("Text" textOK=t)
    		)
    	    )
    	    ;------------------------------------------------------------
    	    ; Ensure filter is registered or unregistered as needed
    	    ;------------------------------------------------------------
    	    regOrUnregFilter()
    	) ; let
        ) ; defun formCallback
    
        /***************************************************************
        *                                                              *
        *  (setOrToggle @key (setPath 'unbound) (setPolygon 'unbound)  *
        *   (setText 'unbound) togglePath togglePolygon toggleText)    *
        *                                                              *
        *     A function to allow non-form setting or toggling of      *
        *                various shape filter choices.                 *
        *                                                              *
        ***************************************************************/
        defun(setOrToggle (@key (setPath 'unbound) (setPolygon 'unbound)
    	(setText 'unbound) togglePath togglePolygon toggleText)
    	when(togglePath pathsOK=!pathsOK)
    	when(togglePolygon shapesOK=!shapesOK)
    	when(toggleText textOK=!textOK)
    	when(neq(setPath 'unbound) pathsOK=setPath)
    	when(neq(setPolygon 'unbound) shapesOK=setPolygon)
    	when(neq(setText 'unbound) textOK=setText)
    	;----------------------------------------------------------------
    	; Ensure filter is registered or unregistered as needed
    	;----------------------------------------------------------------
    	regOrUnregFilter()
    	;----------------------------------------------------------------
    	; Refresh the form if needed
    	;----------------------------------------------------------------
    	when(boundp('abShapeSelectionFilterForm) && 
    	    hiIsFormDisplayed(abShapeSelectionFilterForm)
    	    displayForm()
    	)
    	t
        ) ; defun setOrToggle
    
        /***************************************************************
        *                                                              *
        *                         (filter obj)                         *
        *                                                              *
        *       The actual selection filter. This is exported to       *
        *      abShapeSelectionFilterFilter. Compares the objType      *
        *     of the object with certain values, and then returns      *
        *    the value of the flag where the user has chosen which     *
        *                       are selectable.                        *
        *                                                              *
        ***************************************************************/
        defun(filter (obj)
    	case(obj~>objType
    	    (("path" "pathSeg") pathsOK)
    	    (("rect" "polygon") shapesOK)
    	    (("label" "textDisplay") textOK)
    	    (t t)
    	) ; case
        ) ; defun filter
    
        ;--------------------------------------------------------------------
        ; Export all the functions
        ;--------------------------------------------------------------------
        abShapeSelectionFilter=displayForm
        abShapeSelectionFilterFilter=filter
        abShapeSelectionFilterCB=formCallback
        abShapeSelectionSetFilter=setOrToggle
    )
    
    

    Best Regards,

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zeroskills
    zeroskills over 15 years ago

    Thanks Andrew! Now it's working again.

    I had the same the idea, since i've been playing with the form window before so i think that triggered the "no form" and direct to toggle. but the problem was, even with the form window, i can't make it work, so i can't actually prove it.

    Thanks again! 

    • 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