• 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. dbid:removed after first iteration

Stats

  • State Suggested Answer
  • Replies 10
  • Answers 1
  • Subscribers 159
  • Views 2448
  • Members are here 0
More Content

dbid:removed after first iteration

Henry Monro
Henry Monro over 1 year ago

Hi,

Below attached is the code on which I am working and its working for the first iteration only then it removes the DBIDs.

My motive is to create void on Selected vias using the DRC and the tool should create void on all selected vias. Have used axlDBRefreshId(nil) also but it didnt worked for me, maybe I didnt place the command on correct line of code.

Please help in this regard.

Thanks


count=0
axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))

axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
axlSelect(?prompt "\nSelect DRCS from the layout")

drcs=axlGetSelSet()

length_l_drcs=length(drcs)

println("length_l_drcs")
println(length_l_drcs)

count=0

foreach(drc, drcs

if(drc->waived==nil && drc->name== "Drill Hole to Shape Same Net Spacing" then

drc_layer = drc->layer
drc_expected = drc->expected

drc_expected = parseString(drc_expected " ")
drc_expected = car(drc_expected)

drc_expected = atof(drc_expected)

drc_expected = (drc_expected+5)

l_violations=drc->violations

length_l_violations=length(l_violations)

;println("length_l_violations")
;println(length_l_violations)

if(length_l_violations <= 1 || length_l_violations >= 3 then
axlUIConfirm("Not a correct DRC")
)

foreach(violation l_violations
if(violation->objType=="pin" || violation->objType=="via" then
pv1 = violation
)
if(violation->objType=="shape" then
shape1 = violation
)
)

l_poly_shape = axlPolyFromDB(shape1)
voidPolys = nil

l_location=list(pv1->xy, drc_expected)
rpath = axlPathStartCircle(l_location, 0.0)
poly_circle = car(axlPolyFromDB(rpath))
voidPolys = cons(poly_circle, voidPolys)


openShape = axlDBOpenShape(shape1->shapeBoundary)

foreach(poly, voidPolys
axlDBCreateVoid(openShape, poly)
)

shape1 = car(axlDBCreateCloseShape(openShape))
axlShapeDynamicUpdate(shape1 t)

)

count++
println(drc)

)

 

  • Sign in to reply
  • Cancel
