• 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. Access via properties

Stats

  • Replies 6
  • Subscribers 159
  • Views 15831
  • Members are here 0
More Content

Access via properties

luanvn81
luanvn81 over 13 years ago

 Hi everyone!

   How can I get properties of Connected lines: , Connected vias: , Connected shapes:  in a Via.

    I have tried to use this: 

............................

           foreach(via allViasInDesign
               fprintf(writeOutFile "%L", via->Connected->pins)
                                                                   .........................................

           ...But  it returns to nil.  I wan to get layer name in "Connected lines: , Connected vias: , Connected shapes:" . Please help me.

 

 

 LISTING: 1 element(s)

              < VIA >              

  origin-xy:    (-7031.130 -14189.120)

  part of net name:  GND
  Connected lines:     1 ( BL )
  Connected vias:      1 ( AL2 )
  Connected shapes:    1 ( AL2 )

  Padstack name:   VIA-BL-AL-50
  Type:            bbvia

  padstack defined from AL2 to BL
  rotation:  0.000  degrees
  Via is not mirrored

 Luan.

Tks.

  • Sign in to reply
  • Cancel
  • Pawandeep
    Pawandeep over 13 years ago
    Hi Luan,

    You should consider using axlDBGetConnect function to get the attached items on a via.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • luanvn81
    luanvn81 over 13 years ago

     Hi!

      I have tried to do it but not success, I only want to get the layers that via connect to (line, shape pin)

    ex:    Connected lines:     1 ( TOP )                      ===> TOP

            Connected shapes:    1 ( BOTTOM )         ===> BOTTOM

    who can help me  ?

    Thank.

    Luan.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Randy R
    Randy R over 13 years ago

    See if this helps.  It should list all the via connections.  With some minor modifications, you can put the data into a list/array and they output it based on object type.

    axlSetFindFilter(?enabled list( "noall" "vias")
    ?onButtons list( "noall" "vias"))
    axlAddSelectAll()

    allViasInDesign = axlGetSelSet()
    foreach(via allViasInDesign
      via_connects = axlDBGetConnect(via t)
      foreach(via_connect via_connects
        printf("Object Type = %s,  Layer = %s\n", via_connect->objType via_connect->layer)
      );end foreach
      println("-----------------------------")
    );end foreach

    Good Luck

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • luanvn81
    luanvn81 over 13 years ago

     Hi ! Thank for your reply!

      Your code works OK but if  a via connect to Pin (via on pad) ==> DRC occur  :

     E- *Error* fprintf/sprintf: format spec. incompatible with data - "Format is '%s, %s\n', argument #2 is nil"

       how can i get the layer if it connect to pin?

    Thank.

    Luan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Randy R
    Randy R over 13 years ago

    The following will work for non-through-hole pins.  You can add additional case statements if needed.

    axlSetFindFilter(?enabled list( "noall" "vias")
    ?onButtons list( "noall" "vias"))
    axlAddSelectAll()

    allViasInDesign = axlGetSelSet()
    foreach(via allViasInDesign
      via_connects = axlDBGetConnect(via t)
      foreach(via_connect via_connects
        cnt_obj = via_connect->objType
        cnt_lyr = via_connect->layer
        case( cnt_obj
          ("pin"
            cnt_start = car(via_connect->startEnd)
            cnt_end = cadr(via_connect->startEnd)
            cnt_lyr = if( (cnt_start == cnt_end) cnt_start "***unknown***")
          );end pin section
        );end case
        printf("Object Type = %s,  Layer = %s\n", cnt_obj cnt_lyr)
      );end foreach
      println("-----------------------------")
    );end foreach

    • 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