• 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. Using a script inside a foreach loop.

Stats

  • Replies 1
  • Subscribers 159
  • Views 13721
  • Members are here 0
More Content

Using a script inside a foreach loop.

joma
joma over 7 years ago

I am trying to output shape reports for all etch shapes in order to check them for errors.
My foreach loop works for normal skill commands but breaks after the first pass when I use
my script to create a report:

        l_etchShapes = axlDBGetShapes( "ETCH" )
        
        foreach( _testEtchShape l_etchShapes
        
                println(list( "Shape Layer 1 = " _testEtchShape->layer )) ;print for debug
                
                axlClearSelSet()
                axlSingleSelectObject( _testEtchShape )
                axlSetActiveLayer( _testEtchShape->layer )
                axlVisibleDesign( nil )
                axlVisibleLayer( _testEtchShape->layer  t )
                axlSetFindFilter(?enabled list("NOALL" "SHAPES" ) ?onButtons list("ALL"))
            
                        shpInstOut = outfile("./shape_rep.scr")
                                fprintf( shpInstOut "scriptmode +w +i\n" )
                                fprintf( shpInstOut "setwindow pcb\n" )
                                fprintf( shpInstOut "generaledit\n" )
                                fprintf( shpInstOut "shape select\n" )
                                fprintf( shpInstOut "pick grid %L\n",  car( _testEtchShape->bBox ))
                                fprintf( shpInstOut "pop shape report\n" )
                                fprintf( shpInstOut "setwindow text\n" )
                                fprintf( shpInstOut "save\n" )
                                fprintf( shpInstOut "fillin \"temp_shp_report.txt\"\n" )
                                fprintf( shpInstOut "setwindow text\n" )
                                fprintf( shpInstOut "close\n" )
                                fprintf( shpInstOut "done\n" )
                                fprintf( shpInstOut "setwindow pcb\n" )
                                fprintf( shpInstOut "generaledit\n" )
                        close( shpInstOut )
                    axlShell("replay ./shape_rep.scr")
                println(list( "Shape Layer 2 = " _testEtchShape->layer )) ;print for debug
            
            );foreach

Can anyone tell me how to keep the loop from being broken by the script?

  • Sign in to reply
  • Cancel
  • craigl
    craigl over 7 years ago

    In short you can't. When you play a script inside of SKILL all the dbids go out-of-date. You would have to create a script for each shape, then replay the scripts.

    -Craig

    • 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