• 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. How do I parse all the graphical entities of a schematic...

Stats

  • State Verified Answer
  • Replies 2
  • Subscribers 13
  • Views 73
  • Members are here 0
More Content

How do I parse all the graphical entities of a schematic symbol from an OLB

andakConsultingLtd
andakConsultingLtd 1 day ago

Hi everyone,

I want to parse an OLB file and all its content and export the graphical details for each entity. I would be happy to get the code for the simplest scenario (e.g. olb is open in Capture, schematic symbol with a single gate) as I can extend from there but I don't know how to initiate the iteration inside the OLB.

It would be great if you can provide a code example.

Regards

  • Cancel
  • Sign in to reply
  • TechnoBobby
    0 TechnoBobby 1 day ago
    Hi andakConsultingLtd ,

    Below is an example Tcl script for parsing an OLB file that extracts pin names and pin numbers. You can extend it further to meet your specific requirements.
    Hope it helps!

    proc dump_pin_name_and_number {libPath} {
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]
    set NullObj NULL

    # Open library
    set cLibPath [DboTclHelper_sMakeCString $libPath]
    set lSrcLib [$lSession GetLib $cLibPath $lStatus]
    if {$lSrcLib == $NullObj} {
    puts "ERROR: Unable to open library: $libPath"
    return
    }

    # Iterate packages
    set lPkgIter [$lSrcLib NewPackagesIter $lStatus]
    set lPackage [$lPkgIter NextPackage $lStatus]
    while {$lPackage != $NullObj} {
    # Package name
    set pkgCStr [DboTclHelper_sMakeCString]
    $lPackage GetName $pkgCStr
    set packageName [DboTclHelper_sGetConstCharPtr $pkgCStr]

    # Iterate devices
    set lDeviceIter [$lPackage NewDevicesIter $lStatus]
    set lDevice [$lDeviceIter NextDevice $lStatus]
    while {$lDevice != $NullObj} {
    # Get cell from device
    set lDboCell [$lDevice GetCell $lStatus]
    # Cell name
    set cellCStr [DboTclHelper_sMakeCString]
    $lDboCell GetName $cellCStr
    set cellName [DboTclHelper_sGetConstCharPtr $cellCStr]

    set partIndex 0
    set lLibPart [$lDboCell FindPart $partIndex $lStatus]
    if {$lLibPart != $NullObj} {
    set lPinCount [$lLibPart GetPinCount $lStatus]
    for {set i 0} {$i < $lPinCount} {incr i} {
    set lSymPin [$lLibPart GetPin $i $lStatus]

    # Pin Name
    set pinNameCStr [DboTclHelper_sMakeCString]
    $lSymPin GetPinName $pinNameCStr
    set pinName [DboTclHelper_sGetConstCharPtr $pinNameCStr]

    # Pin Number (mapped by device)
    set pinNumCStr [DboTclHelper_sMakeCString]
    $lDevice GetPinNumber $i $pinNumCStr
    set pinNumber [DboTclHelper_sGetConstCharPtr $pinNumCStr]

    puts [format "Package=%s Cell=%s PinIndex=%d Name=%s Number=%s" \
    $packageName $cellName $i $pinName $pinNumber]
    }
    }

    set lDevice [$lDeviceIter NextDevice $lStatus]
    }
    delete_DboPackageDevicesIter $lDeviceIter

    set lPackage [$lPkgIter NextPackage $lStatus]
    }
    delete_DboLibPackagesIter $lPkgIter
    }

    # Example usage:
    # dump_pin_name_and_number {C:\TCL\demo.OLB}
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • andakConsultingLtd
    0 andakConsultingLtd 1 day ago in reply to TechnoBobby

    Thank you, it works as expected.

    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information