• 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. question about the delete subclass

Stats

  • Replies 8
  • Subscribers 159
  • Views 15511
  • Members are here 0
More Content

question about the delete subclass

Evel
Evel over 16 years ago
Dear all, It's my first time for asking help here about a skill. I want to write a function about the class/subclass modify and update. 1,if the Old_Drawing_1 is exist and drawing is not null. I need delete all the Old_Drawing and change the drawing_1 to Old_Drawing_1 But When I want to use the axlDeleteObject function, it said that if the drawing is not null,it can not delete it, and I don't want to use the axlshell delete function. 2, also I found a question about the delete;when I use the delete Symbol "Drawing_name" done, I can not delete, but when I use to other normal symbol. such as U1.it works! 3,In a word, Just done: 1,Drawing_i-->Old_Drawing_i (i=1,2,3,4...) 2,intellect judgement and update.(Notes: Drawing1&Drawing2 or Drawing3&Drawing4 is a symbol load by bsm file) thank you!
  • Sign in to reply
  • Cancel
  • eDave
    eDave over 16 years ago

    It's difficult to know exactly what you are trying to do but... 

    If you are deleting a non-package symbol you will need to select it by its name attribute.

    i.e.

    axlDeleteObject(car(axlSelectByName("SYMTYPE" "Old_Drawing_1"))

    Nothing attached to an object that you are trying to delete can be fixed unless you use axlDBIgnoreFixed.

    Dave

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Evel
    Evel over 16 years ago

    Dear eDave,

     thanks for your quick reply and help.

     so now I can follow your mathord, but first of all I need get the drawing's name. because I need delete the whole Old_Drawing_i(i=1,2,3,4....);using your code:

    axlDeleteObject(car(axlSelectByName("Symtype" "Old_Drawing_1_name")))

    so now I need to do is that judge the drawing exit or not and then get the relate drawing symbol name:just like:

    Smathord_board-a-DRAWING-1121

    1,how I can get it?

     LISTING: 1 element(s)

                 < SYMBOL >            

      Symbol name:  Smathord_board-a-DRAWING-1121
      origin-xy:    (0.00 0.00)
      rotation:     0.000  degrees
      not_mirrored

    2,I will delete this old_drawing_i(i=1,2,3,..) and then creat a new drawing change the drawing_i(i=1,2,3..) to old_drawing_i(i=1,2,3...)

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

    for(i, 1, n
      obj = car(axlSelectByName("Symtype" sprintf(nil, "Old_Drawing_%d_name", i)))
      when(obj
        axlDeleteObject(obj)
        ...
      )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Evel
    Evel over 16 years ago

    Hi,Dave

    for(i, 1, n
      obj = car(axlSelectByName("Symtype" sprintf(nil, "Old_Drawing_%d_name", i)))
      when(obj
        axlDeleteObject(obj)
        ...
      )
    )

    is ok, but firstly I need get the value of Old_Drawing_%d's name.just don't know how to get it...

    For delete,My code is :

    if(axlIsLayer(Old_Drawing_id)!=nil
    then
    axlVisibleDesign(nil)
    axlVisibleLayer(Old_Drawing_id t)
    (axlClearSelSet)
     axlSetFindFilter( ?enabled list("all" "symbols"  ) ?onButtons list("noall" "symbols" ))
     sprintf(cmd "delete;pick 0 0;done")
     axlShell(cmd)

    because it is a drawing symbol,so pick 0:0 will be OK for delete.

    so I need to do is that automatic get the value of the Old_Drawing_id's name......

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

    Your code makes no sense.

    Old_Drawing_id is not a layer, it's a SYMBOL (isn't it?), so axlIsLayer won't return anything.

    If you want to find the relevant layers, use unique(Old_Drawing_id ->children ~>layer). This return a unique list of all the layers used by children of the symbol.

    Don't use axlShell, axlDeleteObject should work OK.

    Get the name of an object by finding its name attribute. i.e. Old_Drawing_id ->name

    • 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