• 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. TCl script to replace selected parts with a component from...

Stats

  • State Verified Answer
  • Replies 16
  • Subscribers 13
  • Views 5671
  • Members are here 0
More Content

TCl script to replace selected parts with a component from library

soliman1991
soliman1991 over 1 year ago

Hello, 

I need to replace components in a schematic page with parts from the library, I tried DboPage_ReplaceInst, but the documentation is very vague.

Here is my attempt for reference: 

set selected [GetSelectedObjects]
puts $selected
set newPackageStr {CAP CER 0.1UF 10V X8M 0201} #that is the package name in the library
set lStatus [DboState]
set lSession $::DboSession_s_pDboSession
DboSession -this $lSession


set pLibName [file normalize {d:\random\Library.olb}]
set lLibName [DboTclHelper_sMakeCString $pLibName]
set lLib [$lSession GetLib $lLibName $lStatus]

set LibraryName [DboTclHelper_sMakeCString]

$lLib GetName $LibraryName
set newPackageName [DboTclHelper_sMakeCString newPackageStr]
set newPackage [$lLib GetPackage $newPackageName $lStatus]

foreach obj $selected {
    set device [$obj GetDevice $lStatus]
    DboPage_ReplaceInst $obj $newPackageName $newPackage $device $lStatus 0 0 1 1
}
  • Cancel
  • Sign in to reply
  • E2202407295816
    0 E2202407295816 over 1 year ago in reply to CadAP

    CAD AP you are a GEM for this TCL

    • 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