• 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 - Skill
  3. Skill to update the value of Custom Variables in Allegro...

Stats

  • State Verified Answer
  • Replies 5
  • Answers 1
  • Subscribers 21
  • Views 188
  • Members are here 0
More Content

Skill to update the value of Custom Variables in Allegro x 25.1 PCB Editor

MZ20250602835
MZ20250602835 3 days ago

Dear all,


i can use Command as below showed to update the value of Custom Variables in PCB Editor.

FORM tbx_customvar_update_main grid change 106,variable_value test

FORM tbx_customvar_update_main var_update 'Current context only'

FORM tbx_customvar_update_main var_update All

To update custom variables in Cadence PCB / Allegro using the Toolbox (tbx) utility, open the setup menu, select custom variables, and run the update command to input new values like dates or revisions, then run it again to refresh the drawing

I want to use skill in .il File instead of Command, may i ask what is the skill to have the same function?

Many thanks

Moyan

  • Sign in to reply
  • Cancel

Top Replies

  • MZ20250602835
    MZ20250602835 1 day ago in reply to andakConsultingLtd +2 verified
    Hi, andakConsultingLtd , many thanks again and i found the solution as below: axlShell( "FORM tbx_customvar_update_main grid change 108,variable_value '100x 100'" ) axlShell("FORM tbx_customvar_update_main…
Parents
  • andakConsultingLtd
    0 andakConsultingLtd 1 day ago

    Hi Moyan,

    See if you can use this (untested) code for your app:

    ; ---------------------------------------------------------------------------
    ; 1. DEFINE the property in the design's property dictionary (one-time setup)
    ;    axlDBCreatePropDictEntry(name dataType objTypes valRange units constraint)
    ;    Only needs to run once per design -- guard it so re-running doesn't error.
    ; ---------------------------------------------------------------------------
    procedure( myskill_ensureProps()
        unless( axlDBGetPropDictEntry("MY_TEMP")
            axlDBCreatePropDictEntry("MY_TEMP" "REAL" list("pins") list(nil nil) "C" nil)
        )
    )

    ; ---------------------------------------------------------------------------
    ; 2. WRITE the property onto a specific object
    ;    axlDBAddProp(dbid list(propName propValue))
    ; ---------------------------------------------------------------------------
    procedure( myskill_setTemp(pin tempVal)
        myskill_ensureProps()
        unless( errset( axlDBAddProp(pin list("MY_TEMP" tempVal)) )
            error("myskill" "axlDBAddProp failed for MY_TEMP=%g on %s.%s"
                  tempVal (or pin->parent->refdes "?") (or pin->number "?"))
        )
        printf("INFO myskill: MY_TEMP = %g set on %s.%s\n"
               tempVal (or pin->parent->refdes "?") (or pin->number "?"))
    )

    ; ---------------------------------------------------------------------------
    ; 3. READ the property back off the object
    ;    axlDBGetProperties(dbid '("user")) returns a list of (name value) pairs
    ; ---------------------------------------------------------------------------
    procedure( myskill_getPropValue(propName propList)
        let( (result targetStr)
            result    = nil
            targetStr = upperCase(propName)
            foreach( entry propList
                when( upperCase(sprintf(nil "%s" car(entry))) == targetStr
                    result = cadr(entry)
                )
            )
            result
        )
    )

    procedure( myskill_getTemp(pin)
        let( (props strVal result)
            props  = axlDBGetProperties(pin '("user"))
            strVal = myskill_getPropValue("MY_TEMP" props)
            result = if( strVal != nil then atof(sprintf(nil "%s" strVal)) else nil )
            result
        )
    )

    ; ---------------------------------------------------------------------------
    ; 4. (optional) REMOVE the property from an object
    ;    axlDBDeleteProp(dbid propName)
    ; ---------------------------------------------------------------------------
    procedure( myskill_clearTemp(pin)
        unless( errset( axlDBDeleteProp(pin "MY_TEMP") )
            error("myskill" "axlDBDeleteProp failed for MY_TEMP on %s.%s"
                  (or pin->parent->refdes "?") (or pin->number "?"))
        )
    )

    ; ---------------------------------------------------------------------------
    ; Example usage
    ; ---------------------------------------------------------------------------
    let( (pin)
        pin = car(axlDBGetPointList(nil "Select a pin: " '("Pin")))->objType  ; placeholder for pin selection
        myskill_setTemp(pin 85.0)      ; write MY_TEMP = 85.0 on the pin
        printf("MY_TEMP readback = %g\n" myskill_getTemp(pin))  ; read it back
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • andakConsultingLtd
    0 andakConsultingLtd 1 day ago

    Hi Moyan,

    See if you can use this (untested) code for your app:

    ; ---------------------------------------------------------------------------
    ; 1. DEFINE the property in the design's property dictionary (one-time setup)
    ;    axlDBCreatePropDictEntry(name dataType objTypes valRange units constraint)
    ;    Only needs to run once per design -- guard it so re-running doesn't error.
    ; ---------------------------------------------------------------------------
    procedure( myskill_ensureProps()
        unless( axlDBGetPropDictEntry("MY_TEMP")
            axlDBCreatePropDictEntry("MY_TEMP" "REAL" list("pins") list(nil nil) "C" nil)
        )
    )

    ; ---------------------------------------------------------------------------
    ; 2. WRITE the property onto a specific object
    ;    axlDBAddProp(dbid list(propName propValue))
    ; ---------------------------------------------------------------------------
    procedure( myskill_setTemp(pin tempVal)
        myskill_ensureProps()
        unless( errset( axlDBAddProp(pin list("MY_TEMP" tempVal)) )
            error("myskill" "axlDBAddProp failed for MY_TEMP=%g on %s.%s"
                  tempVal (or pin->parent->refdes "?") (or pin->number "?"))
        )
        printf("INFO myskill: MY_TEMP = %g set on %s.%s\n"
               tempVal (or pin->parent->refdes "?") (or pin->number "?"))
    )

    ; ---------------------------------------------------------------------------
    ; 3. READ the property back off the object
    ;    axlDBGetProperties(dbid '("user")) returns a list of (name value) pairs
    ; ---------------------------------------------------------------------------
    procedure( myskill_getPropValue(propName propList)
        let( (result targetStr)
            result    = nil
            targetStr = upperCase(propName)
            foreach( entry propList
                when( upperCase(sprintf(nil "%s" car(entry))) == targetStr
                    result = cadr(entry)
                )
            )
            result
        )
    )

    procedure( myskill_getTemp(pin)
        let( (props strVal result)
            props  = axlDBGetProperties(pin '("user"))
            strVal = myskill_getPropValue("MY_TEMP" props)
            result = if( strVal != nil then atof(sprintf(nil "%s" strVal)) else nil )
            result
        )
    )

    ; ---------------------------------------------------------------------------
    ; 4. (optional) REMOVE the property from an object
    ;    axlDBDeleteProp(dbid propName)
    ; ---------------------------------------------------------------------------
    procedure( myskill_clearTemp(pin)
        unless( errset( axlDBDeleteProp(pin "MY_TEMP") )
            error("myskill" "axlDBDeleteProp failed for MY_TEMP on %s.%s"
                  (or pin->parent->refdes "?") (or pin->number "?"))
        )
    )

    ; ---------------------------------------------------------------------------
    ; Example usage
    ; ---------------------------------------------------------------------------
    let( (pin)
        pin = car(axlDBGetPointList(nil "Select a pin: " '("Pin")))->objType  ; placeholder for pin selection
        myskill_setTemp(pin 85.0)      ; write MY_TEMP = 85.0 on the pin
        printf("MY_TEMP readback = %g\n" myskill_getTemp(pin))  ; read it back
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • MZ20250602835
    0 MZ20250602835 1 day ago in reply to andakConsultingLtd

    Many thanks for your reply, but i think this is not the skill i need.

    Best Regards

    Moyan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • andakConsultingLtd
    0 andakConsultingLtd 1 day ago in reply to MZ20250602835

    Well, this shows you how to deal with custom properties and properties in general. What's missing?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • MZ20250602835
    0 MZ20250602835 1 day ago in reply to andakConsultingLtd

    I want to have the skill to update the value of custom variables.

    The commands i post above To update custom variables in Cadence PCB / Allegro using the Toolbox (tbx) utility, open the setup menu, select custom variables, and run the update command to input new values like dates or revisions, then run it again to refresh the drawing.

    I would like to have the same function with using skill instead of commands.

    I am still learning your code, but as far as i understand the code you post is for another function.

    Many thanks again

    Moyan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • MZ20250602835
    +1 MZ20250602835 1 day ago in reply to andakConsultingLtd

    Hi, andakConsultingLtd,

    many thanks again and i found the solution as below:

    axlShell("FORM tbx_customvar_update_main grid change 108,variable_value '100x 100'")
    axlShell("FORM tbx_customvar_update_main var_update All")

    or

    procedure( updatePCBFormat()
    axlShell("FORM tbx_customvar_update_main grid change 108,variable_value '100x 100'")
    axlShell("FORM tbx_customvar_update_main var_update All")
    )
    Then run:
    updatePCBFormat()

    Best Regards

    Moyan

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