• 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. Extracting Max Height and Area of Symbols

Stats

  • Replies 7
  • Subscribers 159
  • Views 15978
  • Members are here 0
More Content

Extracting Max Height and Area of Symbols

archive
archive over 17 years ago

I am trying to extract the Area and PACKAGE_HEIGHT_MAX from symbols using the following code... I am recieving an error on s_prop... Can someone lend a hand...?

max = "PACKAGE_HEIGHT_MAX"

;
; Open each symbol by name
;
axlOpenDesign(?design shapename ?mode "wf" )
axlClearSelSet()
axlVisibleDesign(nil)
axlVisibleLayer("PACKAGE GEOMETRY/PLACE_BOUND_TOP" t)
axlSetFindFilter(?enabled "shapes" ?onButtons "shapes")
axlAddSelectAll()
lshape = axlGetSelSet()
foreach(shape lshape
   proplist = shape->prop->??
   if( proplist!=nil ;check to make sure there are attached properties.
   then
      foreach( prop proplist ;step through each property
         sprintf(s_prop "%s", prop) ; This format is incorrect...
         if( s_prop == max
         then
            max_height=car(prop->?)
            shp_area = shape->area
         );end if prop max
       );end foreach
      );end if
 );end foreach

JMW


Originally posted in cdnusers.org by jmwilkinson
  • Sign in to reply
  • Cancel
  • archive
    archive over 17 years ago

    1) What is the error message on s_prop?
    2) Have you isolated which line the error is occuring on?
    3) Is "prop" evaluating to something other than a string?
    4) The skill doc doesn't show the comma for the sprintf command syntax (but I don't think this is a problem).


    Originally posted in cdnusers.org by Randy R.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 17 years ago

    foreach( prop_pair proplist
    prop_key = symbolToString( car( prop_pair))
    prop_val = cadr( prop_pair)
    if( prop_key == "PACKAGE_HEIGHT_MAX" then



    the important thing to know here is properties are stored as key-value pairs within proplist AND
    the key isn't a STRING but rather a symbol so you need to convert it b4 doing the comparison.

    HTH,


    Chris Walters
    local Cadence guru
    ()


    Originally posted in cdnusers.org by kerchunk
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 17 years ago

    several tips;
    1) axlDBGetProperties(shape "allegro") will return a list of name value pairs instead of using shape->prop->??
    - also allows for high-level property filtering
    2) It is more efficient to compare symbols so either define PACKAGE_HEIGHT_MAX as a symbol or convert it to a symbol
    sym = makeSymbol("PACKAGE_HEIGHT_MAX")
    Alternatively a comparision using a symbol: if( prop_key == 'PACKAGE_HEIGHT_MAX
    3) If you are just trying to get a single property value off a dbid then you can do
    value = shape->prop->PACKAGE_HEIGHT_MAX
    if property is not defined then the value is nil


    Originally posted in cdnusers.org by fxf
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 17 years ago

    Hi All,

    Thanks for the help... Here is a working update... Please provide any further feedback on ways to make this more efficient...

    JMW

    ;
    ; Open each symbol by name
    ;
    axlOpenDesign(?design shapename ?mode "wf" )
    fprintf(outlog "%s read in for area/max_height extraction...\n" shapename)
    axlClearSelSet()
    axlVisibleDesign(nil)
    axlVisibleLayer("PACKAGE GEOMETRY/PLACE_BOUND_TOP" t)
    axlSetFindFilter(?enabled "shapes" ?onButtons "shapes")
    axlAddSelectAll()
    lshape = axlGetSelSet()
    foreach(shape lshape
    proplist=axlDBGetProperties(shape)
    if( proplist!=nil ;check to make sure there are attached properties.
    then
    foreach(prop_pair proplist ;step through each property
    prop_key=symbolToString(car(prop_pair))
    prop_val=cadr(prop_pair)
    if(prop_key=="PACKAGE_HEIGHT_MAX"
    then
    max_height=atof(car(parseString(prop_val)))/1000
    ;printf("%s\n" max_height)
    poly = car(axlPolyFromDB(shape))
    shp_area = poly->area
    shp_area = shp_area/1000000
    ;printf("%2.3f\n" shp_area)
    );end if prop max
    );end foreach
    );end if
    );end foreach
    curshapename = axlCurrentDesign()
    axlClearSelSet()
    axlVisibleDesign(nil)
    axlVisibleLayer("PIN/TOP" t)
    axlVisibleUpdate(t)
    axlSetFindFilter(?enabled "PINS" ?onButtons "PINS")
    axlAddSelectAll()
    pincnt = axlGetSelSetCount()
    fprintf(sepupdate "%s,%2.3f,%2.3f,%n\n" curshapename shp_area max_height pincnt)
    axlClearSelSet()


    Originally posted in cdnusers.org by jmwilkinson
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 17 years ago

    Hi All,

    My apology for the formatting... Here is an attached formatted version...

    JMW


    Originally posted in cdnusers.org by jmwilkinson
    test1.il
    • 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