• 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. Highligting symbols

Stats

  • Replies 4
  • Subscribers 160
  • Views 13584
  • Members are here 0
More Content

Highligting symbols

vimaldevlpr
vimaldevlpr over 6 years ago

Hai,

I want to highlight the symbols compare between the two different  .brd files if any changes or missed  in two both board. I attached the code below in that report has been generated correctly but that i want to highlight that missed or changed symbols directly in the .brd file while running this code i tried  to use axlHighlightObject but it found error can you please guide me.

procedure(placement()
out=outfile("report1.rpt")
file1 = axlDMFileBrowse(nil t ?optFilters "All board files|*.brd|")
foreach(cmp, axlDBGetDesign() ->components
when(cmp ->symbol
a = cmp ->name
b = cmp ->symbol ->name
c = (xCoord cmp ->symbol ->xy)
d = (yCoord cmp ->symbol ->xy)
e = cmp ->symbol ->rotation
f = cmp ->symbol ->mirrorType
inList = a
inList1 = b
inList2 = c
inList3 = d
inList4 = e
inList5 = f
fprintf(out,"\n%L,%L,%L,%L,%L,%L", inList, inList1, inList2, inList3, inList4, inList5)
))
let((currentDesign file out)
currentDesign = axlGetDrawingName()
axlSaveDesign(?design axlCurrentDesign() ?noConfirm t)
file=axlDMFileBrowse(nil nil ?optFilters "BRD Files|*.brd|")
when(axlOpenDesignForBatch(file "wf")
if(out = outfile("report2.rpt")
then
foreach(cmp, axlDBGetDesign() ->components
when(cmp ->symbol
fprintf(out, "\n%L,%L,%L,%L,%L,%L", cmp->name, cmp ->symbol ->name, (xCoord cmp ->symbol ->xy), (yCoord cmp ->symbol ->xy), cmp ->symbol ->rotation, cmp ->symbol ->mirrorType)
)
)
close(out)
else
print("can not open file for writing")
)
)
axlOpenDesignForBatch(currentDesign "wf")
)
let((h, out2, out1, in1, in2, str, x, v, data)
out1 = axlDMOpenFile("COMMA_SEPARATED_VALUE", "REPORT.csv", "w")
fprintf(out1, "REFDES,CURRENT SYM NAME,CHANGED SYM NAME \n")
out2 = outfile("ref.lst")

in1 = infile("report1.rpt")
in2 = infile("report2.rpt")
data = makeTable("data")
while(gets(str, in1)
when(str
x = car(parseString(str ",\n"))
v = cadr(parseString(str ",\n"))
data[x] = v
)
)
close(in1)
while(gets(str, in2)
when(str
x = car(parseString(str ",\n"))
v = cadr(parseString(str ",\n"))
if(data[x]
then
if(data[x] == v
then
else
fprintf(out1,"\n%L, %s: %s - %s", x, "False", data[x], v)
h = sprintf(out2, "%L", x)
axlHighlightObject(h)
)
else
fprintf(out1,"\n%L, %s", x,"Unknown")
h = sprintf(out2, "%L", x)
axlHighlightObject(h)
)
)
)
close(in2)
axlDMClose(out1)
)
)




  • Sign in to reply
  • Cancel
  • vimaldevlpr
    vimaldevlpr over 5 years ago

    Hai all,

    I have another problem in that code while generating an report i  comes with the slash i don't want that can you please guide me how to remove.

    Here in this image \C45\"" i dont want that \ and "" the code were attached above can any one guide me please.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 5 years ago in reply to vimaldevlpr

    The first issue is that you try to highlight an object by a string. This needs to be a dbid. 

    Further, you use %L to print a refdes to a string (which ends up in a file). This creates the " around the name, and to be able to print "  you need to escape it with \,  thus %L becomes a \"<string>\"  in the output. Since a refdes is already a string you can use simply %s. Same for the coordinates and other items. 

    I was rewriting it a bit. Didn't test the code, but perhaps you can use it:

    procedure(placement()
    let( (file1 out1 out2 in1 in2 currentDesign data x v dbid)
    file1 = axlDMFileBrowse(nil t ?optFilters "All board files|*.brd|")
    if(out1=outfile("report1.rpt")
    then
    foreach(cmp setof(comps axlDBGetDesign() ->components comps->symbol)
    fprintf(out1 "%s,%s,%.4f,%.4f,%.4f,%s\n" cmp->name cmp->symbol->name car(cmp->symbol->xy) cadr(cmp->symbol->xy) cmp->symbol->rotation if(cmp->symbol->mirrorType,"t","nil"))
    )
    close(out1)
    else
    axlMsgPut('("can not open file for writing" 3))
    )

    currentDesign = axlGetDrawingName()
    axlSaveDesign(?design axlCurrentDesign() ?noConfirm t)
    file=axlDMFileBrowse(nil nil ?optFilters "BRD Files|*.brd|")
    when(axlOpenDesignForBatch(file "wf")
    if(out1 = outfile("report2.rpt")
    then
    foreach(cmp setof(comps axlDBGetDesign() ->components comps->symbol)
    fprintf(out1 "%s,%s,%.4f,%.4f,%.4f,%s\n" cmp->name cmp->symbol->name car(cmp->symbol->xy) cadr(cmp->symbol->xy) cmp->symbol->rotation if(cmp->symbol->mirrorType,"t","nil"))
    )
    close(out1)
    else
    axlMsgPut('("can not open file for writing" 3))
    )
    )
    axlOpenDesignForBatch(currentDesign "wf")

    out1 = axlDMOpenFile("COMMA_SEPARATED_VALUE", "REPORT.csv", "w")
    out2 = outfile("ref.lst")
    in1 = infile("report1.rpt")
    in2 = infile("report2.rpt")
    when(and(out1 out2 in1 in2)
    fprintf(out1, "REFDES,CURRENT SYM NAME,CHANGED SYM NAME \n")
    data = makeTable("data")
    while(gets(str, in1)
    when(str
    x = car(parseString(str ",\n"))
    v = cadr(parseString(str ",\n"))
    data[x] = v
    )
    )
    close(in1)
    while(gets(str, in2)
    when(str
    x = car(parseString(str ",\n"))
    v = cadr(parseString(str ",\n"))
    if(data[x]
    then
    if(data[x] == v
    then
    t ;do nothing
    else
    fprintf(out1, "%s, %s: %s - %s\n", x, "False", data[x], v)
    fprintf(out2, "%s\n", x)
    when(dbid= axlDBFindByName('refdes x) axlHighlightObject(dbid))
    )
    else
    fprintf(out1,"%s, %s\n", x,"Unknown")
    fprintf(out2,"%s\n" , x)
    when(dbid= axlDBFindByName('refdes x) axlHighlightObject(dbid))
    )
    )
    )
    close(in2)
    close(out2)
    axlDMClose(out1)
    )
    )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 5 years ago in reply to B Bruekers

    Hai Bruekers

    Thanks for your reply but it shows nil and Report.csv also empty They didn't highlighting also can you please check it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 5 years ago in reply to B Bruekers

    Hai Bruekers

    Else part is not working  i found the changes in Report1 and Report 2 i have attached the sample images but it is not showing in the else part can you please recorrect the code please.

    • 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