• 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 PCB Editor
  3. How to keep your variables in the design?

Stats

  • Replies 25
  • Subscribers 159
  • Views 12678
  • Members are here 0
More Content

How to keep your variables in the design?

Silver John
Silver John over 14 years ago

Hi, All.

I have a script that creates a form with several fields. I want to save the contents of these fields in design, and the next time when I open the design and launches the script I have already configured the form.

There are functions for including the file or string to .brd-file, there are functions for working with the properties of the design...

What is the best way to save my settings?

Maybe someone has an example code?

Thank you.

  • Sign in to reply
  • Cancel
  • fxffxf
    fxffxf over 14 years ago

     I woud look at using Skill's disembodied property list and the save the list in the database as an attachment (see axlSetAttachment).

    On read you can eval the attachment return (axlGetAttachment) which will give you free parsing and the disembodied prop list gives you some future profing if you need to latter on you need to extend what you are storing.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Silver John
    Silver John over 14 years ago

    It does not work. axlCreateAttachment () does not accept the list.
    It is necessary to print the list to a string?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • fxffxf
    fxffxf over 14 years ago

     You need to convert the disem prop list to a string and pass it as the argument t_data. Also s_dataFormat needs to be set to a value of 'string, To convert a disembodied prop list to a string just do:

          dataString = sprintf(nil " '%L" myDisembodyPropStruct)

    while it might be hard to see the single quote (') immediately before the %L is important for "Get" part of the process.

     To convert back from a string do:

      str = axlGetAttachment(... 'string)

      myDisembodyPropStruct = errsetstring(str)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Silver John
    Silver John over 14 years ago

    Thanks. It works.

    Do you think this is a good solution for storing these data in design file? Or it may be better to save them in a separate file? Why?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Silver John
    Silver John over 14 years ago

     For a better understanding of the issue: we are talking about additional editing tool for aligning objects on the board. The default tools are stored individual settings for each design (probably in the design).
    But would not it be negative consequences if I save my data in the design? Maybe in the next version of the editor, this feature will be unavailable or even break down the design? Or perhaps these data will be conflict with other programs?
    Does anyone have an opinion on this issue? How do you keep your variables, in the design or in a separate file?

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