• 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. Renaming the Offpage Connector Name Using TCL

Stats

  • State Verified Answer
  • Replies 2
  • Subscribers 12
  • Views 1490
  • Members are here 0
More Content

Renaming the Offpage Connector Name Using TCL

karthikeyank
karthikeyank over 1 year ago

Hi,

I have to rename the net names for selected offpage connectors. By using below attached code, it successfully renamed but in Schematic Net page it is not replacing can anyone help me out. im new to TCL.

It has to be replace like below image.

code:

namespace eval chk {} {

variable dirName [file dirname [info script]]
}


proc chk::chkfunc {} {
set selectedobjs [GetSelectedObjects]
set objlength [llength $selectedobjs]
set partName [DboTclHelper_sMakeCString]
set lStatus [DboState]
set lNullObj NULL
for {set i 0} {$i < $objlength} {incr i} {
set obj [lindex $selectedobjs $i]
$obj GetName $partName
set NNDt [DboTclHelper_sGetConstCharPtr $partName]
set pNameStr [DboTclHelper_sGetConstCharPtr $partName]
set pNameToReplaceWith "XXXYHHRR"
regsub -all $NNDt $pNameStr $pNameToReplaceWith pReplacedName
set pReplacedNameCStr [DboTclHelper_sMakeCString $pReplacedName]
$obj SetName $pReplacedNameCStr
set wireobj [$obj GetWire $lStatus]
set lPropNameCStr [DboTclHelper_sMakeCString "Name"]
set lPropValueCStr [DboTclHelper_sMakeCString $pReplacedName]
$wireobj SetColor $::DboValue_COLOR4
set lStatus [$wireobj SetEffectivePropStringValue $lPropNameCStr $lPropValueCStr]
}
}

chk::chkfunc

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

    Hi karthikeyank,

    Please use the below code to name the offpage Name attribute:

    set lAllOffPages [CapFindObjects $COrFindFilterDlg_OFF_PAGE_CONNECTORS {*}]
    set lStatus [DboState]
    set lNullObj NULL
    set lName [DboTclHelper_sMakeCString]
    foreach offpage $lAllOffPages {

    set offpage [lindex $offpage 0]
    set lPropsIter [$offpage NewDisplayPropsIter $lStatus]
    # set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    set lDProp [$lPropsIter NextProp $lStatus]
    while {$lDProp !=$lNullObj } {
    $lDProp GetName $lName

    if {[DboTclHelper_sGetConstCharPtr $lName] == "Name"} {
    UnSelectAll
    set Id [$lDProp GetId $lStatus]
    # puts $Id
    SelectObjectById $Id
    SetProperty {Name} {test45} ; #set the property Name

    }

    set lDProp [$lPropsIter NextProp $lStatus]

    }
    delete_DboDisplayPropsIter $lPropsIter
    }

    Hope this helps!

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

    Thanks, that worked.

    • Cancel
    • Vote Up +1 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