• 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. PCB Design
  3. TCL to change user properties

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 166
  • Views 13869
  • Members are here 0
More Content
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

TCL to change user properties

fluxonator
fluxonator over 8 years ago

Hi All!

I have a problem writing a TCL script to change the display format of a user property dependent on its value.

Each symbol in my Capture symbol library has two attached properties called "BOM_IGNORE" and "DNP". The final aim is to set the display format of the DNP property dependent on the BOM_IGNORE property. But I already fail to access/display the property. It got it to work in a non-hierarchical design but not in a hierarchical one.

Here is my TCL code:

proc putsProps {} {
  set lStatus [DboState]
  set lNullObj NULL
  set lDesign [GetActivePMDesign]
  if {$lDesign != $lNullObj} {
    set occurenceIter [$lDesign NewOccurrencesIter $lStatus]
    set lOcc [$occurenceIter NextOccurrence $lStatus]
    # iterate over occurrences
    while {$lOcc != $lNullObj} {
      # get corresponding instance to occurrence
      set lPartInst [$lOcc GetPartInst $lStatus]
      if {$lPartInst != $lNullObj} {
        set lPropsIter [$lPartInst NewDisplayPropsIter $lStatus]
        set lDProp [$lPropsIter NextProp $lStatus]
        # iterate over display properties of instance
        while {$lDProp != $lNullObj } {
          # get and output the name of display property
          set lName [DboTclHelper_sMakeCString]
          $lDProp GetName $lName
          set lNameString [DboTclHelper_sGetConstCharPtr $lName]

          puts "Name of PartInst Property = $lNameString"

          set lDProp [$lPropsIter NextProp $lStatus]
        }
        delete_DboDisplayPropsIter $lPropsIter
      }
      set lOcc [$occurenceIter NextOccurrence $lStatus]
    }
    delete_DboDesignOccurrencesIter $occurenceIter
  }
}


As a result I get the following output:

Name of PartInst Property = Part Reference
Name of PartInst Property = Value

Name of PartInst Property = Part Reference
Name of PartInst Property = Value

Name of PartInst Property = Part Reference
Name of PartInst Property = Value
...


So I can access the Part Reference and the Value but neither the BOM_IGNORE nor the DNP property.

What am I doing wrong? Can someone point me into the right direction?

Thanks in advance,
Martin

  • Cancel
  • FrancoisD
    FrancoisD over 5 years ago

    Hi Martin,

    I know this is old, however I wanted to point out that you are iterating over "Display" properties, not "User" properties.

    Change the following lines:

    set lPropsIter [$lPartInst NewDisplayPropsIter $lStatus]
    set lDProp [$lPropsIter NextProp $lStatus]

    to:

    set lPropsIter [$Part NewUserPropsIter $lStatus]
    set lDProp [$lPropsIter NextUserProp $lStatus]

    And the following lines:

    set lDProp [$lPropsIter NextProp $lStatus]
     }

    delete_DboDisplayPropsIter $lPropsIter

    to:

    set lDProp [$lPropsIter NextUserProp $lStatus]
    }

    delete_DboUserPropsIter $lPropsIter

    If BOM_IGNORE is defined as a "User" property then you should be able to show its value.

    Francois

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Cadence Guidelines

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