• 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. how to remove a subclass

Stats

  • Replies 10
  • Subscribers 162
  • Views 18280
  • Members are here 0
More Content

how to remove a subclass

Ejlersen
Ejlersen over 15 years ago

Hi

I've been looking all over for an axl function to delete a subclass - but I've not been able to find such a function.

Can anyone help me?

Best regards

Ole

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 12 years ago

    Use  axlSubclasses to list all subclasses for a class.

    Use axlLayerGet to get the layer parameters. The userDefined attribute tells you whether it is user-defined

    Use the selection set  utilities to see if it's empty

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • serpens
    serpens over 12 years ago
    This look use full, thanks too :)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • VijayVela
    VijayVela over 12 years ago

    Hi Dave,
    Thanks for the guide. I managed to write a SKILL program to do this. One of my first program.. I'm pretty sure this code can be further simplified so realy appreciate your comments. Below is my code:-

    defun( cleanupSubclass ()
     l_sclass_to_delete = tconc(nil "SMART")
     l_filter = list("noall" "lines" "shapes" "linesegs" "shapesegs" "voidsegs" "figures" "text")
     l_visibility=axlVisibleGet() ;To store the currnet visibility
     axlSetFindFilter(?enabled l_filter ?onButtons l_filter)

     foreach( _subclass axlSubclasses("PACKAGE GEOMETRY" ?field 'userDefined)  ;Check every user defined subclass
      axlClearSelSet()
      axlVisibleDesign(nil)
      axlVisibleLayer(strcat("PACKAGE GEOMETRY/" _subclass) t )
      axlUIWUpdate(nil)
      axlAddSelectAll()
      aChkEmpty = length(axlGetSelSet())

      if( aChkEmpty > 0 then
       ; DO NOTHING AS THE SUBCLASS IS NOT EMPTY
      else
       if( substring(_subclass 1 3) == "DTS" then
        ; do nothing is there is a DTS prefix which is being used in our process
       else
        ;APPEND THE CLASS/SUBCLASS INTO THE LIST
        scls = strcat("PACKAGE GEOMETRY/" _subclass)
        tconc(l_sclass_to_delete scls)   ;append it into a list in the <class/subclasss> format
       ) ;end if
      ); end if
     );end foreach

     axlClearSelSet()
     axlSetFindFilter(?enabled 'noall ?onButtons 'noall)
     deleteUnusedSubclass(cdr(car(l_sclass_to_delete)))
     axlVisibleSet(l_visibility)
     axlUIWUpdate(nil)

    )  ; end defun

    defun( deleteUnusedSubclass (l_delSubCls)
     foreach( sclsToDelete l_delSubCls  ;delete every user defined subclass which are empty
      axlDeleteObject(axlLayerGet(sclsToDelete))
     );end foreach text items

    ); end defun

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 12 years ago

    Hi,

    This is somewhat simpler:

    defun( cleanupSubclass ()

     let((l_filter, l_visibility, layerName)

    l_filter = list("noall" "lines" "shapes" "linesegs" "shapesegs" "voidsegs" "figures" "text")

    l_visibility = axlVisibleGet() ;To store the currnet visibility

    axlSetFindFilter(?enabled l_filter ?onButtons l_filter)

    foreach( _subclass axlSubclasses("PACKAGE GEOMETRY" ?field 'userDefined)  ;Check every user defined subclass

    axlClearSelSet()

    axlVisibleDesign(nil)

    axlVisibleLayer(strcat("PACKAGE GEOMETRY/" _subclass) t )

    axlUIWUpdate(nil)

    axlAddSelectAll()

    unless(axlGetSelSet() || substring(_subclass 1 3) == "DTS"

    ;Delete the layer

    layerName = strcat("PACKAGE GEOMETRY/" _subclass)

    when(axlUIYesNo(sprintf(nil, "Delete layer: %s", layerName), nil, 'no)

    axlDeleteObject( axlLayerGet(layerName) );add it into a list in the <class/subclasss> format

    )

    ) ;end unless

    );end foreach

    axlClearSelSet()

    axlSetFindFilter(?enabled 'noall ?onButtons 'noall)

    axlVisibleSet(l_visibility) 

    axlUIWUpdate(nil)

    ))  ; end defun 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • VijayVela
    VijayVela over 12 years ago
    Thanks Dave...
    • 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