Home > Community > Forums > PCB SKILL > how to remove a subclass

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 how to remove a subclass 

Last post Wed, Jan 16 2013 9:05 AM by VijayVela. 10 replies.
Started by Ejlersen 04 Mar 2010 07:01 PM. Topic has 10 replies and 3289 views
Page 1 of 1 (11 items)
Sort Posts:
  • Thu, Mar 4 2010 7:01 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 556
    • Points 9,795
    how to remove a subclass Reply

    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

    Best regards Ole
    • Post Points: 20
  • Thu, Mar 4 2010 7:25 PM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 290
    • Points 4,620
    Re: how to remove a subclass Reply

     axlDeleteObject - assumes layer is empty and not a pre-defined Allegro subclass (e.g. can't delete ETCH/TOP) 

    Example if you want to delete a user subclass named "FOO" on board geometry

     p = axlLayerGet("BOARD GEOMETRY/FOO")

    axlDeleteObject(p)

     

    • Post Points: 35
  • Thu, Mar 4 2010 7:49 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 556
    • Points 9,795
    Re: how to remove a subclass Reply

    Hi

    Thanks that just what I needed

    Best regards

    OIe

    Best regards Ole
    • Post Points: 5
  • Sat, Oct 9 2010 8:36 AM

    Re: how to remove a subclass Reply

     What if I want to delete BOARD GEOMETRY/BOTH_ROOMS or MANUFACTURING/NO_PROBE_TOP since those subclasses are unused? I'd like to eliminate unneeded layers to clean up the DB, instead of having "wasted" layers in my company's otherwise streamlined and customized default boards. There's really no way to eliminate pre-defined subclasses?

    • Post Points: 5
  • Fri, Oct 15 2010 8:22 AM

    Re: how to remove a subclass Reply

     To anyone else looking for confirmation, the answer is no. Pre-defined subclasses are there to stay, an AE tells me.

    • Post Points: 20
  • Wed, Jan 9 2013 8:51 AM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Re: how to remove a subclass Reply

    I'm trying to find out a method of removing all un-used subclasses (not the predefined subclasses).
    How do we iterate through all the custom subclasses and how do we find out if its is empty or not?

    Thanks.


    Regards,
    Vijay Anandh Vela, CID

    • Post Points: 20
  • Thu, Jan 10 2013 1:16 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 707
    • Points 15,395
    Re: how to remove a subclass Reply

    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

    Dave Elder, Tait Communications
    • Post Points: 35
  • Fri, Jan 11 2013 12:11 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: how to remove a subclass Reply
    This look use full, thanks too :)
    • Post Points: 5
  • Sun, Jan 13 2013 11:15 PM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Re: how to remove a subclass Reply

    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

    • Post Points: 20
  • Tue, Jan 15 2013 12:14 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 707
    • Points 15,395
    Re: how to remove a subclass Reply

    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 

    Dave Elder, Tait Communications
    • Post Points: 20
  • Wed, Jan 16 2013 9:05 AM

    • VijayVela
    • Not Ranked
    • Joined on Tue, May 31 2011
    • Posts 11
    • Points 145
    Re: how to remove a subclass Reply
    Thanks Dave...
    • Post Points: 5
Page 1 of 1 (11 items)
Sort Posts:
Started by Ejlersen at 04 Mar 2010 07:01 PM. Topic has 10 replies.