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

    I guess that caused by i just get the U1's DBID but not the U1A or U1B,
    but i have no idear how to get U1A or U1B's DBID

    • 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
<>
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