• 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. Capture quit unexpectedly after delete DboGlobal instances...

Stats

  • State Verified Answer
  • Replies 1
  • Subscribers 13
  • Views 2071
  • Members are here 0
More Content

Capture quit unexpectedly after delete DboGlobal instances in page by TCL script DeleteGlobal

seanhung365
seanhung365 over 2 years ago

Hello,

I tried using TCL to delete some DboGlobal instances which matches a criteria.

However, after I delete it by DboPage function DboGlobal, the schematic seems to have some invisible error which will lead Capture quit unexpectedly under some operations.

set lStatus [DboState]
set lNullObj NULL
set pPage [GetActivePage]
set lGlobalsToDel [list]
set lGlobalIter [$pPage NewGlobalsIter $lStatus]
set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
while {$lGlobalInst!=$lNullObj} {
# screen out wire matched some criteria, then add to array for later delete
lappend lGlobalsToDel $lGlobalInst
set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
}
delete_DboPageGlobalsIter $lGlobalIter

foreach lGlobal $lGlobalsToDel {
$pPage DeleteGlobal $lGlobal
#catch {DboTclHelper_sEvalPage $pPage}
#catch {ZoomRedraw}
}

Source File

Error

  • Sign in to reply
  • Cancel
Parents
  • CadAP
    +1 CadAP over 2 years ago

    Hi @Seanhung365,

    Please find the below modifed tcl which will delete the global object form the active page.

    I added the below line:

    # 1.set GlobalItemId [$lGlobalInst GetId $lStatus]
    # 2.SelectObjectById $lGlobal
    # 3.Menu "Edit::Delete"
    # 4.Menu "File::Save"

    set lStatus [DboState]
    set lNullObj NULL
    set pPage [GetActivePage]
    set lGlobalsToDel [list]
    set lGlobalIter [$pPage NewGlobalsIter $lStatus]
    set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
    while {$lGlobalInst!=$lNullObj} {
    # screen out wire matched some criteria, then add to array for later delete
    set GlobalItemId [$lGlobalInst GetId $lStatus]
    lappend lGlobalsToDel $GlobalItemId

    set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
    }
    delete_DboPageGlobalsIter $lGlobalIter

    UnSelectAll

    foreach lGlobal $lGlobalsToDel {

    SelectObjectById $lGlobal
    # $pPage DeleteGlobal $lGlobal
    # catch {DboTclHelper_sEvalPage $pPage}
    # catch {ZoomRedraw}

    }
    Menu "Edit::Delete"
    Menu "File::Save"


    # Hope this helps

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • CadAP
    +1 CadAP over 2 years ago

    Hi @Seanhung365,

    Please find the below modifed tcl which will delete the global object form the active page.

    I added the below line:

    # 1.set GlobalItemId [$lGlobalInst GetId $lStatus]
    # 2.SelectObjectById $lGlobal
    # 3.Menu "Edit::Delete"
    # 4.Menu "File::Save"

    set lStatus [DboState]
    set lNullObj NULL
    set pPage [GetActivePage]
    set lGlobalsToDel [list]
    set lGlobalIter [$pPage NewGlobalsIter $lStatus]
    set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
    while {$lGlobalInst!=$lNullObj} {
    # screen out wire matched some criteria, then add to array for later delete
    set GlobalItemId [$lGlobalInst GetId $lStatus]
    lappend lGlobalsToDel $GlobalItemId

    set lGlobalInst [$lGlobalIter NextGlobal $lStatus]
    }
    delete_DboPageGlobalsIter $lGlobalIter

    UnSelectAll

    foreach lGlobal $lGlobalsToDel {

    SelectObjectById $lGlobal
    # $pPage DeleteGlobal $lGlobal
    # catch {DboTclHelper_sEvalPage $pPage}
    # catch {ZoomRedraw}

    }
    Menu "Edit::Delete"
    Menu "File::Save"


    # Hope this helps

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
No Data
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