• 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. spreading clines

Stats

  • State Verified Answer
  • Replies 5
  • Subscribers 160
  • Views 2819
  • Members are here 0
More Content

spreading clines

masamasa
masamasa 8 months ago

hello.

 

i have asked this question a few years back but no good answer so i ask again.

 

i would like to spread clines with equal spacing.

 

i do know how to spread clines between vias.

 

but i would like to simply spread clines between two clines (not between two vias).

 

for instance, there are 4 parallel clines but the inner 3 spaces are not equal so i would like to move the inner 2 clines to make the 3 spaces equal.

 

regards

masa

  • Sign in to reply
  • Cancel
  • DavidJHutchins
    0 DavidJHutchins 8 months ago

    I think the closest functionality to what you are looking for is the 'spread between voids' command, available from the 'Route>Resize/Respace>Spread Between Voids'

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • masamasa
    0 masamasa 8 months ago in reply to DavidJHutchins

    thank u for ur response, david.

     

    unfortunately the function of spreading clines between two vias does not work if there is no via around the clines.

     

    is it possible to create a skill code for this?

     

      

    regards

    masa

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Hoangkhoipcb
    +1 Hoangkhoipcb 8 months ago in reply to masamasa

    Hi masa!

    You can try this code:

    axlCmdRegister("spread_clines" `spread_clines )
    (defun spread_clines ()
    if(axlOKToProceed() == nil then
    axlShellPost("done")
    )
    axlShell("setwindow pcb; prepopup 0.0 0.0; done")
    axlCmdRegister("_spread_clines" `_spread_clines ?cmdType "general")
    axlShellPost("_spread_clines")
    )
    (defun _spread_clines ()
    mypopup = axlUIPopupDefine(nil (list (list "Done" 'axlFinishEnterFun) (list "Cancel" 'axlCancelEnterFun) ))
    axlUIPopupSet(mypopup)
    gridSnap1 = axlEnterPoint(?prompts list("Pick origin point") )
    if(gridSnap1 != nil then
    gridSnap2 = axlEnterPoint(?prompts list("Pick origin point") )
    else
    gridSnap2 = nil
    )
    if(gridSnap1 != nil && gridSnap2 != nil then
    ;axlDBCreateLine(list(gridSnap1 gridSnap2) 5.0, "ANTI ETCH/ALL" )
    axlSetFindFilter(?enabled '(noall CLINESEGS NAMEFORM) ?onButtons '(noall ALL))
    axlSingleSelectPoint(gridSnap1)
    seg1 = car(setof(e axlGetSelSet() e->xy == nil))
    axlClearSelSet()
    if(seg1 != nil then
    ol1 = axl_ol_ol2(list(gridSnap1 axlMXYAdd(0.0 : 0.01 gridSnap1)) seg1->startEnd)
    gridSnap1 = cadr(ol1)
    )
    axlSingleSelectPoint(gridSnap2)
    seg2 = car(setof(e axlGetSelSet() e->xy == nil))
    axlClearSelSet()
    if(seg2 != nil then
    ol2 = axl_ol_ol2(list(gridSnap2 axlMXYAdd(0.0 : 0.01 gridSnap2)) seg2->startEnd)
    gridSnap2 = cadr(ol2)
    )
    r_path = axlMakeDynamicsPath(list(list(gridSnap1 gridSnap2 0.001) list(gridSnap2 gridSnap1 0.001) ))
    poly = car(axlPolyFromDB(r_path ?layer "ANTI ETCH/ALL" ?endCapType 'NONE ?line2poly t ))
    if(poly != nil then

    axlAddSelectPoly(poly t)
    sel_list = setof(e axlGetSelSet() e->xy == nil)
    axlClearSelSet()
    if(length(sel_list~>parent) != length(unique(sel_list~>parent)) then
    printf("Existting segs parent duplicate")
    else
    number_div = axlDistance( gridSnap1 gridSnap2 )/(length(sel_list) - 1)
    tmp_point = gridSnap1
    point_list = nil
    loop = t
    while(loop == t
    if(axlDistance(gridSnap1 tmp_point) > axlDistance(gridSnap1 gridSnap2) then
    loop = nil
    else
    point_list = cons(tmp_point point_list)
    inter_points = axlGeoCircleLineInt2(gridSnap1 gridSnap2 tmp_point number_div)
    dis1 = axlDistance( car(inter_points) gridSnap2 )
    dis2 = axlDistance( cadr(inter_points) gridSnap2 )
    if(dis1 < dis2 then
    tmp_point = car(inter_points)
    else
    tmp_point = cadr(inter_points)
    )
    )
    )
    point_list = cons(gridSnap2 point_list)
    point_list = reverse(unique(point_list))
    ol_seg_list = nil
    i = 0
    foreach(seg sel_list
    ol_ol = axl_ol_ol2(seg->startEnd list(gridSnap1 gridSnap2))
    if(caddr(ol_ol) <= 0.0 then
    ol_seg_list = cons(car(ol_ol) ol_seg_list)
    )
    )
    tmp = nil
    foreach(item ol_seg_list
    tmp = cons(list(axlDistance(gridSnap1 item) item) tmp)
    )
    tmp = sortcar(tmp 'lessp)
    i = 0
    cmd_str_list = nil
    foreach(item tmp
    point = cadr(item)
    point2 = nth(i point_list)
    i++
    cmd_str_list = cons( sprintf(nil "pick %f %f; pick %f %f" xCoord(point) yCoord(point) xCoord(point2) yCoord(point2)) cmd_str_list)
    )
    if(cmd_str_list != nil then
    axlShell("setwindow pcb; slide; setwindow form.find; FORM find cline_segs YES ; FORM mini allow_errors YES;")
    foreach(cmd cmd_str_list
    axlShell(cmd)
    )
    axlShell("setwindow pcb; done")
    )
    )
    )
    )
    axlShell("setwindow pcb; prepopup 0.0 0.0; setwindow pcb; done;")
    axlCmdUnregister("_spread_clines")
    printf("Last Update: 01/11/2024 -Version 1.0\n")
    )

    HoangKhoi.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Hoangkhoipcb
    0 Hoangkhoipcb 8 months ago in reply to Hoangkhoipcb

    cmd: spread_clines

    Usage: enter point1->enter point2->done

    All the Clines between point1 and point2 are spreading

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • masamasa
    0 masamasa 8 months ago in reply to Hoangkhoipcb

    thank u, hoangkhoi.

     

    amazing!

     

    it works.

     

    thank u.

     

    regards

    masa

    • 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