• 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. How can I get the parts pins and corresponding netname by...

Stats

  • State Not Answered
  • Replies 1
  • Subscribers 42
  • Views 1446
  • Members are here 0
More Content

How can I get the parts pins and corresponding netname by using the TCL command in OrCAD Capture?

EW202412038032
EW202412038032 10 months ago

Hi Community,

  I successfully used the TCL command to retrieve the PCBFootprint and Location. How can I obtain the part pins and their corresponding net names?

Regards,

ETWen

# source "D:\\Work\\OrCadAuto\\my_tcl\\test.tcl"
set lSession $::DboSession_s_pDboSession
DboSession -this $lSession
set lStatus [DboState]

set pDesignPath "D:\\test.dsn"
set lDesignPath [DboTclHelper_sMakeCString $pDesignPath]
set lDesign [$lSession GetDesignAndSchematics $lDesignPath $lStatus]

set pSchematicName SCHEMATIC1
set lSchematicName [DboTclHelper_sMakeCString $pSchematicName]
set lSchematic [$lDesign GetSchematic $lSchematicName $lStatus]

set lPagesIter [$lSchematic NewPagesIter $lStatus]
set lPage [$lPagesIter NextPage $lStatus]
set lNullObj NULL

set idx 0

while {$lPage != $lNullObj} {
set lPartInstsIter [$lPage NewPartInstsIter $lStatus]
#get the first part inst
set lInst [$lPartInstsIter NextPartInst $lStatus]
while {$lInst!=$lNullObj} {
set lPlaceInst [DboPartInstToDboPlacedInst $lInst]
if {$lPlaceInst != $lNullObj} {
set idx [expr $idx+1]

#PCBFootprint
set lPlaceInst_FootPrint [DboTclHelper_sMakeCString]
$lPlaceInst GetPCBFootprint $lPlaceInst_FootPrint

#Location
set lPlaceInst_RefDsn [DboTclHelper_sMakeCString]
$lPlaceInst GetReferenceDesignator $lPlaceInst_RefDsn

# Part Pins & Netname

dbg
}
#get the next part inst
set lInst [$lPartInstsIter NextPartInst $lStatus]
}
set lPage [$lPagesIter NextPage $lStatus]
}

delete_DboPagePartInstsIter $lPartInstsIter
delete_DboSchematicPagesIter $lPagesIter

 

  • Cancel
  • Sign in to reply
  • CadAP
    0 CadAP 10 months ago

    HI EW202412038032 ,

    Please modified code for getting the connected Pin and connected net name.

    # source "D:\\Work\\OrCadAuto\\my_tcl\\test.tcl"
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]

     set pDesignPath "D:\\test.dsn"
    # puts $pDesignPath
    set lDesignPath [DboTclHelper_sMakeCString $pDesignPath]
    set lDesign [$lSession GetDesignAndSchematics $lDesignPath $lStatus]
    # puts $lDesign
    set pSchematicName SCHEMATIC1
    set lSchematicName [DboTclHelper_sMakeCString $pSchematicName]
    set lSchematic [$lDesign GetSchematic $lSchematicName $lStatus]

    set lPagesIter [$lSchematic NewPagesIter $lStatus]
    set lPage [$lPagesIter NextPage $lStatus]
    set lNullObj NULL

    set idx 0

    while {$lPage != $lNullObj} {
    set lPartInstsIter [$lPage NewPartInstsIter $lStatus]
    #get the first part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    while {$lInst!=$lNullObj} {
    set lPlaceInst [DboPartInstToDboPlacedInst $lInst]
    if {$lPlaceInst != $lNullObj} {
    set idx [expr $idx+1]

    #PCBFootprint
    set lPlaceInst_FootPrint [DboTclHelper_sMakeCString]
    $lPlaceInst GetPCBFootprint $lPlaceInst_FootPrint

    #Location
    set lPlaceInst_RefDsn [DboTclHelper_sMakeCString]
    $lPlaceInst GetReferenceDesignator $lPlaceInst_RefDsn
    puts [DboTclHelper_sGetConstCharPtr $lPlaceInst_RefDsn]
    # Part Pins & Netname
    set lPinIter [$lPlaceInst NewPinsIter $lStatus]
    set lPlaceInst_lPinNameCString [DboTclHelper_sMakeCString]
    set lPinName_lNetNameCString [DboTclHelper_sMakeCString]
    set lPin [$lPinIter NextPin $lStatus]
    # puts $lPin
    while {$lPin != $lNullObj } {
    # puts $lPin
    $lPin GetPinName $lPlaceInst_lPinNameCString
    set lNet [$lPin GetNet $lStatus]
    if {$lNet != $lNullObj} {
    $lNet GetNetName $lPinName_lNetNameCString
    # set lNet [$lPin GetWire $lStatus]
    puts [DboTclHelper_sGetConstCharPtr $lPlaceInst_lPinNameCString]
    puts [DboTclHelper_sGetConstCharPtr $lPinName_lNetNameCString]
    }

    # puts [DboTclHelper_sGetConstCharPtr $lPlaceInst_lPinNameCString]

    set lPin [$lPinIter NextPin $lStatus]
    }


    }
    #get the next part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    }
    set lPage [$lPagesIter NextPage $lStatus]
    }

    delete_DboPagePartInstsIter $lPartInstsIter
    delete_DboSchematicPagesIter $lPagesIter
    delete_DboPartInstPinsIter $lPinIter

    Hope it helps!

    • 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