Parents
  • eDave
    0 eDave over 1 year ago

    The dbids are changed the instant you process the first shape. To avoid this you need to "cache" the changes for each shape.

    Try this:

    count=0
    drcs = nil
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
    mypopup = axlUIPopupDefine(nil, list(list("Done" 'axlFinishEnterFun), list("Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet(mypopup)
    while(axlSelect(?prompt "Select DRCS from the layout")
    drc = car(axlGetSelSet())
    ;when(drc->name == "Blind/Buried Via to Shape Same Net Spacing" && length(drc->violations) == 2
    when(drc->name == "Drill Hole to Shape Same Net Spacing" && length(drc->violations) == 2
    drcs=cons(drc, drcs)
    )
    )
    axlClearSelSet()
    printf("length_l_drcs: %d\n", length(drcs))
    shapeList = nil
    foreach(drc, drcs
    unless(drc->waived
    shape = car(setof(violation, drc->violations, violation->objType=="shape"))
    shapeList = cons(list(shape, drc), shapeList)
    println(drc)
    )
    )
    count=0
    foreach(shape, unique(mapcar('car, shapeList))
    voidPolys = nil
    foreach(item, setof(item, shapeList, car(item) == shape); Get the list of drcs to this shape
    drc = cadr(item)
    pv = car(setof(violation, drc->violations, violation->objType=="pin" || violation->objType=="via"))
    drc_clearance = axlMKS2UU(drc->expected) + axlMKSConvert(5, "mils")
    l_location=list(pv->xy, drc_clearance)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    openShape = axlDBOpenShape(shape->shapeBoundary)
    foreach(voidPoly, voidPolys
    axlDBCreateVoid(openShape, voidPoly)
    count++
    )
    shape = car(axlDBCreateCloseShape(openShape))
    axlShapeDynamicUpdate(shape t)
    )
    count

    • Cancel
    • Vote Up -1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to eDave

    Still just making the first void only. Then removing the DBIDs

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave over 1 year ago in reply to Henry Monro

    Oh yes. I had it working then made the same mistake  of expecting the drc dbids to not be changed.

    Try this:

    count=0
    drcs = nil
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
    mypopup = axlUIPopupDefine(nil, list(list("Done" 'axlFinishEnterFun), list("Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet(mypopup)
    while(axlSelect(?prompt "Select DRCS from the layout")
    drc = car(axlGetSelSet())
    ;when(drc->name == "Blind/Buried Via to Shape Same Net Spacing" && length(drc->violations) == 2
    when(drc->name == "Drill Hole to Shape Same Net Spacing" && length(drc->violations) == 2
    drcs=cons(drc, drcs)
    )
    )
    axlClearSelSet()
    printf("length_l_drcs: %d\n", length(drcs))
    shapeList = nil
    foreach(drc, drcs
    unless(drc->waived
    pv = car(setof(violation, drc->violations, violation->objType=="pin" || violation->objType=="via"))
    shape = car(setof(violation, drc->violations, violation->objType=="shape"))
    shapeList = cons(list(shape, pv, drc ->expected), shapeList)
    println(drc)
    )
    )
    count=0
    foreach(shape, unique(mapcar('car, shapeList))
    voidPolys = nil
    foreach(item, setof(item, shapeList, car(item) == shape); Get the list of drcs to this shape
    pv = cadr(item)
    drc_clearance = axlMKS2UU(caddr(item)) + axlMKSConvert(5, "mils")
    l_location=list(pv->xy, drc_clearance)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    openShape = axlDBOpenShape(shape->shapeBoundary)
    foreach(voidPoly, voidPolys
    axlDBCreateVoid(openShape, voidPoly)
    count++
    )
    shape = car(axlDBCreateCloseShape(openShape))
    axlShapeDynamicUpdate(shape t)
    )
    count

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave over 1 year ago in reply to eDave

    I slept on it and I think this has more chance of working:

    count=0
    drcs = nil
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
    mypopup = axlUIPopupDefine(nil, list(list("Done" 'axlFinishEnterFun), list("Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet(mypopup)
    while(axlSelect(?prompt "Select DRCS from the layout")
    drc = car(axlGetSelSet())
    when(drc->name == "Drill Hole to Shape Same Net Spacing" && length(drc->violations) == 2
    drcs=cons(drc, drcs)
    )
    )
    axlClearSelSet()
    printf("length_l_drcs: %d\n", length(drcs))
    shapeList = nil
    foreach(drc, drcs
    unless(drc->waived
    pvXY = car(setof(violation, drc->violations, violation->objType=="pin" || violation->objType=="via")) ->xy
    drc_clearance = axlMKS2UU(drc ->expected) + axlMKSConvert(5, "mils")
    l_location=list(pvXY, drc_clearance)
    shape = car(setof(violation, drc->violations, violation->objType=="shape"))
    shapeList = cons(list(shape, l_location), shapeList)
    println(drc)
    )
    )
    count=0
    foreach(shape, unique(mapcar('car, shapeList))
    voidPolys = nil
    foreach(item, setof(item, shapeList, car(item) == shape); Get the list of drcs to this shape
    l_location = cadr(item)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    openShape = axlDBOpenShape(shape->shapeBoundary)
    foreach(voidPoly, voidPolys
    axlDBCreateVoid(openShape, voidPoly)
    count++
    )
    shape = car(axlDBCreateCloseShape(openShape))
    axlShapeDynamicUpdate(shape t)
    )
    count

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to eDave

    Both of them are not working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to eDave

    Both of them are not working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • eDave
    0 eDave over 1 year ago in reply to Henry Monro

    What happens?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to eDave

    Its still creating void on first only

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave over 1 year ago in reply to Henry Monro

    Does this fix it:

    count=0
    drcs = nil
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
    mypopup = axlUIPopupDefine(nil, list(list("Done" 'axlFinishEnterFun), list("Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet(mypopup)
    while(axlSelect(?prompt "Select DRCS from the layout")
    drc = car(axlGetSelSet())
    when(drc->name == "Drill Hole to Shape Same Net Spacing" && length(drc->violations) == 2
    drcs=cons(drc, drcs)
    )
    )
    axlClearSelSet()
    printf("length_l_drcs: %d\n", length(drcs))
    shapeList = nil
    foreach(drc, drcs
    unless(drc->waived
    pvXY = car(setof(violation, drc->violations, violation->objType=="pin" || violation->objType=="via")) ->xy
    drc_clearance = axlMKS2UU(drc ->expected) || 0 + axlMKSConvert(5, "mils")
    l_location=list(pvXY, drc_clearance)
    shape = car(setof(violation, drc->violations, violation->objType=="shape"))
    shapeList = cons(list(shape, l_location), shapeList)
    println(drc)
    )
    )
    count=0
    foreach(shape, unique(mapcar('car, shapeList))
    voidPolys = nil
    foreach(item, setof(item, shapeList, car(item) == shape); Get the list of drcs to this shape
    l_location = cadr(item)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    openShape = axlDBOpenShape(shape->shapeBoundary)
    foreach(voidPoly, voidPolys
    axlDBCreateVoid(openShape, voidPoly)
    count++
    )
    shape = car(axlDBCreateCloseShape(openShape))
    ;axlShapeDynamicUpdate(shape t)
    )
    axlShapeDynamicUpdate(shape t)
    count

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Henry Monro
    0 Henry Monro over 1 year ago in reply to eDave

    It now shows the warning for multiple shapes and I have to run the code separately for each shape which takes time.

    Below is the warning that arises:

    *WARNING* (axlDBOpenShape): Invalid database id argument - nil

    Below is the snap as how I have the case:

    I would be thankful if you can help in this regard

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave over 1 year ago in reply to Henry Monro

    I guess I should have tried this on a "real" design.

    Try this:

    count=0
    drcs = nil
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter( ?enabled '("alltypes") ?onButtons "DRCS")
    mypopup = axlUIPopupDefine(nil, list(list("Done" 'axlFinishEnterFun), list("Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet(mypopup)
    while(axlSelect(?prompt "Select DRCS from the layout")
    drc = car(axlGetSelSet())
    when(drc->name == "Drill Hole to Shape Same Net Spacing" && length(drc->violations) == 2
    drcs=cons(drc, drcs)
    )
    )
    axlClearSelSet()
    printf("length_l_drcs: %d\n", length(drcs))
    shapeList = nil
    foreach(drc, drcs
    unless(drc->waived
    pvXY = car(setof(violation, drc->violations, violation->objType=="pin" || violation->objType=="via")) ->xy
    drc_clearance = axlMKS2UU(drc ->expected) || 0 + axlMKSConvert(5, "mils")
    l_location=list(pvXY, drc_clearance)
    shape = car(setof(violation, drc->violations, violation->objType=="shape")) ->shapeBoundary
    shapeList = cons(list(shape, l_location), shapeList)
    println(drc)
    )
    )
    count=0
    foreach(shape, unique(mapcar('car, shapeList))
    voidPolys = nil
    foreach(item, setof(item, shapeList, car(item) == shape); Get the list of drcs to this shape
    l_location = cadr(item)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    openShape = axlDBOpenShape(shape)
    foreach(voidPoly, voidPolys
    axlDBCreateVoid(openShape, voidPoly)
    count++
    )
    shape = car(axlDBCreateCloseShape(openShape))
    )
    axlShapeDynamicUpdate(shape t)
    count

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