• 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. Problem with axlShell("change")

Stats

  • Replies 7
  • Subscribers 18
  • Views 6495
  • Members are here 0
More Content

Problem with axlShell("change")

Philippe LC
Philippe LC over 4 years ago

Hi

I use this code in a programm 

axlSetFindFilter(?enabled (list "NOALL" "FIGURES" "LINES" "TEXT" "SHAPES") ?onButtons (list "ALL"))
axlVisibleDesign( nil )
axlVisibleLayer("MANUFACTURING/PEN2" t)
axlShell("redraw")
axlShell("change")

but after the last line the find filter keep only "TEXT ON" .

The problem seems to be random.

is there anyone who has already had the problem ?

Thanks for your feedback

Philippe

  • Cancel
  • Sign in to reply
Parents
  • mir0mik
    mir0mik over 4 years ago

    Hi Philippe LC,

    axlShell( "change") will call the CHANGE command - so the CHANGE command uses its own last remembered states of find filter...

    Try this:

    -  cancel all active commands (IDLE) and set the left half of the filter checkboxes OFF and right half ON

    - run CHANGE and turn OFF all checkboxes in the filter

    - close CHANGE (with DONE, not with CANCEL/ESC) this will save the filter settings

    - run MOVE turn ON all checkboxes in the filter

    - close MOVE (with DONE, not with CANCEL/ESC) this will save the filter settings

    - now when you run CHANGE all filters are OFF and when you run MOVE all filters are ON until you change it and finish the command with DONE

    - when you cancel all command you have half and half turned ON and OFF (IDLE)

     

    So what happens in your code is:

    - by axlSetFindFilter() you are changing the current filter (like you would do manually) but just for your skill (imagine your skill code as another command like myCHANGE)

    - then later you call CHANGE by axlShell() what is the same as running the command directly from the menu

    - the filter setting shouldn't be random but should match your filter settings for CHANGE command

    - if you replace the line with axlShell( "move") it will set the filter as the MOVE command

     

    I don't know what exactly you want to do, but I suppose you want to change all figures/lines/text/shapes in the layer manufacturing/pen2... if you want to use axlShell( "change") it will not work like you want...

    you need to do something like the code below if you do it by skill...

    axlClearSelSet() ;make sure your selection is empty
    axlSetFindFilter( ?enabled '( "noall" "text" "invisible") ?onButtons '( "noall" "text")) ;set what you need to select in the database (pre-seletc/prepare)
    axlAddSelectAll() ;actually select the objects that fulfil the filter criteria

    foreach( qqq_text axlGetSelSet() ;get list of IDs of the selected object and loop through them
     
    when( qqq_text -> layer == "PACKAGE GEOMETRY/DISPLAY_VALUES_TOP" || qqq_text -> layer == "PACKAGE GEOMETRY/DISPLAY_VALUES_BOTTOM" ;if the ID->layer match one or another
    axlDeleteObject( qqq_text);delete the object
    )
    )
    axlClearSelSet() ;release the selection

    so this code will select all texts and check if they are in one of the layers (when statement) if so then it will delete them from DB...

    Regards,

    Miro

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Philippe LC
    Philippe LC over 4 years ago in reply to mir0mik

    Hi Miro

    thank you very much for explaining the problem.

    indeed if I position my filter correctly before launching my program it works.

    My objective is to change all figures/lines/text/shapes from the layer manufacturing/pen2 on layer manufacturing/1.Equiptop and so on

    The code I use below 

    axlSetFindFilter(?enabled (list "ALL") ?onButtons (list "ALL"))
    axlVisibleDesign( nil )
    axlVisibleLayer("MANUFACTURING/PEN2" t)
    axlShell("redraw")
    axlShell("change")

    axlShell("FORM mini change_class MANUFACTURING")
    axlShell("FORM mini change_subclass 1.EQUIPTOP")
    axlShell("FORM mini apply_width NO")
    axlShell("FORM mini apply_size NO")
    axlShell("FORM mini apply_justification NO")
    axlShell("pick_origin -150 -300")
    axlShell("drag_start rel grid 0 0")
    axlShell("drag_stop 900 950")
    axlShell("done")
    axlVisibleLayer("MANUFACTURING/1.EQUIPTOP" t)

    axlSetFindFilter(?enabled list("NOALL" "FIGURES" "LINES" "TEXT" "SHAPES") ?onButtons list("ALL"))
    axlVisibleDesign( nil )
    axlVisibleLayer("MANUFACTURING/PEN3" t)
    axlShell("redraw")
    axlShell("change")
    axlShell("FORM mini change_class MANUFACTURING")
    axlShell("FORM mini change_subclass 2.REFDES_TOP")
    axlShell("pick_origin -150 -300")
    axlShell("drag_start rel grid 0 0")
    axlShell("drag_stop 900 950")
    axlShell("done")
    axlVisibleLayer("MANUFACTURING/2.REFDES_TOP" t)

    axlSetFindFilter(?enabled list("NOALL" "FIGURES" "LINES" "TEXT" "SHAPES") ?onButtons list("ALL"))
    axlVisibleDesign( nil )
    axlVisibleLayer("MANUFACTURING/PEN1" t)
    axlShell("redraw")
    axlShell("change")
    axlShell("FORM mini change_class MANUFACTURING")
    axlShell("FORM mini change_subclass 3.NON_MONTE_TOP")
    axlShell("pick_origin -150 -300")
    axlShell("drag_start rel grid 0 0")
    axlShell("drag_stop 900 950")
    axlShell("done")

    Regards

    Philippe

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mir0mik
    mir0mik over 4 years ago in reply to Philippe LC

    With so much axlShell you could do it by script...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mir0mik
    mir0mik over 4 years ago in reply to Philippe LC

    This should do the same but much more faster...

    axlClearSelSet() ;clear selection
    axlSetFindFilter( ?enabled '( "noall" "lines" "text" "figures" "shapes" "invisible") ?onButtons '( "noall" "lines" "text" "shapes" "figures")) ;set filter (invisible - will select objects even if they are not visible)
    axlAddSelectAll() ;run the filter (select items - this will select all lines, text, figures and shapes in design no matter what layer)
    foreach( qqq_selectedItemID axlGetSelSet() ;get IDs of all selected items from step before and loop through each of them
    case( upperCase( qqq_selectedItemID -> layer) ;check if the ID -> layer (text -> layer == ??? or line -> layer == ???, etc...) match some other the "cases" below like ("MANUFACTURING/PEN2") make it upper case to be sure  it will match the text format (PEN doesn't match pen, or Pen etc... only PEN = PEN so to make sure make it all caps...)
    ( "MANUFACTURING/PEN1" ;if it match this 
    axlChangeLayer( qqq_selectedItemID "3.NON_MONTE_TOP") ;do this
    )
    ( "MANUFACTURING/PEN2" ;if it match this
    axlChangeLayer( qqq_selectedItemID "MANUFACTURING/1.EQUIPTOP") ;do this
    )
    ( "MANUFACTURING/PEN3";if this
    axlChangeLayer( qqq_selectedItemID "MANUFACTURING/2.REFDES_TOP");you got it
    )
    ( t ;anything else  (if the line, text, etc is in other than the three mentioned layer above... 
    nil ;do nothing
    )
    ;add more "pairs"
    )
    axlClearSelSet();release the selection set (you have some items selected and if you do not release it, the next axlGetSlSet() would add more to this selection...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Philippe LC
    Philippe LC over 4 years ago in reply to mir0mik

    Hi

    I saw the command axlChangeLayer but i thought it didn't work in Pcb_editor.

    Thanks for your code it's fine but AxlChangeLayer dont transfer "Figures" Unfortunately.

    Description

    Changes layer for lines, clines or segments, shapes, and text. Functionality offered, at the global level, matches the Allegro PCB Editor change command, but can differ in certain areas.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mir0mik
    mir0mik over 4 years ago in reply to Philippe LC

    what figures do you try to convert?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Philippe LC
    Philippe LC over 4 years ago in reply to mir0mik

    I make a ipf file (ex : package assembly_top / refdes_top / pin top ) and I import on class Manufacturing.

    So Pins are reloaded as Figures. 

    LISTING: 1 element(s)
    
    
                 < FIGURE >
    
    
           class         MANUFACTURING
           subclass      PEN2
      
      origin-xy:    (36.5125 70.8550) 
    
    
      rotation:  0.000  degrees
    
    
      shape type: RECTANGLE
    
    
      size:    1.9000     0.6000
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Philippe LC
    Philippe LC over 4 years ago in reply to mir0mik

    I make a ipf file (ex : package assembly_top / refdes_top / pin top ) and I import on class Manufacturing.

    So Pins are reloaded as Figures. 

    LISTING: 1 element(s)
    
    
                 < FIGURE >
    
    
           class         MANUFACTURING
           subclass      PEN2
      
      origin-xy:    (36.5125 70.8550) 
    
    
      rotation:  0.000  degrees
    
    
      shape type: RECTANGLE
    
    
      size:    1.9000     0.6000
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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