• 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. Extract areas on the FPCB that do not contain arcs.(Season2...

Stats

  • Replies 1
  • Subscribers 19
  • Views 289
  • Members are here 0
More Content

Extract areas on the FPCB that do not contain arcs.(Season2)

SG20260713408
SG20260713408 23 days ago

Hello, everyone.
I am reposting this with the finalized code,
which builds upon the code shared by "Hoangkhoipcb".
Once again, I would like to thank "Hoangkhoipcb".

Note : Changed on 26Y/10M/16D (;; Change Here)

           Enabled execution by layer within APD.



/*
================================================================================

*(26Y/09M/30D)
* Command   : create_arc_chk
* Function      : Checks for bent corners (sharp angles) without arcs on CLINES.
*                       Highlights detected segments and generates a report log.
*
* [How to Use]
* 1. Modified to allow checking of individual layers or all layers.
* 2. When the window appears after execution:
* 3. Select the layer you wish to check and click the OK button.
* - All_Layer : Checks clines on all layers.
* - Others     : Checks clines only on the specific layer.
* 4. Clicking the Cancel button stops the operation.
*
* Output File : create_arc_chk.log
================================================================================
*/

axlCmdRegister("create_arc_chk" 'create_arc_chk)

(defun create_arc_chk ()
(let (all_layers sel_layer clines seg_list Out_file segs seg next_seg angle pt_corner error_count)

all_layers = append(list("All_Layer") axlSubclassRoute(?field 'isEtch))
sel_layer = nth(axlUIMultipleChoice("Select a Layer" all_layers "All Etch Layer") all_layers)

when(sel_layer
if(sel_layer == "All_Layer" then
axlSetFindFilter(?enabled '("noall" "CLINES" "INVISIBLE") ?onButtons '("all"))
axlAddSelectAll()
clines = axlGetSelSet()
else
axlVisibleDesign(nil)
axlVisibleLayer(strcat(axlMapClassName("ETCH") "/" sel_layer) t)  ;; Changed here.
axlVisibleLayer(strcat("PIN/" sel_layer) t)
axlVisibleLayer(strcat("VIA CLASS/" sel_layer) t)
axlVisibleLayer("BOARD GEOMETRY/OUTLINE" t)
axlVisibleUpdate(t)
axlSetFindFilter(?enabled '("noall" "CLINES") ?onButtons '("all"))
axlAddSelectAll()
clines = axlGetSelSet()
)

axlClearSelSet()

seg_list = nil
error_count = 0

Out_file = outfile("create_arc_chk.log" "w")

fprintf(Out_file "%-5s %-7s %-10s %s\n" "No" "Angle" "Layer" "Location")

foreach(cline clines
segs = cline->segments
while(cdr(segs)
seg = car(segs)
next_seg = cadr(segs)

/* Proceed only if both segments are straight lines */
if(seg->xy == nil && next_seg->xy == nil then

/* Find the intersection point of two consecutive line segments */
if(axlGeoPointsEqual(car(seg->startEnd) car(next_seg->startEnd)) || axlGeoPointsEqual(car(seg->startEnd) cadr(next_seg->startEnd)) then
pt_corner = car(seg->startEnd)
else
pt_corner = cadr(seg->startEnd)
)

angle = abs(axlRadToDeg(axlGeoAngleBetweenLines(seg->startEnd next_seg->startEnd)))

if(!axlGeoEqual(angle 0.0) && !axlGeoEqual(angle 180.0) then
error_count = error_count + 1

fprintf(Out_file "%-5d %-7.2f %-10s %L\n" error_count angle cadr(parseString(seg->layer "/")) pt_corner)

seg_list = cons(seg seg_list)
seg_list = cons(next_seg seg_list)
)
)
segs = cdr(segs)
)
)
close(Out_file)

if(error_count > 0 then
axlHighlightObject(seg_list)
axlUIViewFileCreate("create_arc_chk.log" "Arc Segments Check" nil)
printf("### Errors : %d ###\n" error_count)
else
printf("### No arc-less corners found. ###\n")
)
)
)
)

  • Sign in to reply
  • Cancel
Parents
  • Renu Vibha
    Renu Vibha 17 days ago

    Hi SG20260713408 Thank you very much for sharing the finalized code. 

    Hoangkhoipcb thank you for sharing your expertise, and commitment to helping others make the community stronger every day! 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Renu Vibha
    Renu Vibha 17 days ago

    Hi SG20260713408 Thank you very much for sharing the finalized code. 

    Hoangkhoipcb thank you for sharing your expertise, and commitment to helping others make the community stronger every day! 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information