• 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 Capture CIS
  3. Extracting All Names from Wires with Multiple Names

Stats

  • State Verified Answer
  • Replies 6
  • Subscribers 44
  • Views 3825
  • Members are here 0
More Content

Extracting All Names from Wires with Multiple Names

AB_1717543042707
AB_1717543042707 over 1 year ago

Hello,


The problem I am having is that I am trying to get the names of wires on a page. I already have code to iterate over every schematic, every page, and every wire. However, when I use the GetNetName command for my wire, it only returns the top name for the wire. In my design, I have wires that have more than one name. I want to find a way to extract all of the names of each wire. Does anyone know how I can do this?

I appreciate it.

  • Sign in to reply
  • Cancel
Parents
  • CadAP
    +1 CadAP over 1 year ago

    Hi AB_1717543042707,

    You can try the below code which will give you schematic net, Alias Name and Net Name of a wire.

    Need to select the design and source the below code.

    set lNets [CapFindObjects $COrFindFilterDlg_NETS {*}]
    set lStatus [DboState]
    # set lAliasName [DboTclHelper_sMakeCString]
    # set lNetName [DboTclHelper_sMakeCString]
    # set lSchiNetName [DboTclHelper_sMakeCString]
    set lNullObj NULL
    foreach lNet $lNets {
    set lAliasName [DboTclHelper_sMakeCString]
    set lNetName [DboTclHelper_sMakeCString]
    set lSchiNetName [DboTclHelper_sMakeCString]
    set lWiresIter [$lNet NewWiresIter $lStatus]
    #get the first wire
    set lWire [$lWiresIter NextWire $lStatus]
    while {$lWire != $lNullObj} {
    puts $lWire
    $lWire GetNetName $lNetName
    $lNet GetName $lSchiNetName
    set lObjectType [$lWire GetObjectType]
    if {$lObjectType == $::DboBaseObject_WIRE_SCALAR} {


    set lAliasIter [$lWire NewAliasesIter $lStatus]
    # #get the first alias of wire
    set lAlias [$lAliasIter NextAlias $lStatus]
    while { $lAlias!=$lNullObj} {
    #placeholder: do your processing on $lAlias
    $lAlias GetName $lAliasName


    set AliasNetName [DboTclHelper_sGetConstCharPtr $lAliasName]
    set SchiNetName [DboTclHelper_sGetConstCharPtr $lSchiNetName]
    set NetName [DboTclHelper_sGetConstCharPtr $lNetName]

    #get the next alias of wire
    # puts $lAlias
    set lAlias [$lAliasIter NextAlias $lStatus]
    }

    # $lWire GetNetName $netname
    # puts [DboTclHelper_sGetConstCharPtr $netname]
    #placeholder: do your processing on Wire scalar $lWire
    }
    #get the next wire
    delete_DboWireAliasesIter $lAliasIter
    set lWire [$lWiresIter NextWire $lStatus]
    puts "AliasNetName: = $AliasNetName , SchiNetName := $SchiNetName , NetName: = $NetName"
    }

    }

    If this doesn't work for you then can you please share the screen shot of you schematic(a wire with multiple name) for what you are looking for.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • AB_1717543042707
    0 AB_1717543042707 over 1 year ago in reply to CadAP

    This code almost works for me. I just need help figuring out how I can get the lNets variable but by iterating through the design rather than having to select the design manually and then sourcing the code. So to clarify, instead of using set lNets [CapFindObjects SCOrFindFilterDIg-NETS {*}], I would like to iterate over the entire design, that way I do not have manually select the design in capture.

    I really appreciate your help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    +1 CadAP over 1 year ago in reply to AB_1717543042707

    Hi AB_1717543042707,

    Good to hear that it worked for you.

    Please find the below code which need to be sourced(capture command window) without selecting the design.

    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]
    set lDesign [GetActivePMDesign]
    set lNullObj NULL
    set lAliasName [DboTclHelper_sMakeCString]
    set lNetName [DboTclHelper_sMakeCString]
    set lSchiNetName [DboTclHelper_sMakeCString]
    if { $lDesign!= $lNullObj} {

    # puts $lDesign
    set lSchematicIter [$lDesign NewViewsIter $lStatus $::IterDefs_SCHEMATICS]
    # get the first schematic view
    set lView [$lSchematicIter NextView $lStatus]
    puts $lView
    while { $lView != $lNullObj} {
    # dynamic cast from DboView to DboSchematic
    set lSchematic [DboViewToDboSchematic $lView]
    set schematicName [DboTclHelper_sMakeCString]
    $lSchematic GetName $schematicName
    puts [DboTclHelper_sGetConstCharPtr $schematicName]
    set lSchiName [DboTclHelper_sGetConstCharPtr $schematicName]

    set lPagesIter [$lSchematic NewPagesIter $lStatus]
    # get the first page
    set lPage [$lPagesIter NextPage $lStatus]
    set lNullObj NULL
    while {$lPage!=$lNullObj} {
    # placeholder: do your processing on $lPage
    set pageName [DboTclHelper_sMakeCString]

    $lPage GetName $pageName
    puts [DboTclHelper_sGetConstCharPtr $pageName]
    set lPageName [DboTclHelper_sGetConstCharPtr $pageName]
    # get the next page
    set lWiresIter [$lPage NewWiresIter $lStatus]
    #get the first wire
    set lWire [$lWiresIter NextWire $lStatus]
    set lNullObj NULL
    while {$lWire != $lNullObj} {
    set lObjectType [$lWire GetObjectType]
    if {$lObjectType == $::DboBaseObject_WIRE_SCALAR} {

    #placeholder: do your processing on Wire scalar $lWire
    set lNet [$lWire GetNet $lStatus]
    $lWire GetNetName $lNetName
    $lNet GetNetName $lSchiNetName
    set SchiNetName [DboTclHelper_sGetConstCharPtr $lSchiNetName]
    set NetName [DboTclHelper_sGetConstCharPtr $lNetName]
    set lAliasIter [$lWire NewAliasesIter $lStatus]
    # #get the first alias of wire
    set lAlias [$lAliasIter NextAlias $lStatus]
    while { $lAlias!=$lNullObj} {
    #placeholder: do your processing on $lAlias
    $lAlias GetName $lAliasName


    set AliasNetName [DboTclHelper_sGetConstCharPtr $lAliasName]

    #get the next alias of wire
    # puts $lAlias
    set lAlias [$lAliasIter NextAlias $lStatus]
    }




    }
    puts "AliasNetName: = $AliasNetName , SchiNetName := $SchiNetName , NetName: = $NetName"
    #get the next wire
    set lWire [$lWiresIter NextWire $lStatus]
    }
    delete_DboPageWiresIter $lWiresIter

    set lPage [$lPagesIter NextPage $lStatus]

    }
    set lView [$lSchematicIter NextView $lStatus]
    delete_DboSchematicPagesIter $lPagesIter
    }

    delete_DboLibViewsIter $lSchematicIter

    }

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • CadAP
    +1 CadAP over 1 year ago in reply to AB_1717543042707

    Hi AB_1717543042707,

    Good to hear that it worked for you.

    Please find the below code which need to be sourced(capture command window) without selecting the design.

    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]
    set lDesign [GetActivePMDesign]
    set lNullObj NULL
    set lAliasName [DboTclHelper_sMakeCString]
    set lNetName [DboTclHelper_sMakeCString]
    set lSchiNetName [DboTclHelper_sMakeCString]
    if { $lDesign!= $lNullObj} {

    # puts $lDesign
    set lSchematicIter [$lDesign NewViewsIter $lStatus $::IterDefs_SCHEMATICS]
    # get the first schematic view
    set lView [$lSchematicIter NextView $lStatus]
    puts $lView
    while { $lView != $lNullObj} {
    # dynamic cast from DboView to DboSchematic
    set lSchematic [DboViewToDboSchematic $lView]
    set schematicName [DboTclHelper_sMakeCString]
    $lSchematic GetName $schematicName
    puts [DboTclHelper_sGetConstCharPtr $schematicName]
    set lSchiName [DboTclHelper_sGetConstCharPtr $schematicName]

    set lPagesIter [$lSchematic NewPagesIter $lStatus]
    # get the first page
    set lPage [$lPagesIter NextPage $lStatus]
    set lNullObj NULL
    while {$lPage!=$lNullObj} {
    # placeholder: do your processing on $lPage
    set pageName [DboTclHelper_sMakeCString]

    $lPage GetName $pageName
    puts [DboTclHelper_sGetConstCharPtr $pageName]
    set lPageName [DboTclHelper_sGetConstCharPtr $pageName]
    # get the next page
    set lWiresIter [$lPage NewWiresIter $lStatus]
    #get the first wire
    set lWire [$lWiresIter NextWire $lStatus]
    set lNullObj NULL
    while {$lWire != $lNullObj} {
    set lObjectType [$lWire GetObjectType]
    if {$lObjectType == $::DboBaseObject_WIRE_SCALAR} {

    #placeholder: do your processing on Wire scalar $lWire
    set lNet [$lWire GetNet $lStatus]
    $lWire GetNetName $lNetName
    $lNet GetNetName $lSchiNetName
    set SchiNetName [DboTclHelper_sGetConstCharPtr $lSchiNetName]
    set NetName [DboTclHelper_sGetConstCharPtr $lNetName]
    set lAliasIter [$lWire NewAliasesIter $lStatus]
    # #get the first alias of wire
    set lAlias [$lAliasIter NextAlias $lStatus]
    while { $lAlias!=$lNullObj} {
    #placeholder: do your processing on $lAlias
    $lAlias GetName $lAliasName


    set AliasNetName [DboTclHelper_sGetConstCharPtr $lAliasName]

    #get the next alias of wire
    # puts $lAlias
    set lAlias [$lAliasIter NextAlias $lStatus]
    }




    }
    puts "AliasNetName: = $AliasNetName , SchiNetName := $SchiNetName , NetName: = $NetName"
    #get the next wire
    set lWire [$lWiresIter NextWire $lStatus]
    }
    delete_DboPageWiresIter $lWiresIter

    set lPage [$lPagesIter NextPage $lStatus]

    }
    set lView [$lSchematicIter NextView $lStatus]
    delete_DboSchematicPagesIter $lPagesIter
    }

    delete_DboLibViewsIter $lSchematicIter

    }

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
  • AB_1717543042707
    0 AB_1717543042707 over 1 year ago in reply to CadAP

    Sorry for the late response but, this worked for me well. Thank you, I appreciate it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP over 1 year ago in reply to AB_1717543042707

    @AB_1717543042707 thanks for your feedback.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tennywhy
    0 tennywhy over 1 year ago in reply to CadAP

    it always stucked at the error: can't read "COrFindFilterDlg_NETS": no such variable .how i can solve this error, teach me please. thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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