• 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. Changing amount of rows and columns in a selected contact...

Stats

  • Locked Locked
  • Replies 13
  • Subscribers 146
  • Views 20045
  • 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

Changing amount of rows and columns in a selected contact cell

blankman
blankman over 14 years ago

Hi all, Im trying to add bind keys to increment and decrement the amount of rows and columns in a selected contact cell.

 

Im using...

procedure(BSchangeVia2x1()
foreach(fig geGetSelSet()
  when(fig~>objType=="inst"
      propValue = car(fig~>prop~>value)
      fig~>prop~>value=propValue+1
    )
    )
)
hiSetBindKey("Layout" "Alt<key>KP_Add" "BSchangeVia2x1()")

 

However this increments both row and column values. Is there a way to increment only the row value and leave the column value as is?

Cheers,

Brian.

  • Cancel
Parents
  • dmay
    dmay over 14 years ago

    Brian,
    Take a look at the prop~>name values. You are incrementing every property by one. Since there are both row and column properties, you will therefore increment both. It is also possible that there are other properties that are not integers and will cause your code to fail. You can actually increment the value of the row and column settings by directly accessing the property by name.

    fig~>row =  fig~>row + 1  (assuming row is the property name)

    Also, in your code you are getting the prop value using:

    car(fig~>prop~>value)

    You are using "car" because fig~>prop is a list and therfore fig~>prop~>value is a list. However, you are incrementing ALL props with this since fig~>prop is a list:

    fig~>prop~>value = propValue + 1

    If you just want to change the first prop:

    car(fig~>prop~>value) = propValue + 1

    This is more consistent with the way you retrieved the value in the first place. However, the property list is not always going to be in the order you expect. You should look at the property name before you adjust the value either by going to the known property directly as I demonstrated (fig~>row), or by checking the name like this:

    foreach(prop fig~>prop
      when(fig~>prop~>name=="row"
        fig~>prop~>value = fig~>prop~>value + 1
      )
    )

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dmay
    dmay over 14 years ago

    Brian,
    Take a look at the prop~>name values. You are incrementing every property by one. Since there are both row and column properties, you will therefore increment both. It is also possible that there are other properties that are not integers and will cause your code to fail. You can actually increment the value of the row and column settings by directly accessing the property by name.

    fig~>row =  fig~>row + 1  (assuming row is the property name)

    Also, in your code you are getting the prop value using:

    car(fig~>prop~>value)

    You are using "car" because fig~>prop is a list and therfore fig~>prop~>value is a list. However, you are incrementing ALL props with this since fig~>prop is a list:

    fig~>prop~>value = propValue + 1

    If you just want to change the first prop:

    car(fig~>prop~>value) = propValue + 1

    This is more consistent with the way you retrieved the value in the first place. However, the property list is not always going to be in the order you expect. You should look at the property name before you adjust the value either by going to the known property directly as I demonstrated (fig~>row), or by checking the name like this:

    foreach(prop fig~>prop
      when(fig~>prop~>name=="row"
        fig~>prop~>value = fig~>prop~>value + 1
      )
    )

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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