• 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. I WANTED CREATE VOID ON HOLES AS USING MY CODE ITS REMOVING...

Stats

  • State Suggested Answer
  • Replies 3
  • Answers 1
  • Subscribers 17
  • Views 1560
  • Members are here 0
More Content

I WANTED CREATE VOID ON HOLES AS USING MY CODE ITS REMOVING THE SHAPE DBID

Henry Monro
Henry Monro over 1 year ago

Hello,

I have developed the below code and on running it is removing the Shape DBID after first void creation as shown in snap below.

I would be thankful If anyone can help in this regard and provide a better way for void creation on multiple holes.

Thanks


("run"

airgap=axlFormGetField(form "airgap")
net_name=axlFormGetField(form "net_name")
void_size=axlFormGetField(form "void_size")


airgap = atoi(airgap)
net_name = upperCase(net_name)
void_size = atoi(void_size)

antipad_half=void_size/2

axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
axlSetFindFilter(?enabled list("VIAS" "SHAPES") ?onButtons list("VIAS" "SHAPES"))
axlSelect()
l_vias_shapes = axlGetSelSet()
length_l_vias=length(l_vias_shapes)

l_shapes = list()
l_vias = list()

foreach(vias_shapes l_vias_shapes
when((vias_shapes->objType == "via" )
l_vias = append1(l_vias vias_shapes)
)
when((vias_shapes->objType == "shape" )
l_shapes = append1(l_shapes vias_shapes)
)
)

count=0
item_count=0

void_count=0
l_shape_void_info=nil

newshap_poly = nil
shape = nil

l_voids=nil

endType = 'ROUND

foreach(shapes,l_shapes

foreach(via,l_vias
count++

net_via=via->net->name

println("net_via")
println(net_via)

if(net_via == net_name then

list_connect=axlDBGetConnect(via t)
list_shape_layer=list()

foreach(connect list_connect
when(connect->objType=="shape" list_shape_layer=append1(list_shape_layer connect->layer))
)

list_shape_layer=unique(list_shape_layer)

l_airgap = axlAirGap(via shapes nil t)
object1_xy=car(cadr(l_airgap))
object2_xy=cadr(cadr(l_airgap))
airgapsize = nth(2,cadr(l_airgap))

if( member(car(l_layers_visible) list_shape_layer)== nil && airgapsize < airgap then

via_xy=via->xy
l_location=list(via_xy,antipad_half)

l_db=axlDBCreateCircle(l_location,'0,skill_layer)

circle_db=car(car(l_db))

l_poly_circle = axlPolyFromDB(circle_db ?layer skill_layer)

axlDeleteObject(circle_db)

l_poly_shape = axlPolyFromDB(shapes)
l_poly_void = (axlPolyOperation l_poly_shape l_poly_circle 'ANDNOT)
newshp = axlDBOpenShape(shapes->shapeBoundary car(l_poly_void))
foreach(poly,l_poly_void
axlDBCreateVoid(shapes,poly)
) ;; l_poly_shape_new
axlDBCreateCloseShape(newshp)
axlShapeDynamicUpdate(shapes t)

)

)
)
)

axlClearSelSet()

) ;; run

  • Sign in to reply
  • Cancel
  • SaiPavanl
    0 SaiPavanl over 1 year ago

    Hello Henrt

    I am having issue with running this code, can you provide complete code to test it at my end?

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

    This might help:

    Note that you need to open the shape after all the other processing of the shape.

    defun( monro (airgap, net_name, void_size)
    l_layers_visible = '("ETCH/TOP")
    net_name = upperCase(net_name)
    antipad_half=void_size/2.0
    axlSetFindFilter(?enabled list("noall") ?onButtons list("noall"))
    axlSetFindFilter(?enabled list("VIAS" "SHAPES") ?onButtons list("VIAS" "SHAPES"))
    axlSelect()
    l_vias = setof(obj, axlGetSelSet(), obj ->objType == "via" && obj ->net ->name == net_name)
    l_shapes = setof(obj, axlGetSelSet(), obj ->objType == "shape" && memv(obj ->layer, l_layers_visible))
    axlClearSelSet()
    foreach(shape, l_shapes
    l_poly_shape = axlPolyFromDB(shape)
    voidPolys = nil
    foreach(via, l_vias
    list_shape_layer = unique(setof(obj, axlDBGetConnect(via t), obj ->objType == "shape") ~>layer)
    l_airgap = axlAirGap(via, shape, shape ->layer, 'enhanced)
    airgapsize = l_airgap ->airGap || 0.0
    when(!memv(car(l_layers_visible) list_shape_layer) && airgapsize < airgap
    l_location=list(via->xy, antipad_half)
    rpath = axlPathStartCircle(l_location, 0.0)
    poly_circle = car(axlPolyFromDB(rpath))
    voidPolys = cons(poly_circle, voidPolys)
    )
    )
    openShape = axlDBOpenShape(shape->shapeBoundary)
    foreach(poly, voidPolys
    axlDBCreateVoid(openShape, poly)
    )
    shape = car(axlDBCreateCloseShape(openShape))
    axlShapeDynamicUpdate(shape t)
    )
    )

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

    Hi !

    try this code

    (defun for_cut_voidshape ()
    airgap = "5";axlFormGetField(form "airgap")
    net_name = "VSS"; axlFormGetField(form "net_name")
    void_size= "200";axlFormGetField(form "void_size")
    airgap = atoi(airgap)
    net_name = upperCase(net_name)
    void_size = atoi(void_size)
    antipad_half = void_size/2
    axlSetFindFilter(?enabled '(noall VIAS SHAPES NAMEFORM) ?onButtons '(noall ALL))
    axlSelect()
    l_shapes = setof(e axlGetSelSet() e->objType =="shape")
    l_vias = setof(e axlGetSelSet() e->objType =="via")
    axlClearSelSet()
    temp_list = nil
    foreach(via,l_vias
    foreach(shape, setof(e l_shapes e->net == via->net)
    tmp = shape->segments
    foreach(void shape->voids
    foreach(seg void->segments
    tmp = cons(seg tmp)
    )
    )
    foreach(seg tmp
    gap = axlAirGap(via seg seg->layer)
    if(gap != nil && caddr(gap) < airgap || gap == nil then
    d = axlMXYAdd( 0 : antipad_half via->xy)
    r_path = axlMakeDynamicsPath(list(list(d d 0.0 via->xy antipad_half t) list(d d) ) )
    poly = car(axlPolyFromDB(r_path ?layer shape->layer ?endCapType 'ROUND))
    if(member(poly temp_list) == nil then
    temp_list = cons(poly temp_list)
    )
    )
    )
    )
    )
    foreach(poly temp_list
    axlClearSelSet()
    axlSetFindFilter(?enabled '(noall SHAPES NAMEFORM) ?onButtons '(noall ALL))
    axlSingleSelectBox(poly->bBox)
    shape = car(axlGetSelSet())
    openShape = axlDBOpenShape(shape->shapeBoundary)
    axlDBCreateVoid(openShape, poly)
    axlDBCreateCloseShape(openShape)
    )
    )

    HoangKhoi.

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