• 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. need help with this label rotate function

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 5471
  • 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 help with this label rotate function

JJAP
JJAP over 1 year ago

Can you help this label rotate function. this code is working, other than orient, I wanted to add justify function as well because when the labels got rotated (R180), the label will be "flipped" and I want to correct it.

here's the code:

procedure(rotate_toggle()

foreach(fig geGetSelSet()
when(fig~>orient
fig~>orient =case(fig~>orient
("R0" "R90" )
("R90" "R180" )
("R180" "R270" )
("R270" "R0" )
(t fig~>orient )
)
)
)

);procedure

Sorry I'm new to skill code programming. I saw this posted by Andrew B., this is what I would like but just use 1 bindkey to cycle to the options.

car(geGetSelSet())~>justify="centerRight" car(geGetSelSet())~>orient="R90" 

car(geGetSelSet())~>justify="centerRight" car(geGetSelSet())~>orient="R0" 

car(geGetSelSet())~>justify="centerRight" car(geGetSelSet())~>orient="R270" 

car(geGetSelSet())~>justify="centerLeft" car(geGetSelSet())~>orient="R0" 

  • Cancel
  • AurelBuche
    AurelBuche over 1 year ago

    Hi,

    The following snippet should work out of the box. (Even though It might be over-complicated if you are new to SKILL)

    ;; SKILL++ is required so the defined function can always access the following variable
    (inScheme
      (let ((infinite_loop
              '(("centerRight" "R90" )
                ("centerRight" "R0"  )
                ("centerRight" "R270")
                ("centerLeft"  "R0"  )
                )))
    
        ;; Build infinite loop from list by making it point to itself 
        (nconc infinite_loop infinite_loop)
    
        (defun get_selected_labels ()
          "Return currently selected labels"
          (setof obj (geGetSelectedSet) (equal "label" obj->objType)))
    
        (defglobalfun custom_cycle_label_orients ( @key  (labels (get_selected_labels))
                                                   @rest _args
                                                   )
          "Cycle through a list of predefined orient/justification pairs and set them to LABELS"
          (destructuringBind (justify orient) (pop infinite_loop)
            (foreach label labels
              (setf label->justify justify)
              (setf label->orient  orient )
              ))
          t)
    
        ));scheme closure
    
    (hiSetBindKey "Layout" "<Key>F5" "custom_cycle_label_orients")

    If you are eager for any explanation, I'll be happy to detail how it works

    Hope this helps,

    Cheers

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • JJAP
    JJAP over 1 year ago in reply to AurelBuche

    Thanks Aurélien! I tested it and it works! 

    • 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