Quantcast
Channel: Cadence PCB Design Forum
Viewing all articles
Browse latest Browse all 5525

TCL to change user properties

$
0
0

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


Viewing all articles
Browse latest Browse all 5525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>