• 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
Parents
  • CadAP
    0 CadAP over 1 year ago


    #Just giving an sample code how you can copy paste a selected page. You can create your own code with different page name using iteration.

    set dir [file dirname [info script]]
    set file [open "test.xml" a+]

    if {$page_present!="no"} {

    set pagenumber "10"
    set dir [file dirname [info script]]
    set file [open "$dir/test.xml" a+]

    puts $file {<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <DialogControls>
    <Control Type="EDIT" Enable="TRUE" Visible="TRUE" Id="2377"> }
    puts $file "<Value><!\[CDATA\[$pagenumber\]\]></Value>"
    puts $file {</Control>
    <Control Type="PUSH_BUTTON" Enable="TRUE" Visible="TRUE" Id="1">
    <Value><![CDATA[OK]]></Value>
    </Control>
    <Control Type="PUSH_BUTTON" Enable="TRUE" Visible="TRUE" Id="2">
    <Value><![CDATA[Cancel]]></Value>
    </Control>
    </DialogControls>}

    close $file

    SelectPMItem "SCHEMATIC1/PAGE2" ; #Itertate over page and select the required page for copy.I am manually selecting page for now.

    Menu "Edit::Copy ; #Command to Copy the selected Page

    SelectPMItem "SCHEMATIC1" ;# Now select the schematic under which you want to add page.I am manually selecting schematic for now.

    #Below command will paste the copy page with page number 10

    Capture> Menu "Edit::Paste" | DialogBox "OK" "$dir/"test.xml"


    }

    Hope this helps!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to CadAP

    It seems these are the capture commands for copy-pasting that you just mentioned. Isn't there a way to accomplish this using TCL commands? For instance, does a command like 'delete page' exist for copy pasting page, such as in set del_page [$lSchematic DeletePage $lPage] ?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to CadAP

    It seems these are the capture commands for copy-pasting that you just mentioned. Isn't there a way to accomplish this using TCL commands? For instance, does a command like 'delete page' exist for copy pasting page, such as in set del_page [$lSchematic DeletePage $lPage] ?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify 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