• 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 get pin position and location?

Stats

  • State Suggested Answer
  • Replies 8
  • Answers 1
  • Subscribers 13
  • Views 1508
  • Members are here 0
More Content

How to get pin position and location?

Morgan
Morgan 3 months ago

Hi friends of the community,

After select one Symbol on Page with Capture CIS, How to get all pin position(Top, Bottom, Left, Right), and pin location (X,Y) to place wire, use TCL?

  • Sign in to reply
  • Cancel
  • KD202502275710
    0 KD202502275710 3 months ago in reply to CadAP

    I didnt get this one. Could you please elaborate. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 3 months ago in reply to KD202502275710

    KD202502275710 

    whish part you didn't understand?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 3 months ago in reply to CadAP

    Morgan 

    Please find below code for getting pin position(Left, Right, Top, Bottom):

    proc lGetPinPos {lPin} {
    set lStatus [DboState]
    set lPinName [DboTclHelper_sMakeCString]
    $lPin GetPinName $lPinName
    set PinName [DboTclHelper_sGetConstCharPtr $lPinName]
    # set lSelObj [GetSelectedObjects]
    # set lSelloc []
    set lPinHOtSpotCP [$lPin GetHotSpot $lStatus]

    set lPinHOtSpotCPx [DboTclHelper_sGetCPointX $lPinHOtSpotCP]
    set lPinHOtSpotCPy [DboTclHelper_sGetCPointY $lPinHOtSpotCP]

    #get the location point
    set lStartCP [$lPin GetStartPoint $lStatus]

    set lStartCPx [DboTclHelper_sGetCPointX $lStartCP]
    set lStartCPy [DboTclHelper_sGetCPointY $lStartCP]

    if {[expr {$lStartCPx - $lPinHOtSpotCPx}] > 0} {

    puts "Pin $PinName is Left Pointed"

    } elseif {[expr {$lStartCPx - $lPinHOtSpotCPx}] < 0} {

    puts "Pin $PinName is Right Pointed"

    } elseif {[expr {$lStartCPy - $lPinHOtSpotCPy}] > 0} {

    puts "Pin $PinName is Top Pointed"

    } elseif {[expr {$lStartCPy - $lPinHOtSpotCPy}] < 0} {

    puts "Pin $PinName is Bottom Pointed"

    }

    }

    set lStatus [DboState]
    set lSelObj [GetSelectedObjects]

    set lIter [$lSelObj NewPinsIter $lStatus]
    set lNullObj NULL
    #get the first pin of the part
    set lPin [$lIter NextPin $lStatus]
    while {$lPin !=$lNullObj } {
    #placeholder: do your processing on $lPin
    lGetPinPos $lPin
    #get the next pin of the part
    set lPin [$lIter NextPin $lStatus]
    }
    delete_DboPartInstPinsIter $lIter

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject 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