• 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. Creating Oblong route keep out

Stats

  • Replies 7
  • Subscribers 160
  • Views 15287
  • Members are here 0
More Content

Creating Oblong route keep out

Rajagopalg
Rajagopalg over 8 years ago

Hi All,

I am new to skill code and I am looking for a skill function to creating a Oblong route keep out for a selected object i.e Via or Pins?

Thanks in advance!

Raj

  • Sign in to reply
  • Cancel
  • Soundman99
    Soundman99 over 8 years ago
    I don't have exact code, but I would first get the DBID of the via or pin, then create a polygon object from that using axlPolyFromDB(), expand the polygon using axlPolyExpand() and then make a shape from the polygon with axlDBCreateShape(<polygon> nil Route_Keepout).
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 8 years ago
    This should work. Set the w and h values to the RKO size you need.

    axlCmdRegister("ovalRKO" 'createOvalRKO ?cmdType "interactive")

    defun( createOvalRKO ()
    let( (w h r pth new_pth)
    axlSetFindFilter(?enabled '("noall" "vias") ?onButtons "vias")
    when(axlSingleSelectBox()
    w = 1.0
    h = 2.0
    if(w>h
    then r=h, pth= axlMakeDynamicsPath( list( list( w-r:h -w+r:h) list( -w+r:h -w+r:-h 0.0 -w+r:0.0 r) list( -w+r:-h w-r:-h) list( w-r:-h w-r:h 0.0 w-r:0.0 t)))
    else r=w, pth= axlMakeDynamicsPath( list( list( -w:h-r -w:-h+r) list( -w:-h+r w:-h+r 0.0 0.0:-h+r r) list( w:-h+r w:h-r) list( w:h-r -w:h-r 0.0 0.0:h-r t)))
    )
    foreach(id axlGetSelSet()
    new_pth= axlPathOffset(pth id->xy)
    when(axlDBCreateShape(new_pth t "PACKAGE KEEPOUT/ALL" nil nil)
    axlMsgPut("Route Keepout created at %L" id->xy)
    )
    )
    )
    ))
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Rajagopalg
    Rajagopalg over 8 years ago

    Brukers,

    Thanks for your code and it works well for selected via's but my requirements is oblong keepout needed for selected two vias.

    Here is the code for rectangle keepout and attached image for what i am looking for it.

    could you please help to convert this rectangle KPO to oblong KPO as like image.

    procedure(rect()
    antipad_w=axlEnterString(?prompts list("Enter width of antipad:"))
    antipad_w=atof(antipad_w)
    antipad_h=axlEnterString(?prompts list("Enter height of antipad:"))
    antipad_h=atof(antipad_h)
    subclass=axlEnterString(?prompts list("Enter the layer name (class/subclass) which shape need to be:"))
    axlSetFindFilter(?enabled list("noall" "vias") ?onButtons list("noall" "vias"))
    axlSingleSelectBox()
    via_dbids=axlGetSelSet()
    via1_dbid=nth(0 via_dbids)
    via1_loc=via1_dbid->xy
    x1=nth(0 via1_loc)
    y1=nth(1 via1_loc)
    via2_dbid=nth(1 via_dbids)
    via2_loc=via2_dbid->xy
    x2=nth(0 via2_loc)
    y2=nth(1 via2_loc)
    x=(x1+x2)/2
    y=(y1+y2)/2
    path=axlPathStart(list(x-antipad_w/2:y-antipad_h/2) 0)
    path=axlPathLine(path 0 x-antipad_w/2:y+antipad_h/2)
    path=axlPathLine(path 0 x+antipad_w/2:y+antipad_h/2)
    path=axlPathLine(path 0 x+antipad_w/2:y-antipad_h/2)
    path=axlPathLine(path 0 x-antipad_w/2:y-antipad_h/2)
    shape=axlDBCreateShape(path t subclass)
    );procedure

    Thanks very much!

    Raj

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

    Try this. The only thing is when the vias are not at 0 or 90 degrees. You need to calculate the angle and pass it to the axlTransformObject function.

    defun( createOvalRKO ()
    let( (w h r pth new_pth l_sel via1 via2 midXY )
    axlSetFindFilter(?enabled '("noall" "vias") ?onButtons "vias")
    when(axlSingleSelectBox()
        l_sel = axlGetSelSet()
        if(length(l_sel)==2
        then
            via1 = car(l_sel)
            via2 = cadr(l_sel)
            midXY = axlMidPointLine(list(via1->xy via2->xy))
            h = axlDistance(via1->xy via2->xy)
            w =    atof(axlEnterString(?prompts list("Enter width of antipad:")))
            w = w/2.0
            h = h/2.0+w
            if(w>h
            then r= h, pth= axlMakeDynamicsPath( list( list( w-r:h -w+r:h)   list( -w+r:h -w+r:-h 0.0 -w+r:0.0 r) list( -w+r:-h w-r:-h) list( w-r:-h w-r:h 0.0 w-r:0.0 t)))
            else r= w, pth= axlMakeDynamicsPath( list( list( -w:h-r -w:-h+r) list( -w:-h+r w:-h+r 0.0 0.0:-h+r r) list( w:-h+r w:h-r)   list( w:h-r -w:h-r 0.0 0.0:h-r t)))
            )
            shp = car(axlDBCreateShape(pth t "ROUTE KEEPOUT/ALL" nil nil) )
            when(shp
                ;TODO: determine the angle between via1->xy and via2->xy. Use this value for axlTransformObject
                axlTransformObject(shp ?move midXY ?angle 0.0)
                axlMsgPut("Route Keepout created at %L" midXY)
            )
        else
            axlMsgPut("Too few or many elements selected. Please only select 2.")
        )
    )
    ))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Rajagopalg
    Rajagopalg over 8 years ago
    Hi Bruekers,
    Thanks for sharing the code and I need one more favor,
    1. If the y1 and y2 co-ordinates are the keepout shape need to be draw as horizontal and otherwise it should be vertical that means if x1 and x2 are same co-ordinates. 2. Also is there any function/possibility to fix the via1 is FIRST_VIA which is left hand side from "midxy" and via1 is RIGHT_VIA which right hand side of "midxy".
    Thank you!

    Regards -Raj
    • 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