• 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. Toggle subclasses for the current active class

Stats

  • State Verified Answer
  • Replies 7
  • Subscribers 18
  • Views 1583
  • Members are here 0
More Content

Toggle subclasses for the current active class

SambaKantipudi
SambaKantipudi 6 months ago

Hello All,

For the question below, does anyone already have a working solution (SKILL/WoW)?

Currently,

  • funckey + subclass -+ (toggles the visibility, top to bottom)
  • funckey - subclass -- (toggles the visibility, bottom to top)

However, it does not set the existing subclass visibility to "nil."

I would like to make the entire design visibility "nil" and then toggle the subclasses one by one (top to bottom using funckey + & bottom to top using funckey -) for the current active layer.

If there is no SKILL/WoW solution, guidance would also be appreciated.

Thanks,

BR

Samba

  • Sign in to reply
  • Cancel
Parents
  • Hoangkhoipcb
    0 Hoangkhoipcb 6 months ago

    Hello Samba!

    I really don't understand what you all mean.
    You can refer to this code.
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    axlCmdRegister("subclass+" 'subclassesdown)
    axlCmdRegister("subclass-" 'subclassesup)
    current_subclasses_down = nil
    current_subclasses_up = nil
    sub_pointer_up = 0
    sub_pointer_down = 0
    (defun subclassesdown ()
    let((sub vi_subclasses current_subclass tmp_list )
    sub_pointer_up = 0
    sub_list = axlSubclassRoute(?field 'isEtch)
    vi_subclasses = findActiveLayer()
    if(vi_subclasses != nil then
    if(sub_pointer_down == 0 && length(vi_subclasses) != 1 then
    printf("Visible must count as 1")
    else
    current_subclass = car(vi_subclasses)
    tmp_list = reverse(member(current_subclass reverse(sub_list)))
    if( tmp_list != current_subclasses_down then
    current_subclasses_down = tmp_list
    sub_pointer_down = 0
    )
    if(sub_pointer_down == 0 then
    InviLayers("/")
    InviLayers(strcat("/" lastelem(current_subclasses_down)))
    )
    curent_sub = nth(sub_pointer_down current_subclasses_down)
    if(curent_sub != nil then
    sub_pointer_down++
    InviLayers(strcat("/" curent_sub))
    )
    axlShell("redraw")
    axlVisibleUpdate(nil)
    )
    )
    )
    )
    (defun subclassesup ()
    let((sub vi_subclasses current_subclass tmp_list )
    sub_pointer_down = 0
    sub_list = axlSubclassRoute(?field 'isEtch)
    vi_subclasses = findActiveLayer()
    if(vi_subclasses != nil then
    if(sub_pointer_up == 0 && length(vi_subclasses) != 1 then
    printf("Visible must count as 1")
    else
    current_subclass = lastelem(vi_subclasses)
    tmp_list = member(current_subclass sub_list)

    if( tmp_list != current_subclasses_up then
    current_subclasses_up = tmp_list
    sub_pointer_up = 0
    )
    if(sub_pointer_up == 0 then
    curent_sub = nth(sub_pointer_up current_subclasses_up)
    InviLayers("/")
    InviLayers(strcat("/" lastelem(current_subclasses_up)))
    else
    curent_sub = nth(sub_pointer_up reverse(current_subclasses_up))
    )
    if(curent_sub != nil then
    sub_pointer_up++
    InviLayers(strcat("/" curent_sub))
    )
    axlShell("redraw")
    axlVisibleUpdate(nil)
    )
    )
    )
    )
    (defun InviLayers (curentSub)
    let((isVis)
    if(curentSub =="/" then
    isVis = nil
    else
    isVis = t
    )
    axlVisibleLayer(strcat("DRC ERROR CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("PIN" curentSub) isVis)
    axlVisibleLayer(strcat("VIA CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("ETCH" curentSub) isVis)
    axlVisibleLayer(strcat("PLAN" curentSub) isVis)
    )
    )
    (defun findActiveLayer ()
    let((sub)
    prog((re_layer)
    foreach(subclass axlSubclassRoute(?field 'isEtch)
    if( axlIsVisibleLayer(strcat("ETCH/" subclass)) == t then
    re_layer = cons(subclass re_layer)
    )
    )
    return(re_layer)
    )
    )
    )
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Reguards,
    HoangKhoi.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Hoangkhoipcb
    0 Hoangkhoipcb 6 months ago

    Hello Samba!

    I really don't understand what you all mean.
    You can refer to this code.
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    axlCmdRegister("subclass+" 'subclassesdown)
    axlCmdRegister("subclass-" 'subclassesup)
    current_subclasses_down = nil
    current_subclasses_up = nil
    sub_pointer_up = 0
    sub_pointer_down = 0
    (defun subclassesdown ()
    let((sub vi_subclasses current_subclass tmp_list )
    sub_pointer_up = 0
    sub_list = axlSubclassRoute(?field 'isEtch)
    vi_subclasses = findActiveLayer()
    if(vi_subclasses != nil then
    if(sub_pointer_down == 0 && length(vi_subclasses) != 1 then
    printf("Visible must count as 1")
    else
    current_subclass = car(vi_subclasses)
    tmp_list = reverse(member(current_subclass reverse(sub_list)))
    if( tmp_list != current_subclasses_down then
    current_subclasses_down = tmp_list
    sub_pointer_down = 0
    )
    if(sub_pointer_down == 0 then
    InviLayers("/")
    InviLayers(strcat("/" lastelem(current_subclasses_down)))
    )
    curent_sub = nth(sub_pointer_down current_subclasses_down)
    if(curent_sub != nil then
    sub_pointer_down++
    InviLayers(strcat("/" curent_sub))
    )
    axlShell("redraw")
    axlVisibleUpdate(nil)
    )
    )
    )
    )
    (defun subclassesup ()
    let((sub vi_subclasses current_subclass tmp_list )
    sub_pointer_down = 0
    sub_list = axlSubclassRoute(?field 'isEtch)
    vi_subclasses = findActiveLayer()
    if(vi_subclasses != nil then
    if(sub_pointer_up == 0 && length(vi_subclasses) != 1 then
    printf("Visible must count as 1")
    else
    current_subclass = lastelem(vi_subclasses)
    tmp_list = member(current_subclass sub_list)

    if( tmp_list != current_subclasses_up then
    current_subclasses_up = tmp_list
    sub_pointer_up = 0
    )
    if(sub_pointer_up == 0 then
    curent_sub = nth(sub_pointer_up current_subclasses_up)
    InviLayers("/")
    InviLayers(strcat("/" lastelem(current_subclasses_up)))
    else
    curent_sub = nth(sub_pointer_up reverse(current_subclasses_up))
    )
    if(curent_sub != nil then
    sub_pointer_up++
    InviLayers(strcat("/" curent_sub))
    )
    axlShell("redraw")
    axlVisibleUpdate(nil)
    )
    )
    )
    )
    (defun InviLayers (curentSub)
    let((isVis)
    if(curentSub =="/" then
    isVis = nil
    else
    isVis = t
    )
    axlVisibleLayer(strcat("DRC ERROR CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("PIN" curentSub) isVis)
    axlVisibleLayer(strcat("VIA CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("ETCH" curentSub) isVis)
    axlVisibleLayer(strcat("PLAN" curentSub) isVis)
    )
    )
    (defun findActiveLayer ()
    let((sub)
    prog((re_layer)
    foreach(subclass axlSubclassRoute(?field 'isEtch)
    if( axlIsVisibleLayer(strcat("ETCH/" subclass)) == t then
    re_layer = cons(subclass re_layer)
    )
    )
    return(re_layer)
    )
    )
    )
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Reguards,
    HoangKhoi.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • SambaKantipudi
    0 SambaKantipudi 6 months ago in reply to Hoangkhoipcb

    Hello Hoangkhoipcb 
    Thankyou very much for you time!

    My requirement:

    For any active class in the design (not only etch), I would like to make the design visibility to nil, and then using funckeys "+" "-", I would like to toggle its subclass layers.

    Example:

    Active class is: Board Geometry
    I would now like to toggle subclasses of B.G, one by one using funckeys "+" "-"

    When the active layer is ETCH, then like in your above code, toggle DRC, PIN, VIA CLASS, ETCH, PLAN etc layers.

    Thanks

    BR

    Samba

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

    Hi Samba!

    I have adjusted based on your suggestion. 

    Try this:

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    axlCmdRegister("++" 'subclassesdown)
    axlCmdRegister("--" 'subclassesup)
    (defun subclassesdown ()
    let(( tmp_list )
    tmp_list = DE_subclasses("down")
    if(tmp_list != nil then
    class = car(tmp_list)
    next_sub = cadr(cadr(tmp_list))
    DE_Visiable(class, next_sub)
    )
    )
    )
    (defun subclassesup ()
    let(( tmp_list )
    tmp_list = DE_subclasses("up")
    if(tmp_list != nil then
    class = car(tmp_list)
    next_sub = cadr(reverse(cadr(tmp_list)))
    DE_Visiable(class, next_sub)
    )
    )
    )
    (defun DE_subclasses (tag)
    prog((re_sub)
    layer = axlGetActiveLayer()
    class = car(parseString(layer "/"))
    sub = cadr(parseString(layer "/"))
    sub_list = axlSubclasses(class)

    f_list = sub_list
    if(class !="ETCH" then
    f_list = sort(sub_list 'axlStrcmpAlpNum)
    )
    if(tag =="down" then
    next_subs = member(sub f_list)
    else
    next_subs = reverse(member(sub reverse(f_list)))
    )
    if(length(next_subs) > 1 then
    ;axlVisibleLayer(class nil)
    re_sub = list(class, next_subs)
    )
    return(re_sub)
    )
    )
    (defun DE_Visiable (class, next_sub)
    axlSetActiveLayer(strcat(class "/" next_sub))
    if(class =="ETCH" then
    ;InviLayers("/")
    InviLayers(strcat("/" next_sub))
    else
    axlVisibleLayer(strcat(class "/" next_sub) t)
    )
    axlShell("redraw")
    axlVisibleUpdate(t)
    )
    (defun InviLayers (curentSub)
    let((isVis)
    if(curentSub =="/" then
    isVis = nil
    else
    isVis = t
    )
    axlVisibleLayer(strcat("DRC ERROR CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("PIN" curentSub) isVis)
    axlVisibleLayer(strcat("VIA CLASS" curentSub) isVis)
    axlVisibleLayer(strcat("ETCH" curentSub) isVis)
    axlVisibleLayer(strcat("PLAN" curentSub) isVis)
    )
    )
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    HoangKhoi.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • SambaKantipudi
    0 SambaKantipudi 6 months ago in reply to Hoangkhoipcb

    Thank you very much again.

    axlVisibleDesign(nil), is still pending.

    Where should I add axlVisibleDesign(nil), to the above code?

    I expect the SKILL to set the design visibility "nil" and then make the subclass visible. This way, I only see the visibility of active class/ sublcass for general CLASS/SUBCLASS and class/ sublcass(es) for ETCH (DRC, PIN, etc.)

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

    Problem solved

    No further support needed.

    Thankyou

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