• 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. Allegro X Scripting - TCL
  3. Accessing occurrence properties from TCL script?

Stats

  • State Not Answered
  • Replies 2
  • Subscribers 12
  • Views 5385
  • Members are here 0
More Content

Accessing occurrence properties from TCL script?

Valueduser
Valueduser over 3 years ago

I have a design that incorporates hierarchical elements and was annotated using the recommended method (using occurrences).  So when I look at the the properties of say a capacitor, I see a white field with the Instance properties and a yellow field with the occurrence properties.  If I iterate over the parts on a page and call the GetReferenceDesignator method it returns the instance refDes.  Does anyone know how I would get occurrence refDes (the value that shows up in the yellow field)?  The TCL API reference is pretty sparse on details, if anyone could point me in the right direction it would be greatly appreciated.  Below is the code I am using to iterate over the parts on a page:

proc iterateParts {pageObject} {
    set lStatus [DboState]
    set lPartInstsIter [$pageObject NewPartInstsIter $lStatus]
    set refDesList []

    #initialize a Cstring variable for holding object names
    set name [DboTclHelper_sMakeCString]

    #get the first part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    set lNullObj NULL

    while {$lInst!=$lNullObj} {
        #dynamic cast from DboPartInst to DboPlacedInst
        set lPlacedInst [DboPartInstToDboPlacedInst $lInst]


         if {$lPlacedInst != $lNullObj} {
         #placeholder: do your processing on $lPlacedInst
         iterateProps $lPlacedInst
         $lPlacedInst GetReferenceDesignator $name
         lappend refDesList [DboTclHelper_sGetConstCharPtr $name]
        }
    #get the next part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    }
    delete_DboPagePartInstsIter $lPartInstsIter

    #sort list
    set refDesList [lsort $refDesList]
    return $refDesList
}

  • Cancel
  • Sign in to reply
Parents
  • Diego cmre
    0 Diego cmre over 3 years ago

    I think your code can traverse only instances, try to use example on chapter "3.2.28.2 Iterate over instance occurrence hierarchy" page 40 of OrCAD Capture TCL/Tk Extensions Revision: 1.2 Apllication note.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Diego cmre
    0 Diego cmre over 3 years ago

    I think your code can traverse only instances, try to use example on chapter "3.2.28.2 Iterate over instance occurrence hierarchy" page 40 of OrCAD Capture TCL/Tk Extensions Revision: 1.2 Apllication note.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Valueduser
    0 Valueduser over 3 years ago in reply to Diego cmre

    Since I made my original post, I found the "Compare Designs" example.  When you use it, it shows both the instance and the occurrence reference designators, so I know it's possible.  I haven't had the chance to look too closely at the actual example code yet.  

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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