• 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 select a project and save it with Tcl Command

Stats

  • State Suggested Answer
  • Replies 15
  • Answers 1
  • Subscribers 12
  • Views 2641
  • Members are here 0
More Content

How to select a project and save it with Tcl Command

Morgan
Morgan 5 months ago

Hi friends of the community,

I want to use Tcl Command to select the last opened project name(or library) in capture cis, such as .dsn(.olb), and then, save and close it, but I encounter some troubles:

1.When I iter all open designs in the session with 3.2.5, it get the design name, but not listed in the order in which they were opened, so I can't find the last opened project; and sometimes, it listed the project name I have closed;

2.When I try to select the .dsn or .olb name use <ui::PMActivate "d:/cadence/work/test/mytest.opj"> and <SelectPMItem "./mytest.dsn">, and catch the error, it report errors with "RuntimeError Item Not Found" frequently. Is there any Tcl Command that implements this function?

3.When I save the project or library after modify with the code blow, It will pop up a window that needs to be confirmed, but I don't need the step, I want just save it directly.

#

#

# the code use this:


DboSession_MarkAllLibForSave $lLibSession $lDboLibrary
DboSession_SaveLib $lLibSession $lDboLibrary

#

#

# the confirm window like this:

  • Sign in to reply
  • Cancel
  • Morgan
    0 Morgan 5 months ago in reply to CadAP

    Hi CadAP,

    I have opened 5 dsn file, and puts this 3 variable, all the values look like not wrong.

    Now "set lTimeIndex 4", get the lDesignName T5.DSN, but Actually PMActivate file T3, and SelectPMItem failed.


    #the command log as below:

    Capture> source [file normalize {G:/Cadence/Work/GetLastOpenedProject.tcl}]
    lDesignloc: {G:\CADENCE\WORK\TEST\T1.DSN} {G:\CADENCE\WORK\TEST\T2.DSN} {G:\CADENCE\WORK\TEST\T3.DSN} {G:\CADENCE\WORK\TEST\T4.DSN} {G:\CADENCE\WORK\TEST\T5.DSN}
    lDesgnLoc: G: CADENCE WORK TEST T5.DSN
    lDesignfromIndex: G:\CADENCE\WORK\TEST\T5.DSN
    lDesignName: T5.DSN

    Capture> ui::PMActivate "G:/CADENCE/WORK/TEST/T3.opj"
    Capture> [ 1]RuntimeError Item Not Found

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 5 months ago in reply to Morgan

    Hi Morgan,

    Can you just clear variable lDesignfromIndex (set lDesignfromIndex {}) before setting it?

    This might help you get the correct value.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Morgan
    0 Morgan 5 months ago in reply to CadAP

    Hi CadAP,

    Thank you for the idea, but the result results does not change.

    Maybe this is the V24.1 bug, I test in V16.6, this problem did not occur.

    And I find one new problem, just use proc "atime", but can't use "mtime", it not work.

    set lDesignfromIndex {}
    set lDesignfromIndex [lindex $lDesignloc $lTimeIndex]

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 5 months ago in reply to Morgan

    Hi Morgan,

    I used "file mtime $lDesignName" in spb24.1 and it's working.

    Can you please check and let me know spb24.1 hotfix? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Morgan
    0 Morgan 5 months ago in reply to CadAP

    24.1 S003 (4280230) 

    • 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