• 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 4633
  • 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
Reply
  • 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
Children
  • 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
  • tennywhy
    0 tennywhy over 1 year ago in reply to Jadystone

    if have one pin number eg U1.5,
    it's belongs to a multi-part package part,eg: U1.5 at the section U1B
    how can i get the U1B's page name from U1.5 with tcl
    could you give me some advice ?

    • 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  above tcl work for selected instance not for pin but you can modify the above tcl for getting the information when select pin .

    Tyr below suggestion to achieve your requirement,

    1. Get the selected Pin dbId (use command "GetSelectedObjects").

    2. Get the owner of the selected part (use command [GetSelectedObjects] GetOnwer). It will return the placed part instance.

    Now you have part instance you can use above tcl code to get the rest of information.

    Do let me know if still stuck.

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

    i cant figure it out sir, help me please. my scenario as below,
    in the design file has a mulit part package part U1, include U1A at page1,
    and U1B at page2, i have a pin number list, eg: U1.10, i want to know
    U1.10 on which page, then open the page and handle it.

    but when i try to get the U1.10's owner page (by pin ID get owner then to part,
    and then get owner, then to page, i have do the two steps correct)
    i cant get right result in PM or schematic view both. it's seem like it
    always return the first page has U1 parts, whenever the pins on which page.
    my code as below, teach me please, thanks

    set lStatus [DboState]
    set lobjs [CapFindObjects $COrFindFilterDlg_PARTS_PINS {*}]
    foreach lobj $lobjs {
    set lPrpName [DboTclHelper_sMakeCString]
    set lPrpValue [DboTclHelper_sMakeCString]
    set lPrpType [DboTclHelper_sMakeDboValueType]
    set lEditable [DboTclHelper_sMakeInt]
    # got list (inst instOCCU)
    set obj [lindex $lobj 0]
    # ignored below, right ???
    #set obj [lindex $lobj 1]

    #get pin's part
    set objPart [$obj GetOwner]
    #get part's page
    set objPage [$objPart GetOwner]
    #get page's schematic
    set objSch [$objPage GetOwner]

    set objC [DboTclHelper_sMakeCString]
    $objPart GetReference $objC
    set PartNm [DboTclHelper_sGetConstCharPtr $objC]

    set objC [DboTclHelper_sMakeCString]
    $objPage GetName $objC
    set PageNm [DboTclHelper_sGetConstCharPtr $objC]

    set objC [DboTclHelper_sMakeCString]
    $objSch GetName $objC
    set SCHNm [DboTclHelper_sGetConstCharPtr $objC]

    #OPEN pin's page and handle it
    OPage $objSch $PageNm
    }

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

    i have tried command "FindPins" then "GetSelectedObjects" , but it doesn't work, because i dont know which page the pin's on at the beginning

    • 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