• 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. Use wildcard entry for RefDes search

Stats

  • State Verified Answer
  • Replies 2
  • Subscribers 19
  • Views 939
  • Members are here 0
More Content

Use wildcard entry for RefDes search

SambaKantipudi
SambaKantipudi 9 months ago

Hello,
Can someone please support on this!

procedure(highlightSyms()
prog((symDbids, searchPattern, searchRefDes)
symDbids = axlDBGetDesign()->symbols
if(symDbids then
searchPattern = axlUIPrompt("Enter RefDes" "")
unless(searchPattern
axlMsgPut("Cancelled")
return()
); end unless

if(searchPattern then
if((searchPattern == "*") then
searchRefDes = ".*"
else
searchRefDes = strcat(upperCase(searchPattern) "[0-9]+")
); end if

symCount = 0
foreach(symDbid symDbids
if(symDbid->refdes && rexMatchp(searchRefDes symDbid->refdes) then
symCount = symCount + 1
axlCustomColorObject(symDbid 82)
); end if
); end foreach
axlMsgPut("%d symbols highlighted", symCount)
); end if
else
axlMsgPut("Symbols not found!")
); end if
); end prog
); end procedure

My requirement:
--> If I enter D5, highlight only D5
--> If I enter D5*, highlight = D5, D55, D56, D58 etc.
--> If I enter D*, highlight = D1, D2, D3, D55, D100 etc.

Basically, how does a wildcard search perform, is what I need!

Thanks in advance


BR
Samba

  • Cancel
  • Sign in to reply
Parents
  • AsbjornEdvalds
    0 AsbjornEdvalds 9 months ago

    Hi Samba, 

    Have you looked at the axlSingleSelectName() function in the Allegro skill documentation? 

    Using that, it allows wildcards, so you would not have to loop through all components in the design. 

    See the code snipped below

    prompt = axlUIPrompt("Search criteria")

    axlClearSelSet()
    axlSetFindFilter(
      ?enabled list( "noall" "symbols")
      ?onButtons list( "all"))

    axlSingleSelectName("SYMBOL" prompt t)
    items = axlGetSelSet()
    axlMsgPut("Items selected")
    foreach(item items
      axlMsgPut("%s" item->refdes)
    )

    Best regards

    Asbjorn

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • AsbjornEdvalds
    0 AsbjornEdvalds 9 months ago

    Hi Samba, 

    Have you looked at the axlSingleSelectName() function in the Allegro skill documentation? 

    Using that, it allows wildcards, so you would not have to loop through all components in the design. 

    See the code snipped below

    prompt = axlUIPrompt("Search criteria")

    axlClearSelSet()
    axlSetFindFilter(
      ?enabled list( "noall" "symbols")
      ?onButtons list( "all"))

    axlSingleSelectName("SYMBOL" prompt t)
    items = axlGetSelSet()
    axlMsgPut("Items selected")
    foreach(item items
      axlMsgPut("%s" item->refdes)
    )

    Best regards

    Asbjorn

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • SambaKantipudi
    +1 SambaKantipudi 9 months ago in reply to AsbjornEdvalds

    That's it, wonderfull. 

    Thankyou very much.

    Have a nice weekend 

    • Cancel
    • Vote Up +1 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.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information