• 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. How to open a .dsn file with tcl command?

Stats

  • State Verified Answer
  • Replies 12
  • Subscribers 13
  • Views 4449
  • Members are here 0
More Content

How to open a .dsn file with tcl command?

ZB202408042725
ZB202408042725 over 1 year ago

I notice that if I want to open a .dsn file(without .opj file), the cammand is like that : 

MenuCommand "57601"  | FileDialog  "OK" "D:/dsn/b.DSN" 2 | DialogBox  "OK" "D:/a.xml"

a.xml is complex file like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<DialogControls>

    <Control Type="EDIT" Enable="TRUE" Visible="TRUE" Id="15858">

        <Value><![CDATA[b]]></Value>

    </Control>

    <Control Type="AUTORADIO_BUTTON" Enable="FALSE" Visible="TRUE" Id="15880">

        <Value><![CDATA[0]]></Value>

        <Text><![CDATA[PSpicePWL]]></Text>

    </Control>

    <Control Type="AUTORADIO_BUTTON" Enable="FALSE" Visible="TRUE" Id="15881">

        <Value><![CDATA[1]]></Value>

        <Text><![CDATA[PSpiceAD]]></Text>

    </Control>

    <Control Type="EDIT" Enable="TRUE" Visible="TRUE" Id="15922">

        <Value><![CDATA[D:\dsn\]]></Value>

    </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>

    <Control Type="PUSH_BUTTON" Enable="TRUE" Visible="TRUE" Id="57670">

        <Value><![CDATA[&Help]]></Value>

    </Control>

    <Control Type="AUTOCHECK_BOX" Enable="TRUE" Visible="TRUE" Id="15882">

        <Value><![CDATA[0]]></Value>

        <Text><![CDATA[Enable PSpice Simulation]]></Text>

    </Control>

</DialogControls>

However, when I run this cammand, it is no always work! Sometime the b.dsn is opened successfully, sometime fail and block in the DialogBox. Therefore I want to know how this cammand work? What's the meaning of DialogBox?

  • Cancel
  • Sign in to reply
  • davidsf
    0 davidsf 1 month ago in reply to CadAP

    Hello, I am using SPB23.1 and I am also trying to open a .dsn file using a TCL script

    I tried both:

    MenuCommand "57601" | FileDialog "OK" "c:/dsn/BD255-02.dsn" 9
    and
    Menu "File::Open::Design" | FileDialog "OK" "c:/dsn/BD255-02.dsn" 1

    If the .opj file is present, both commands work fine

    However, if only the .dsn file is present (which it is my case), non of these commands produce any effect.

    I suspect it is because when you open a .dsn file without .opj, you reach the following intermediate window.

    Is there any solution (I cannot upgrade to SPB 25 because my company has not yet migrated)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • PatEscher
    0 PatEscher 1 month ago in reply to davidsf

    you need to create a basic .opj file through tcl upfront and then simply open this .opj file through tcl.

    You can use similar code like below (I believe there are more extensive examples in the tclscripts delivered with OrCAD)

    This one is for a library, so you need to adjust it for your needs (Type should be Schematic Design)

    set opjContent [open "$opjPath" "w"]

    puts $opjContent {(ExpressProject ""}

    puts $opjContent { (Folder "Design Resources"}

    puts $opjContent { (Folder "Library")}

    puts $opjContent " (File \".\\$filename\""

    puts $opjContent { (Type "Schematic Library"))}

    puts $opjContent { (DOCKED "TRUE")}

    puts $opjContent { )}

    puts $opjContent {)}

    close $opjContent

    btw, instead of going through the MenuCommand, simply use the command Open

    --> Open C:/temp/demoj1.dsn

    • 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