• 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 Scripting - TCL
  3. How can I get other parts infomation of a multi-part package...

Stats

  • State Verified Answer
  • Replies 13
  • Subscribers 14
  • Views 4915
  • Members are here 0
More Content

How can I get other parts infomation of a multi-part package part with tcl script?

Jadystone
Jadystone over 1 year ago

After I select just a part (for example U2A)  of a multi-part symbol. How I use TCL script to get other parts (such as U2B/U2C....) infomations?

I want to use tcl to get all wires connected to the part pins. In other word, I want to iterate all nets on all pins for the multi-part symbol.

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

    Hi Jadystone,

    Select the parts with multiple section and source the below code:


    proc dumplist {ref} {

    #Use current Session in Orcad_Capture
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lNullObj NULL
    set lStatus [DboState]
    set lDesign [$lSession GetActiveDesign]
    set lSchi_Name [DboTclHelper_sMakeCString]
    set lPropRef [DboTclHelper_sMakeCString "Reference"]
    set lPropPRName [DboTclHelper_sMakeCString "Part Reference"]
    set lPropPRVal [DboTclHelper_sMakeCString ]
    set lPropRefVal [DboTclHelper_sMakeCString ]
    set reflist {}
    if {$lDesign != $lNullObj} {

    set lSchematicIter [$lDesign NewViewsIter $lStatus $::IterDefs_SCHEMATICS]
    #get the first schematic view
    set lView [$lSchematicIter NextView $lStatus]

    set lPage_Name [DboTclHelper_sMakeCString]
    while { $lView != $lNullObj} {
    #dynamic cast from DboView to DboSchematic
    set lSchematic [DboViewToDboSchematic $lView]
    $lSchematic GetName $lSchi_Name
    set lPagesIter [$lSchematic NewPagesIter $lStatus]
    #get the first page
    set lPage [$lPagesIter NextPage $lStatus]
    # puts [DboTclHelper_sGetConstCharPtr $lSchi_Name]
    while {$lPage!=$lNullObj} {
    #placeholder: do your processing on $lPage
    $lPage GetName $lPage_Name
    # puts [DboTclHelper_sGetConstCharPtr $lPage_Name]
    set lPartInstsIter [$lPage NewPartInstsIter $lStatus]
    #get the first part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    while {$lInst!=$lNullObj} {
    #dynamic cast from DboPartInst to DboPlacedInst
    set lPlacedInst [DboPartInstToDboPlacedInst $lInst]
    if {$lPlacedInst != $lNullObj} {
    $lPlacedInst GetEffectivePropStringValue $lPropRef $lPropRefVal
    $lPlacedInst GetEffectivePropStringValue $lPropPRName $lPropPRVal
    if {[DboTclHelper_sGetConstCharPtr $lPropRefVal ] == $ref && [DboTclHelper_sGetConstCharPtr $lPropPRVal] != $ref} {

    lappend reflist [DboTclHelper_sGetConstCharPtr $lPropPRVal]

    }
    }
    #get the next part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    }
    #get the next page
    set lPage [$lPagesIter NextPage $lStatus]
    }
    #get the next schematic view
    set lView [$lSchematicIter NextView $lStatus]
    }
    delete_DboLibViewsIter $lSchematicIter
    delete_DboSchematicPagesIter $lPagesIter
    return $reflist
    }
    }


    set selObj [GetSelectedObjects]
    set lPropRefDes [DboTclHelper_sMakeCString "Reference"]
    set lPropRefDesVal [DboTclHelper_sMakeCString ]
    foreach obj $selObj {

    $obj GetEffectivePropStringValue $lPropRefDes $lPropRefDesVal
    set lRefdes [DboTclHelper_sGetConstCharPtr $lPropRefDesVal]
    # puts $lRefdes
    puts [dumplist $lRefdes]

    }

    Hope this helps!

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

    I get it. Thank you very much!

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

    tennywhy 

    Use below tcl code.

    copy and paste the below code in text file and save as .tcl. Now source the saved tcl in the capture command window.

    After sourcing type below command,  it will open the page on which U4 pin number 1 is paced and also give you page name, schematic name information in capture command window. 

    OpenPageWithSelectedPin U4.1 

    global lAllPins
    set lAllPins [CapFindObjects $COrFindFilterDlg_PARTS_PINS {*}]

    proc OpenPageWithSelectedPin {lRefdesPin_Number} {
    global lAllPins
    set list {}
    set lPageCS [DboTclHelper_sMakeCString]
    set lSchiCS [DboTclHelper_sMakeCString]
    set lPinNameCS [DboTclHelper_sMakeCString]
    set lPropRef [DboTclHelper_sMakeCString "Reference"]
    set lPropRefVal [DboTclHelper_sMakeCString ]
    foreach pin $lAllPins {

    $pin GetPinNumber $lPinNameCS
    set lPinNumber [DboTclHelper_sGetConstCharPtr $lPinNameCS]
    set lPartInst [$pin GetOwner]
    set lPage [$lPartInst GetOwner]
    $lPage GetName $lPageCS
    set lSchi [$lPage GetOwner]
    $lSchi GetName $lSchiCS
    $lPartInst GetEffectivePropStringValue $lPropRef $lPropRefVal
    set lPartRef [DboTclHelper_sGetConstCharPtr $lPropRefVal]
    set lPin_number "$lPartRef.$lPinNumber"
    # puts $lPin_number
    if {$lPin_number == $lRefdesPin_Number } {
    # puts "test"
    set lPageName [DboTclHelper_sGetConstCharPtr $lPageCS]
    set lSchiName [DboTclHelper_sGetConstCharPtr $lSchiCS]
    lappend list [DboTclHelper_sGetConstCharPtr $lPageCS] [DboTclHelper_sGetConstCharPtr $lSchiCS]
    OPage $lSchiName $lPageName
    }

    }

    puts $list

    }

    Hope it helps to achieve your requirement.

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

    wow! it's get work thanks, i have a last problem, actually my design is a complicated design, it's include two or more schematic,
    every schematic has several pages, seem as 

    design.dsn    schematic_1    page1
    `                    schematic_2    pg1    pg2


          when i use the command CapFindObjects $COrFindFilterDlg_PARTS_PINS {*} it's only worked the selected schematic(must select first), could i have some method make it work for whole design? or could make it work for a shematic list, by this i get schematic list first, then use the command CapFindObjects $COrFindFilterDlg_PARTS_PINS {*} for my schematic list

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

    more, when i select the dsn level in PM view, the find command get nothing

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

     tennywhy 

    command "CapFindObjects $COrFindFilterDlg_PARTS_PINS {*}" is working when I select the .dsn file.

    I have multiple schematic in my design and when I select the  .\dsn from the PM and run the below command it works as expected.

    OpenPAgeWithSelectedPin U2.1 --> it opens the page of schematic2.

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

    thanks sir, im confuesd, i checked it again and carefully, it could open the page under root schematic when i selected the .\dsn. it's failed when Pin not on root schematic's pages,  i checked the find result list also,   it's not there. sorry, it's bothered you

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

    thanks sir, im confuesd, i checked it again and carefully, it could open the page under root schematic when i selected the .\dsn. it's failed when Pin not on root schematic's pages,  i checked the find result list also,   it's not there. sorry, it's bothered you

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