• 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 to use GetObjectOccurrences of DboPartInst in orcad...

Stats

  • State Verified Answer
  • Replies 3
  • Subscribers 14
  • Views 1651
  • Members are here 0
More Content

How to use GetObjectOccurrences of DboPartInst in orcad?

Jadystone
Jadystone over 1 year ago

I want to get all occurrences of a Partinst. I found the PartInst class has a method GetObjectOccurrences . But I don't know how  to use it. I can't find any example from internet. Could anyone help me?

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

    Hi Jadystone,

    Please check the below code for getting the occurrence of a selected part:

    set lSelObj [GetSelectedObjects]
    foreach $lObj $lSelObj {
    set lOccCount [$lObj GetOccurrencesCount]
    for {set i 0} {$i<$lOccCount} {incr i} {
    set lOcc [$lObj GetOccurrencesAtPos $i]
    lappend lPartOcc $lOcc
    }
    puts $lPartOcc
    }

    Hope this will help.

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

    Great! It works!

    This is my code to puts the occurrences  ref  out of a DboPartInst .

    set lPartOcc {}
    set lSelObj [GetSelectedObjects]
    foreach lObj $lSelObj {
        set lOccCount [$lObj GetOccurrencesCount]
        for {set i 0} {$i<$lOccCount} {incr i} {
            set lOcc [$lObj GetOccurrencesAtPos $i]

            set lName [DboTclHelper_sMakeCString]
            $lOcc GetPathName $lName
            set PathName [DboTclHelper_sGetConstCharPtr  $lName]
            puts $PathName

            lappend lPartOcc $lOcc
        }
    puts $lPartOcc
    }
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tennywhy
    0 tennywhy over 1 year ago in reply to Jadystone

    hi all, if i 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
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