• 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. skill to create shape based on vias

Stats

  • State Suggested Answer
  • Replies 13
  • Answers 2
  • Subscribers 18
  • Views 5392
  • Members are here 0
More Content

skill to create shape based on vias

zpofrp
zpofrp over 1 year ago

Hi 

Attached,

i want use skill to create a shape based on select via,but i can't wirte the skill.

 Play this video

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

    Hi zpofrp!

    Please refer this code.

    HoangKhoi.

    ;#####################################################################
    axlCmdRegister("createShapeByVia" 'createShapeByVia )
    (defun createShapeByVia ()
    vi_via = setof(e axlSubclassRoute(?field 'isEtch) axlIsVisibleLayer(strcat("VIA CLASS/" e )))
    if(length(vi_via) > 1 then
    axlUIConfirm( "Visible Via must one layer")
    else
    layer = car(vi_via)
    axlClearSelSet(vi_via)
    axlSetFindFilter(?enabled '(noall VIAS NAMEFORM) ?onButtons '(noall VIAS))
    mypopup = axlUIPopupDefine(nil (list (list "Done" 'axlFinishEnterFun) (list "Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet( mypopup)
    while(axlSelect(?prompt "Please select an element...")
    Input_List = axlGetSelSet()
    axlClearSelSet()
    if(length(Input_List)>1 then
    tmp = nil
    net = car(Input_List)->net
    foreach(via Input_List
    foreach(via2 setof(e Input_List e->xy != via->xy)
    sizeVia1 = getSizeVia(via, layer)
    sizeVia2 = getSizeVia(via2, layer)
    lineWidth = max(sizeVia1,sizeVia2)
    r_path = axlPathStart(list( via->xy via2->xy ) lineWidth)
    r_path_poly = car(axlPolyFromDB(r_path ?line2poly t ?endCapType 'ROUND))
    tmp = cons(r_path_poly tmp)
    )
    )
    poly_tmp = car(axlPolyOperation(car(tmp) cdr(tmp) 'OR))
    if(poly_tmp->holes != nil then
    hole_list = nil
    foreach(h poly_tmp->holes
    hole_list = cons(car(axlPolyFromHole(h)) hole_list)
    )
    poly_tmp = car(axlPolyOperation(poly_tmp hole_list 'OR))
    )
    create_shape = axlDBCreateShape(poly_tmp t strcat("ETCH/" layer) net )
    )
    )
    )
    )
    (defun getSizeVia (via, layer)
    prog((sizeVia)
    pad_box = axlDBGetPad(via strcat("VIA CLASS/" layer) "regular")->bBox
    p1 = car(pad_box)
    p2 = xCoord(car(pad_box)) : yCoord(cadr(pad_box))
    p3 = xCoord(cadr(pad_box)) : yCoord(car(pad_box))
    sizeVia = max(axlDistance(p1 p2), axlDistance(p1 p3))
    return(sizeVia)
    )
    )
    ;#####################################################################

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

    I find one bug, show the pic1.

    big via and small via, the shape is hollow,same as pic1.

    I want to create shape same as pic2 or pic3.

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

    This is a more complex solution but should get around your problem.

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

    nice, thanks you very much.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • SambaKantipudi
    0 SambaKantipudi 7 months ago in reply to zpofrp

    Hello eDave
    Thanks for the wonderful function, saves a lot of time and manual workBlush

    Is it possible to modify the SKILL, to let USER select the layer for Shape creation, when VIAS are selected?
    Like:
    cond = '("Active Layer", "Inner Layers")
    action = axlUIMultipleChoice("Select an option", cond, "Create Shape")

    Active Layer -> Shape is created on Active Layer
    Inner Layer -> Shape is created on all Inner Layers, excluding TOP & BOTTOM.

    Aslo, thanks to zpofrp and Hoangkhoipcb 

    BR
    Samba

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave 7 months ago in reply to SambaKantipudi

    I currently can't upload. Please contact me directly.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Hoangkhoipcb
    0 Hoangkhoipcb 7 months ago in reply to SambaKantipudi

    Dear SambaKantipudi,

    I've adjusted the code based on your idea. However, I'm unable to upload the code to this post.

    Please contact me at hoangkhoipcb_@gmail_com, and I'll send you the code.

    Best regards,

    HoangKhoi

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Hoangkhoipcb
    0 Hoangkhoipcb 7 months ago in reply to SambaKantipudi

    Dear SambaKantipudi,

    I've adjusted the code based on your idea. However, I'm unable to upload the code to this post.

    Please contact me at hoangkhoipcb_@gmail_com, and I'll send you the code.

    Best regards,

    HoangKhoi

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