• 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. Getting Hierarchical Page Occurrence Name

Stats

  • State Verified Answer
  • Replies 3
  • Subscribers 12
  • Views 1520
  • Members are here 0
More Content

Getting Hierarchical Page Occurrence Name

karthikeyank
karthikeyank over 1 year ago

Hi,

I want to print the Selected hierarchical Page Occurrence Name. can anyone please help me out.

Expected Output:

D02:CDPHY CONNECTION-0 ---- S1

D02:CDPHY CONNECTION-0 ---- S2

D02:CDPHY CONNECTION-0 ---- S3

D02:CDPHY CONNECTION-0 ---- S4

Code:

set selectedobjs [GetSelectedPMItems]
set objlength [llength $selectedobjs]
set lStatus [DboState]
set lNullObj NULL
for {set j 0} {$j < $objlength} {incr j} {
set lPage [lindex $selectedobjs $j]
set lPageNameCS [DboTclHelper_sMakeCString]
set lPageNameCS1 [DboTclHelper_sMakeCString]
$lPage GetName $lPageNameCS
set lPageName [DboTclHelper_sGetConstCharPtr $lPageNameCS]
puts $lPageName
       #Help me out here
}

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

    Hi karthikeyank,

    I am looking for a feasibility to get the desired output.

    Keep you posted soon.

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

    Hi karthikeyank,

    I am looking for a feasibility to get the desired output.

    Keep you posted soon.

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

    karthikeyank Please find the below tcl script for your requirement.:

    Please check and let me know your comments.

    set selectedobjs [GetSelectedPMItems]
    set objlength [llength $selectedobjs]
    set lStatus [DboState]
    set lNullObj NULL
    set lcount 0
    for {set j 0} {$j < $objlength} {incr j} {
    set lPage [lindex $selectedobjs $j]
    set lPageNameCS [DboTclHelper_sMakeCString]
    set lPageNameCS1 [DboTclHelper_sMakeCString]
    $lPage GetName $lPageNameCS
    set lPageName [DboTclHelper_sGetConstCharPtr $lPageNameCS]
    # puts $lPageName
    set PlIter [$lPage NewPartInstsIter $lStatus]
    set lPart [$PlIter NextPartInst $lStatus]
    if {$lPart != $lNullObj } {
    set lReferenceName [DboTclHelper_sMakeCString]
    $lPart GetReference $lReferenceName
    set lReferenceNameS [DboTclHelper_sGetConstCharPtr $lReferenceName]
    # puts $lReferenceNameS
    set lOccCount [$lPart GetOccurrencesCount]
    # puts $lOccCount
    for {set i 0} {$i<$lOccCount} {incr i} {
    set lOcc [$lPart GetOccurrencesAtPos $i]
    set lReferenceName1 [DboTclHelper_sMakeCString]
    $lOcc GetPathName $lReferenceName1
    set lReferenceNameS1 [DboTclHelper_sGetConstCharPtr $lReferenceName1]
    if {$lcount == 0} {
    puts "Selected Page $lPageName has below page occurances:"
    incr lcount
    }
    puts [lindex [split $lReferenceNameS1 "/" ] 0]
    }
    }
    }

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

    Thank you for your support.

    • 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