• 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. Retaining ref des silkscreen location

Stats

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

Retaining ref des silkscreen location

fishcrakers
fishcrakers over 3 years ago

Hi, Good day! I have already done the PCB design and position the ref des silkscreen as well. However there are saome update on the parts . When I export physical the design. The refdes silkscreen returned to the original position and font size. Is there a way the ref des silkscreen position and font size to retain and not change even I updated the parts/components?  

  • Sign in to reply
  • Cancel
Parents
  • DBTCH
    0 DBTCH over 3 years ago

    Hi ,

    You can try this skill to save the refdes location and reload them ,after you update the parts .


    /*******************************************************************
    * DISCLAIMER: The following code is provided for Cadence customers *
    * to use at their own risk. The code may require modification to *
    * satisfy the requirements of any user. The code and any *
    * modifications to the code may not be compatible with current or *
    * future versions of Cadence products. *
    * THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING *
    * WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES *
    * OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. *
    *******************************************************************/
    ; File: set_refdes.il
    ;
    ; Usage: Load this file set_refdes.il
    ; Issue the command srd <arg> on the Allegro command line. Where <arg>
    ; is a command line argument that can be either save or get
    ;
    ; srd save Saves refdes data to the file refdes.txt
    ; srd get Retrieves refdes data from the refdes.txt file.
    ;
    ;
    axlCmdRegister("srd_sk" '_set_refdes_silk_from_file ?cmdType "general")
    procedure( _set_refdes_silk_from_file( mode )
    prog( list(l_text refdes t_loc t_rot t_mirror t_justify t_layer l_vis l_old_loc mir rot)
    l_old_loc=list()

    case(mode
    ("save" ;save the current refdes text information to a file
    printf("Mode:save\n")
    printf("Saving refdes data to file refdes_silk.txt\n")
    p_refdes=outfile("./refdes_silk.txt") ;open a file to store the data
    axlClearSelSet() ;clear any selected objects
    axlSetFindFilter(?enabled '(noall text) ?onButtons '(text))
    l_vis=axlVisibleGet() ;Store the current layer visibility
    axlVisibleDesign(nil) ;Set the visibility as desired.
    axlVisibleLayer("REF DES/SILKSCREEN_TOP" t )
    axlVisibleLayer("REF DES/SILKSCREEN_BOTTOM" t )
    axlUIWUpdate(nil)
    axlAddSelectAll() ;Select all of the visible text
    l_text=axlGetSelSet() ;Save the selected text in a list
    axlClearSelSet()
    foreach(text l_text ;Check each text string
    parent_type = text->parent->objType
    text_class = car(parseString(text->layer "/"))
    if(parent_type == "symbol" && text_class=="REF DES" then
    ;probably found a refdes. Store the text details

    refdes=text->text
    t_loc=text->xy
    t_rot=text->rotation
    t_mirror=text->isMirrored
    t_layer=text->layer
    t_textblock=text->textBlock
    t_justify = text->justify

    ;write the data to a file
    println(list(refdes t_loc t_layer t_rot t_mirror t_textblock t_justify) p_refdes)
    );endif
    );end foreach refdes
    close(p_refdes) ;close the file
    axlVisibleSet(l_vis)
    axlUIWUpdate(nil)
    printf("Refdes save completed.\n")
    );save
    ("get" ;Read the file and process the text
    printf("Mode:get\n")
    l_visible=axlVisibleGet() ;store current visibility settings.
    axlVisibleDesign(nil) ;turn everything invisible
    axlVisibleLayer("REF DES/SILKSCREEN_TOP" t )
    axlVisibleLayer("REF DES/SILKSCREEN_BOTTOM" t )
    p_refdes=infile("./refdes_silk.txt")
    while(l_refdes=car(lineread(p_refdes))
    refdes=nth(0 l_refdes)
    loc=nth(1 l_refdes)
    layer=nth(2 l_refdes)
    new_rot=nth(3 l_refdes)
    new_mir=nth(4 l_refdes)
    new_tblock=nth(5 l_refdes)
    new_justify=nth(6 l_refdes)
    l_old_loc = _find_refdes(refdes layer) ;call procedure to find the original text
    old_xy = nth(1 l_old_loc) ;current coordinates of refdes
    old_rot = nth(0 l_old_loc)->rotation ;current refdes rotation
    old_mir = nth(0 l_old_loc)->isMirrored ;current mirror status
    old_tblock=nth(0 l_old_loc)->textBlock ;current text block used
    o_component=nth(0 l_old_loc)->parent ;need the parent if creating new text
    when(old_xy ;if there is an xy then we found the text and can do a transform
    if(old_tblock==new_tblock then ;if the same text block then do a transform
    delta_x=xCoord(loc) - xCoord(old_xy) ;calculate the x offset
    delta_y=yCoord(loc) - yCoord(old_xy) ;calculate the y offset
    l_delta=list(delta_x delta_y) ;distance to move the text
    rot=new_rot-old_rot ;calculate the rotation
    mir=(new_mir && !old_mir)||(!new_mir && old_mir) ;mirror is XOR
    axlTransformObject(car(l_old_loc) ?move l_delta ?mirror mir ?angle rot) ;move the text
    else
    ;if textblocks don't match then create a new refdes.
    new_orient=make_axlTextOrientation(?textBlock new_tblock, ?rotation new_rot, ?mirrored new_mir, ?justify new_justify )
    new_refdes=axlDBCreateText(refdes, loc, new_orient, layer, o_component)
    if(new_refdes then ;if new refdes successful then delete old one.
    axlClearSelSet()
    axlSetFindFilter(?enabled '(noall text) ?onButtons '(text))
    axlSingleSelectPoint(old_xy)
    axlDeleteObject(axlGetSelSet())
    axlClearSelSet()
    );end_if
    );end_if
    );end_when
    );end while
    close(p_refdes)
    axlVisibleSet(l_visible) ;restore layer visibility.
    printf("Process complete.\n")
    );get
    (t
    printf("Invalid command line argument.\n")
    printf("Command syntax: srd save or srd get \n")
    return(nil)
    )
    );endcase
    );endprog
    );endproc

    procedure( _find_refdes(sym tlayer)
    ;procedure to return the dbid and location of the refdes for the symbol
    prog( list(child l_children o_type o_layer match_loc)
    l_children = car(axlSelectByName("REFDES" sym))->children
    foreach(child l_children
    o_type = child->objType
    o_layer = child->layer
    if(o_type=="text" && o_layer==tlayer then
    ;probably found a refdes match.
    match_loc=child->xy
    axlClearSelSet()
    return(list(child match_loc)) ;return the dbid and location of the text
    ;if match_loc returns as nil then the text was not found
    );endif

    );foreach child
    );end prog
    );end proc _find_refdes

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc teyssier
    0 jc teyssier over 3 years ago in reply to DBTCH

    i have used this one in the past: woks but not fully: some mirrored text are not well handled Disappointed

    Have  a try: maybe for you it is ok.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • jc teyssier
    0 jc teyssier over 3 years ago in reply to DBTCH

    i have used this one in the past: woks but not fully: some mirrored text are not well handled Disappointed

    Have  a try: maybe for you it is ok.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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