• 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. Audit OLB's in directory

Stats

  • State Suggested Answer
  • Replies 4
  • Answers 1
  • Subscribers 13
  • Views 125
  • Members are here 0
More Content

Audit OLB's in directory

Mhawley1
Mhawley1 1 day ago

Hello Can anybody give me a boiler plate on batch opening OLB's . 

I want to be able to open an OLB , read the names of all the symbols within and then close . 

  • Cancel
  • Sign in to reply
Parents
  • TechnoBobby
    0 TechnoBobby 1 day ago

    Hi Mhawley1 ,

    Please try below script. It reads the specified olb and prints the symbol names without opening the library in Capture.

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

    # Open library in batch mode (command window)
    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]

    puts $packageName

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

    # Example Usage
    # dump_pkg_name {C:\TCL\LIBRARY1.OLB}

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • PatEscher
    0 PatEscher 1 day ago in reply to TechnoBobby

    open is 'relative'.

    This code does not necessarily open the olb in the user Interface, but it does open the OLB inside OrCAD, so a lock file is created.
    you need to make sure not keep any references open and close it, otherwise it will be locked till the end of the OrCAD session

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • PatEscher
    0 PatEscher 1 day ago in reply to TechnoBobby

    open is 'relative'.

    This code does not necessarily open the olb in the user Interface, but it does open the OLB inside OrCAD, so a lock file is created.
    you need to make sure not keep any references open and close it, otherwise it will be locked till the end of the OrCAD session

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Mhawley1
    0 Mhawley1 1 day ago in reply to PatEscher

    I can cope with that , I dont actually want the file , just the names . So as long as I close the capture session , hopefully the Lock files are removed . 

    • 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