• 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. Cline to other Cline segment Airgap

Stats

  • Replies 6
  • Subscribers 160
  • Views 16118
  • Members are here 0
More Content

Cline to other Cline segment Airgap

vimaldevlpr
vimaldevlpr over 5 years ago

Hi,

I need one help can any one please help me out from this.

The selected Cline alone has to check the air gap of every cline segment present in the board in that the input value will get by run time. if the airgap value is lesser than input value the cline segment want to be highlight. I'll tried but I shows error can anyone please re correct it.

E- *Error* greaterp: can't handle (4 > nil)

procedure(checkcseg()
axlClearSelSet()
axlSetFindFilter(?enabled `("NOALL" "CLINES") ?onButtons `("CLINES"))
clineschk = axlGetSelSet(axlSelect(?prompt "Select Clines by pick or window."))
if(clineschk then
axlClearSelSet()
axlSetFindFilter(?enabled `("NOALL" "CLINESEGS") ?onButtons `("CLINESEGS"))
clinesegchk = axlGetSelSet(axlAddSelectAll())
val = atoi(axlUIPrompt("Enter the Max Airgap value :"))
if(clinesegchk then
foreach(cln_db clineschk
foreach(csg clinesegchk
_AirGap = lastelem(axlAirGap(cln_db csg csg->layer) )
if(val > _AirGap  then
axlHighlightObject(csg)
print(csg ->xy)
printf("found")
)
)
)
)
)

  • Sign in to reply
  • Cancel
  • Kirti Sikri
    Kirti Sikri over 5 years ago

    Hello,

    It is because the code doesn't handle _AirGap to be nil.

    Once you handle that before val > _AirGap error should go away.

    Thanks,

    Kirti

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

    Hai Kirti,

    That's the thing I don't know how to handle it. can you please give me a solution for this.

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

    replace the following:

    _AirGap = lastelem(axlAirGap(cln_db csg csg->layer) )

    with:

    when(equal(cln_db->layer csg->layer)
    (data = (axlAirGap cln_db csg (csg->layer)))
    when(data
    (_AirGap = (lastelem data))

    then add

    ))

    at the end to close the 2 "when(" statements

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

    Hi David

    I'll updated by checking by name the NET is passing but Airgap value is not measuring could you please help me out.

    procedure(clineAirgap()
    in1 = infile("Netlist.lst")
    a = nil
      while(gets(cseg1 in1)
      cseg1 = car(parseString(cseg1 "\n"))
      when(cseg1 push(cseg1 a))
      )
      close(in1)
          cseg2 = axlSelectByName("NET", a)
      if(cseg2 then
       axlClearSelSet()
       axlSetFindFilter(?enabled `("NOALL" "CLINESEGS") ?onButtons `("CLINESEGS"))
       cseg3 = axlGetSelSet(axlAddSelectAll()) 
       val = atoi(axlUIPrompt("Enter the minimum airgap :"))
       if(cseg3 then
       foreach(chk1 cseg2
        foreach(cseg4 chk1 ->branches
         foreach(chk cseg4 ->children
         when(chk->objType == "path"
          foreach(cseg5 cseg3       
           when(equal(chk->layer cseg5->layer)
            (data = (axlAirGap chk cseg5 (cseg5->layer)))
             when(data
              print("yes1")
              (_AirGap = (lastelem data))
               if(val > _AirGap then
                axlHighlightObject(chk)
                println("yes")   
               )
             )
            )       
           
           )      
          
         )
         )
        )
        )
       )
      )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DavidJHutchins
    DavidJHutchins over 5 years ago

    Try the modified code shown below, also I don't think you can hightlight cline segments, only it's net...

    procedure(clineAirgap()
    let((a in1 cseg1 cseg2 cseg3 cseg4 val data _AirGap loc1 loc2)
    (a = list())
    (in1 = infile("Netlist.lst"))
    while(gets(cseg1 in1)
    cseg1 = car(parseString(cseg1 "\n"))
    when(cseg1
    push(cseg1 a)
    )
    )
    close(in1)
    (cseg2 = car(axlSelectByName("NET", car(a))))
    if(cseg2 then
    axlClearSelSet()
    axlSetFindFilter(?enabled '("NOALL" "CLINESEGS") ?onButtons '("CLINESEGS"))
    cseg3 = axlGetSelSet(axlAddSelectAll())
    val = atof(axlUIPrompt("Enter the minimum airgap :"))
    if(cseg3 then
    foreach(cseg2b cseg2->branches
    foreach(chk cseg2b->children
    when(chk->objType == "path"
    (cseg4 = setof(seg cseg3 ((seg->layer) == chk->layer)))
    foreach(cseg5 cseg4
    if(neq(cseg5->net cseg2) then
    (data = (axlAirGap chk cseg5 (cseg5->layer)))
    when(data
    (_AirGap = (lastelem data))
    when(val > _AirGap axlShowObject(cseg5))
    when(_AirGap < val
    (loc1 = car(data))
    (loc2 = cadr(data))
    axlMsgPut("AirGap Spacing error := layer %s; loc1 = %.4f:%.4f ; loc2 = %.4f:%.4f ; airgap %f" cseg5->layer car(loc1) cadr(loc1) car(loc2) cadr(loc2) _AirGap)
    axlHighlightObject(chk->net)
    axlHighlightObject(cseg5->net)
    )
    )
    )
    )
    )
    )
    )
    else
    axlMsgPut("Nothing selected")
    )
    )
    )
    )

    • 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