• 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. Adams
  3. How to Change the ADAMS working directory by command language...

Following Cadence Design Systems’ acquisition of the Design & Engineering (D&E) business, the D&E Community Forum on the Nexus Community Center has been migrated in the Cadence Physical System Simulation Community. For more details and if you have any questions, please refer to the FAQ.

Stats

  • State Not Answered
  • Replies 3
  • Subscribers 3
  • Views 1
  • Members are here 0
More Content

How to Change the ADAMS working directory by command language or Python?

User1656498362424982944
User1656498362424982944 over 4 years ago
When I change the working directory of ADAMS, I always use File---Select Directory, and then use the dialog to select a new dir. I can't find a directly command about this , can anyone give me some advices?Grin
  • Sign in to reply
  • Cancel
  • Alex Mayes
    0 Alex Mayes over 4 years ago
    This can be achieved by changing the value of the DEFAULT_CMD_DIR environment variable. In command language this is discussed in the following article:
    • How to set the default directory for F2 (command file) import different than my working directory
     
    Effectively, to execute the PUTENV() function, use a command such as:
    • var set var=test string=(PUTENV("DEFAULT_CMD_DIR","Your ..path here"))
     
    I hope this helps,
    Alex
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • User1656498362424982944
    0 User1656498362424982944 over 4 years ago
    Hi, Alex.
    Thanks for your help and it's very useful for me.Thumbsup
    I successfully change the workdir use the DEFAULT_CMD_DIR environment. My comands are:
     
    var set var=test1 string=(PUTENV("DEFAULT_CMD_DIR","E:\\NewDir"))
    var set var=test2 int=(eval(CHDIR(GETENV("DEFAULT_CMD_DIR"))))
    variable del var= test1,test2
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jesper Slattengren
    0 Jesper Slattengren over 4 years ago
    I suggest that you use forward slash '/' instead of backslash '\' when writing macros.
    First, if you have tp build complex strings, pass between different macros or cmd to python, it get increasingly complex tracking the number of \\\\ you need to get your code to work.
    Second, it will work if you ever need to port to Linux.
     
    And yes, forward slash works on Windows as well.
    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information