• 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. Shape segment Airgap

Stats

  • Replies 4
  • Subscribers 159
  • Views 14200
  • Members are here 0
More Content

Shape segment Airgap

vimaldevlpr
vimaldevlpr over 5 years ago

Hi,

I want to check  air gap between the shape segments if the air gap between shape segments below 50 mil I have to highlight I used some codes by past forum quires. I attached the code  below its not working can any one please re correct the code. I am new to skill.

code:

(defun shp_seg ()
    AllVoidsInDesign = list()
    axlSetFindFilter(?enabled '(noall SHAPESEGS) ?onButtons '(noall SHAPESEGS))
    axlClearSelSet()
    mypopup = axlUIPopupDefine( nil
    (list (list "Done" 'axlFinishEnterFun)
    (list "Cancel" 'axlCancelEnterFun)))
    axlUIPopupSet( mypopup)
    AllVoidsInDesign = axlGetSelSet(axlSelect(?prompt "Select a void..."))
    axlClearSelSet()
    if(length(AllVoidsInDesign)== 0 then
        axlUIConfirm("No Void selected. ")
    else
       foreach(void AllVoidsInDesign   
    void_bBox = void->bBox
  void_bBox_x1 = xCoord(car(void_bBox))
  void_bBox_y1 = yCoord(car(void_bBox))
  void_bBox_x2 = xCoord(lastelem(void_bBox))
  void_bBox_y2 = yCoord(lastelem(void_bBox))
  void_xy = axlDBAltOrigin('center void)
  void_size_x = max(void_bBox_x1, void_bBox_x2) - min(void_bBox_x1, void_bBox_x2)
  void_size_y = max(void_bBox_y1, void_bBox_y2) - min(void_bBox_y1, void_bBox_y2)
  if(void_size_x > 50 || void_size_y > 50 then
  add_value_list = void->bBox  
  check_area = list(axlMXYSub(car(void_bBox) add_value_list) axlMXYAdd(lastelem(void_bBox) add_value_list))
  axlVisibleDesign(nil)
  axlShell("redisplay")
  axlSetFindFilter(?enabled '(noall SHAPESEGS ) ?onButtons '(noall SHAPESEGS))
  data_in_box = axlGetSelSet(axlSingleSelectBox(check_area))
  axlClearSelSet()
  if(length(data_in_box) > 0 then
   foreach(item data_in_box
   air_gap = axlAirGap(void item nil 'anyLayer)
   if(air_gap < 50 then
    axlHighlightObject(item)   
    fprintf(writeOutFile "%L %L\n", air_gap, void_xy)
   );end if
   );end foreach
  );end if
 );end if
)
    )
)
Thanks
vimal
  • Sign in to reply
  • Cancel
Parents
  • DavidJHutchins
    DavidJHutchins over 5 years ago

    I corrected a few errors in your code so it at least works now ( code shown below )

    procedure(shp_seg()
    let((AllVoidsInDesign mypopup void_bBox_x1 void_bBox_y1 void_bBox_x2
    void_bBox_y2 void_xy void_size_x void_size_y add_value_list
    air_gap check_area data_in_box void_bBox writeOutFile
    err_cnt win_id
    )
    (err_cnt = 0)
    (AllVoidsInDesign = list())
    (axlSetFindFilter ?enabled '(noall SHAPESEGS) ?onButtons '(noall SHAPESEGS))
    (axlSetFindFilter ?enabled list("noall" "voids" "INVISIBLE") ?onButtons list("noall" "voids"))
    (axlClearSelSet)
    (mypopup = (axlUIPopupDefine nil list(list("Done" 'axlFinishEnterFun) list("Cancel" 'axlCancelEnterFun))))
    (axlUIPopupSet mypopup)
    (AllVoidsInDesign = (axlGetSelSet (axlSelect ?prompt "Select a void...")))
    (axlClearSelSet)
    if(zerop(length(AllVoidsInDesign)) then
    (axlUIConfirm "No Void selected. ")
    else
    (writeOutFile = outfile("shp_segs.rpt" "w"))
    foreach(void AllVoidsInDesign
    (void_bBox = (void->bBox))
    (void_bBox_x1 = (xCoord car(void_bBox)))
    (void_bBox_y1 = (yCoord car(void_bBox)))
    (void_bBox_x2 = (xCoord (lastelem void_bBox)))
    (void_bBox_y2 = (yCoord (lastelem void_bBox)))
    (void_xy = (axlDBAltOrigin 'center void))
    (void_size_x = (max(void_bBox_x1 void_bBox_x2) - min(void_bBox_x1 void_bBox_x2)))
    (void_size_y = (max(void_bBox_y1 void_bBox_y2) - min(void_bBox_y1 void_bBox_y2)))
    if(((void_size_x > 50) || (void_size_y > 50)) then
    (add_value_list = (void->bBox))
    ;(check_area = list((axlMXYSub car(void_bBox) add_value_list) (axlMXYAdd (lastelem void_bBox) add_value_list)))
    (axlVisibleDesign nil)
    (axlShell "redisplay")
    (axlSetFindFilter ?enabled '(noall SHAPESEGS) ?onButtons '(noall SHAPESEGS))
    ;(data_in_box = (axlGetSelSet (axlSingleSelectBox check_area)))
    (data_in_box = (axlGetSelSet (axlSingleSelectBox add_value_list)))
    (axlClearSelSet)
    if((length(data_in_box) > 0) then
    foreach(item data_in_box
    (air_gap = (axlAirGap void item nil 'anyLayer))
    if((air_gap < 50) then
    (err_cnt++)
    (axlHighlightObject item)
    fprintf(writeOutFile "%f (%f %f)\n" air_gap car(void_xy) cadr(void_xy))
    )
    )
    )
    )
    )
    ;axlShowObject(AllVoidsInDesign)
    fprintf(writeOutFile "\n%d errors found\n" err_cnt)
    close(writeOutFile)
    (win_id = axlUIViewFileCreate("shp_segs.rpt" "shp_segs.rpt" t))
    )
    )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 5 years ago in reply to DavidJHutchins

    Hai david kindly thanks for your reply some errors or not showing can you please check this i will attach the image below here the other segment air gap is less then 50 but it is not showing error or highlighting.

    Thanks again can you please recorrect the code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • vimaldevlpr
    vimaldevlpr over 5 years ago in reply to DavidJHutchins

    Hai david kindly thanks for your reply some errors or not showing can you please check this i will attach the image below here the other segment air gap is less then 50 but it is not showing error or highlighting.

    Thanks again can you please recorrect the code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • luanvn81
    luanvn81 over 5 years ago in reply to vimaldevlpr

    Hi! I'm not pro-skiller but  maybe you have selected  shapesegs in void' box, it will return only  shapesegs within selected voids, all voidsegs will be not selected. That maybe reason some errors not be shown?.

    Luan.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 5 years ago in reply to luanvn81

    Thanks a lot luan..

    • 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