• 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. PCB Design
  3. Changing footprint text size in entire library

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 167
  • Views 17557
  • Members are here 0
More Content
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Changing footprint text size in entire library

EvanShultz
EvanShultz over 8 years ago

We've been looking into our silkscreen text sizes and found we can shrink them a bit. So we'd like to do this for every component in our library.

Is there a way to automate this? We'd want to change only the ref des text on the silkscreen layer, not text on other layers.

DRA files are binary so I can't use a script. I could do it in SKILL but how to rip through the library folder, open each footprint, run the SKILL script, save the footprint, and move on to the next footprint? There's probably an easy way that I didn't think about or of which I'm not aware.

Any help would be appreciated!

  • Cancel
  • B Bruekers
    B Bruekers over 8 years ago
    I've created and used this piece of code to go through several DRA files. You need to change the correct directory, add the text change function and a save+compile symbol.

    l_dir = '("C:/TEMP/DAWRINGS")

    pcre = pcreCompile(".DRA" 1)
    noconfirmStatus = axlGetVariable("NOCONFIRM")
    axlSetVariable("NOCONFIRM", t)
    foreach(dir l_dir
    l_files = pcreMatchList(pcre getDirFiles(dir))
    tot = length(l_files)
    foreach(file l_files
    axlMsgPut("%d: %d - %s" tot done++ file)
    if(draName = axlOpenDesignForBatch(strcat( dir "/" file) "wf")
    then
    t
    ;do change here
    ;save and compile symbol
    else axlUIConfirm(sprintf(nil "Could not open %s!" file) 'error)
    )
    )
    )
    axlSetVariable("NOCONFIRM", noconfirmStatus)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RBATES15
    RBATES15 over 8 years ago
    You can easily change the all the text in a board file or symbol at once. Not exactly what you're looking for but it is quick and it works.

    1. Right Click > Super Fitler > Text
    2. Edit > Change Objects
    3. Check box for Text Block
    4. Select Text Size.
    5. Highlight all text.
    This will change all the text you highlight to the size that is selected.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • EvanShultz
    EvanShultz over 7 years ago

    After some time I'm back to this topic. I've not been able to figure this out after a bit of trying. Can anyone help me out?

    Here is the code I have now, based upon what was provided by B Bruekers:

    procedure(xxxSilkSizeUpdater()
    pcre = pcreCompile(".DRA" 1)

    ; avoid confirmation during interactions
    noconfirmStatus = axlGetVariable("NOCONFIRM")
    axlSetVariable("NOCONFIRM", t)
    findFilterEnabledList = axlGetFindFilter(t)
    findFilterOnList = axlGetFindFilter()

    done = 0

    ; get list of all footprints at the corporate library location
    ;footprintList = pcreMatchList(pcre getDirFiles(strcat(axlGetVariable("CDS_SITE") "/footprints")))
    footprintList = pcreMatchList(pcre getDirFiles("."))

    footprintListLength = length(footprintList)

    foreach(footprint footprintList
    axlMsgPut("Updating %s (%d/%d symbols processesed...)" footprint done++ footprintListLength)

    if(axlOpenDesignForBatch(footprint "wf") then
    ;do change here
    axlMsgPut("%s" footprint)

    axlClearSelSet()
    axlSetFindFilter(?enabled list("noall" "text") ?onButtons list("noall" "text"))
    ;axlMsgPut("%L" axlSelectByName("REFDES" "*" t))
    axlMsgPut("%L" axlDBGetDesign()->prop->??)

    ;save and compile symbol
    axlCompileSymbol()
    else
    axlUIConfirm(sprintf(nil "Could not open %s!" footprint) 'error)
    )
    )

    axlSetVariable("NOCONFIRM", noconfirmStatus)
    axlSetFindFilter(?enabled findFilterEnabledList ?onButtons findFilterOnList)
    )

    The intent would be that this is launched from an Allegro instance in the directory with all library footprints. It could also have a hard-coded path using $CDS_SITE.

    It appears to work in that it opens each footprint would allow work to be done, but there are two issues:

    1. Footprints which haven't been opened in a while still generate a blocking UI to update them. The NOCONFIRM variable nor opening in axlOpenDesignForBatch() in "wf" mode help here.

    2. I haven't figured out how to grab just the ref des text. I'm sure I can figure this out, I just haven't gotten there yet.

    My original idea was to use a command script to run through all files. Something like the following in a CMD file (we run Windows):

    set noconfirm=t
    for %%f IN (*.dra) DO start /wait allegro -product allegro_performance -s test_symbol.scr %%f

    But that didn't seem fruitful so I posted here.

    Any help?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • eDave
    eDave over 7 years ago in reply to EvanShultz

    I have done something similar several times over the years.

    I found that the best way is to preempt the checks. To this end I have used code like this:

    ......

    problem = "ignore"
    and(
    fileName = cadr(axlDMFileParts(file))
    psmFile = strcat(psmPath, fileName, ".psm")
    problem = "nopsm"
    isFile(psmFile)
    problem = "noopen"
    axlOpenDesign(?design file, ?mode "wf")
    problem = "noTxtChange"
    refdesTxtdbid = car(AFn_findTypeObjects("TEXT", ?layers "REF DES/ASSEMBLY_TOP"))
    !member(refdesTxtdbid ->textBlock, '("1", "2"))
    txtRot = refdesTxtdbid ->rotation
    (member(txtRot, '(0.0, 90.0)) || (non0rot = cons(sprintf(nil, "%2.1f degrees. %s", txtRot, file), non0rot)))
    loc = refdesTxtdbid ->xy
    hgt = axlGetParam(strcat("paramTextBlock:" refdesTxtdbid ->textBlock)) ->height
    newTextdbid = TLU_assyTopRef(?returnObjId t)
    newTextBlk = newTextdbid ->textBlock
    newHgt = axlGetParam(strcat("paramTextBlock:" newTextBlk)) ->height
    ;problem = "tooFarToMove"
    or(axlDistance(loc, newTextdbid ->xy) < 0.32
    newTextdbid ->rotation != txtRot
    and(
    AFn_transformObject(newTextdbid, ?move axlMXYSub(loc, newTextdbid ->xy))
    if(zerop(txtRot)
    then AFn_transformObject(newTextdbid, ?move list(0.0, (hgt - newHgt) / 2.0))
    else AFn_transformObject(newTextdbid, ?move list((newHgt - hgt) / 2.0, 0.0))
    )
    )
    )

    problem = "compiled"

    problem = "nosave"
    axlSaveDesign(?design file, ?mode "nocheck", ?noMru t)
    problem = "nocompile"
    psmFile = strcat(psmPathOut, cadr(axlDMFileParts(file)), ".psm")
    axlCompileSymbol(?symbol psmFile, ?silent t, ?silentOnOverwrite t)
    problem = "compiled"
    )

    ....

    Some of this code won't make sense to you but it gives the idea.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • EvanShultz
    EvanShultz over 7 years ago in reply to eDave

    Thanks Dave! It looks like the sneaky stuff is in the AFn_findTypeObjects() function.

    • Cancel
    • Vote Up 0 Vote Down
    • 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