• 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. Copy / Duplicate Pages within a .DSN in Orcad Using TCL

Stats

  • State Verified Answer
  • Replies 10
  • Subscribers 13
  • Views 3907
  • Members are here 0
More Content

Copy / Duplicate Pages within a .DSN in Orcad Using TCL

Henry Monro
Henry Monro over 1 year ago

set page_present no
foreach item $pages_names {
# Check if the string matches the current element
if {$item!=NULL} {
set lPageName [DboTclHelper_sMakeCString $item]
set lPage1 [$lSchematic GetPage $lPageName $lStatus]
if {$lPage == $lPage1} {
set page_present yes
}
}
}

if {$page_present!="no"} {

####
Help me Here ==>> COPY/DUPLICATE page multiple times within a same DSN with a unique name depends upon the iterations like pageabc_1, pageabc_2, pageabc3...

####

}

Thanks in Advance

  • Sign in to reply
  • Cancel
  • tennywhy
    0 tennywhy 11 months ago in reply to CadAP

    CadAP could you give me some more advice ? thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    +1 CadAP 11 months ago in reply to tennywhy

    Hi Tennywhy,

    Please try below code just open a design and modify tcl for schematic name and source it.

    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]

    set lDesignLoc [GetSelectedPMItems]
    set ldesign [GetActivePMDesign]
    set lschiName [DboTclHelper_sMakeCString]
    set lDesignName [DboTclHelper_sMakeCString]
    set lschiNewName [DboTclHelper_sMakeCString "CadAP"]
    set lView [$ldesign GetRoot $lStatus]
    set lSchi [$ldesign GetRootSchematic $lStatus]
    set lPagecount [$lSchi GetPageCount $lStatus]
    # $lSchi GetName $lschiName
    $lSchi SetName $lschiNewName
    Menu "File::Save"

    $ldesign GetName $lDesignName

    set lSchi [$ldesign GetRootSchematic $lStatus]
    $lSchi GetName $lschiName

    set lDesignloc [DboTclHelper_sGetConstCharPtr $lDesignName]


    for {set i 0} {$i <$lPagecount} {incr i} {
    set lPageNewName [DboTclHelper_sMakeCString "Test$i"]
    set lDboPage [$lSchi GetPage $i $lStatus]
    # puts $lDboPage
    $lSchi Rename $lDboPage $lPageNewName
    $lSchi SavePage $lDboPage 1
    }
    Menu "File::Save"
    Menu "File::Close"
    after 1000
    Open "$lDesignloc"

    Try and let me know your feedback.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • tennywhy
    0 tennywhy 11 months ago in reply to CadAP

    Thank you so much sir , that exactly was i want, it's worked perfectly,
    i need digest your code. You've done me a great favor

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 11 months ago in reply to tennywhy

    tennywhy  Good to hear that helped.

    Keep exploring tcl ......Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tennywhy
    0 tennywhy 11 months ago in reply to CadAP

    Thank you so much, your encouragement is very important to me

    • 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