• 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. Is there a possibility to write the value of the Adams/Variable...

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 2
  • Members are here 0
More Content

Is there a possibility to write the value of the Adams/Variable in the Excel file?

4ondrej.petergac
4ondrej.petergac over 6 years ago
Hello,
 
Is there a way to write the value of the adams variable in the excel file?
 
For example I want to write list of variable values in the excel file is there any way how I can do it?
 
Thanks and best regards,
Ondrej
  • Sign in to reply
  • Cancel
  • jozef.bucha
    0 jozef.bucha over 6 years ago
    Hello Ondrej,
     
    Adams contains openpyxl
     
    openpyxl.readthedocs.io/.../
     
    you can use it directly from command line in adams
    for example this should create test.xlsx in working dir:
     
    from openpyxl import Workbook
    wb = Workbook()
    dest_filename = 'test.xlsx'
    wb.save(filename=dest_filename)
     
    Jozef
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Thomas Nygårds
    0 Thomas Nygårds over 6 years ago
    Hi Ondrej!
     
    I saw that Jozef was quicker that I, and I agree if you are going to to something extensive then use openpyxl directly. If you are doing something quick and want to use only adams command language you can do like below:
     
     
    You can write numerical values like this:
     
    aexplore xlsx real_value write &
    xlsx_file = "Test_view_variable.xlsx" &
    sheet_name = "my_sheet" &
    worksheet_python_object = "None" &
    real_value = (eval(.my_variable)) &
    top_left_cell = "A1" &
    data_direction = vertical
     
    and string values like this:
     
    aexplore xlsx string_value write &
    xlsx_file = "Test_view_variable.xlsx" &
    sheet_name = "my_sheet" &
    worksheet_python_object = "None" &
    string_value = "hello" &
    top_left_cell = "B2" &
    data_direction = vertical
     
    if you are working on an already open workbook you can use the
      worksheet_object_name = "ws" &
    input instead of inputs
    xlsx_file = "Test_view_variable.xlsx" &
    sheet_name = "my_sheet" &
     
    (but do not forget to save it)
     
    and you can use indexing like this:
      top_left_row = 1 &
      top_left_column = 2 &
    instead of cell address like this
    top_left_cell = "B2" &
     
     
    Regards
    Thomas
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • 4ondrej.petergac
    0 4ondrej.petergac over 6 years ago
    Hi Jozef and Thomas,
     
    thanks a lot for your responses and examples.
     
    Best regards,
    Ondrej
     
    • 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